lvremove of LVM snapshot in backup script fsarchiver ?

Topics about the system utilities that are not related to Hard-disk and storage
ulefr01
Posts: 8
Joined: 11 Nov 2008, 17:05

lvremove of LVM snapshot in backup script fsarchiver ?

Postby ulefr01 » 14 Jun 2013, 18:01

i am using the backup script using fsarchiver (see http://www.sysresccd.org/Sysresccd-LVM- ... s-with-LVM )
the lvremove of the lvm snapshot is not done anymore ,
(lvm snapshot stays active !)
i get always : "cannot remove the lvm snapshot"

Any idea ? (maybe sync before the lvremove command....)

a manual remove in terminal passed :
lvremove -vf /dev/lxmintvg2/mysnap
Using logical volume(s) on command line
Archiving volume group "lxmintvg2" metadata (seqno 182).
Found volume group "lxmintvg2"
Removing lxmintvg2-mysnap (254:8)
Releasing logical volume "mysnap"
Creating volume group backup "/etc/lvm/backup/lxmintvg2" (seqno 183).
Logical volume "mysnap" successfully removed

It is not working within the bash script !

gernot
Posts: 1123
Joined: 07 Apr 2010, 16:19

Re: lvremove of LVM snapshot in backup script fsarchiver ?

Postby gernot » 15 Jun 2013, 06:23

if ! lvremove -f /dev/${VOLGROP}/${SNAPVOL} >/dev/null 2>&1

remove the >/dev/null 2>&1 from upper line to get more information.

Gernot

ulefr01
Posts: 8
Joined: 11 Nov 2008, 17:05

Re: lvremove of LVM snapshot in backup script fsarchiver ?

Postby ulefr01 » 15 Jun 2013, 11:11

gernot wrote:if ! lvremove -f /dev/${VOLGROP}/${SNAPVOL} >/dev/null 2>&1

remove the >/dev/null 2>&1 from upper line to get more information.

Gernot


i got this :
./archive-mint-boot
creation of the lvm snapshot was successfull
fsarchiver savefs -Lboot -z7 -j3 -s 2000 /media/EHD4P1/linuxmint/backupboot-20130615-13h09.fsa /dev/lxmintvg2/mysnap
Archive will be split into volumes of 2097152000 bytes (1.95 GB)
Statistics for filesystem 0
* files successfully processed:....regfiles=229, directories=4, symlinks=0, hardlinks=0, specials=0
* files with errors:...............regfiles=0, directories=0, symlinks=0, hardlinks=0, specials=0
fsarchiver done
Using logical volume(s) on command line
Archiving volume group "lxmintvg2" metadata (seqno 213).
Removing snapshot mysnap
Found volume group "lxmintvg2"
Found volume group "lxmintvg2"
Loading lxmintvg2-boot table (254:2)
Loading lxmintvg2-mysnap table (254:8)
lxmintvg2/snapshot0 already not monitored.
Suspending lxmintvg2-boot (254:2) with device flush
Suspending lxmintvg2-mysnap (254:8) with device flush
Suspending lxmintvg2-boot-real (254:9) with device flush
Suspending lxmintvg2-mysnap-cow (254:10) with device flush
Found volume group "lxmintvg2"
Resuming lxmintvg2-mysnap-cow (254:10)
Resuming lxmintvg2-boot-real (254:9)
Resuming lxmintvg2-mysnap (254:8)
Removing lxmintvg2-mysnap-cow (254:10)
Found volume group "lxmintvg2"
Resuming lxmintvg2-boot (254:2)
Unable to deactivate open lxmintvg2-boot-real (254:9)
Failed to resume boot.
cannot remove the lvm snapshot

Afterwards without the bash script fsarchiver (in my case archive-mint-boot ), i can do it
lvremove -vf /dev/lxmintvg2/mysnap
Using logical volume(s) on command line
Archiving volume group "lxmintvg2" metadata (seqno 214).
Found volume group "lxmintvg2"
Removing lxmintvg2-mysnap (254:8)
Releasing logical volume "mysnap"
Creating volume group backup "/etc/lvm/backup/lxmintvg2" (seqno 215).
Logical volume "mysnap" successfully removed

Why is it not working within the bash script ?


Return to “System software”

Who is online

Users browsing this forum: No registered users and 2 guests