Home

Results 1 to 1 of 1

Thread: lv snapshot not removing properly

Threaded View

  1. #1
    Join Date
    Nov 2010
    Posts
    2

    lv snapshot not removing properly

    hi
    I have a script to remove an lvm snapshot and recreate it. This works 95% of the time, but sometimes the remove doesn't happen properly and hangs the server next time it runs an lv command. it is not mounted. 11 sp3 patched to July 14.

    The remove is this but I get "lvremove backup1 complete" in the log so not picking up an error code.

    /sbin/lvremove -f /dev/scopevg/backup1
    if [ $? -ne 0 ]
    then
    echo "Error with lvremove." >> /$LogDir/$today.lv.log
    cat /$LogDir/$today.lv.log | mail -s "$Machine Backup Failed" email
    exit
    else
    echo "lvremove backup1 complete." >> /$LogDir/$today.lv.log
    fi

    it then doesn't get as far as the create command in the script as its bombed out.

    lvs output now shows (after a reboot as its hung) -
    LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
    backup1 scopevg -wi-a---- 5.00g

    no origin/no dat.

    normally -
    LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
    backup1 scopevg swi-a-s-- 5.00g scopellv 2.53

    the vg has space free - 34.98g. The lvsnapshot is created with -

    /sbin/lvcreate -s -L5G -n backup1 /dev/scopevg/scopelv

    Any suggestions how to make this work properly 100% of the time or catch whats wrong ? Thanks

    Elaine
    Last edited by cmap; 24-Aug-2014 at 09:41 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •