Gentoo Archives: gentoo-user

From: Roman Naumann <roman_naumann@××××××××.fm>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Random failures: lvremove
Date: Sun, 18 Apr 2010 10:39:35
Message-Id: 201004181238.45828.roman_naumann@fastmail.fm
1 Hi,
2
3 I'm using LVM, having / and /home as logical volumes and a backup script
4 creating a logical snapshot volume of each in the process.
5
6 Since I use gentoo (comming from arch), my backup script fails rather often
7 with the error message 'Can't remove open logical volume <volume>'. The script
8 worked fine on arch before. The partition setup did not change.
9
10 Sometimes it works fine, sometimes it just fails.
11 As a workaround, I let the script just lvremove the snapshot three times with
12 5 seconds sleeping between the tries and the overall success rate for the
13 script improved...
14 The chance is about 40% lvremove succeeds at a given time and doesn't seem to
15 in- or decrease when calling lvremove successively with a five second delay,
16 though if it fails once, it tends to fail again more often if called within
17 the next two or three seconds.
18
19 Here is an example of the command failing once more after the backup script
20 aborted. The second time it works. I did NOTHING but the commands listed below
21 in these 30 seconds or so: (note: dmsetup says "open: 0" in the first place!)
22
23 kira namor # dmsetup info -c vg-snap_root
24 Name Maj Min Stat Open Targ Event UUID
25 vg-snap_root 253 5 L--w 0 1 0 LVM-
26 ayg5GD1dYyrkkan1pLa8WszI7UrQpy9YE2ynOTtHoSNckKdehm3XMIgkw7p8z69X
27 kira namor # lvremove /dev/vg/snap_root
28 Can't remove open logical volume "snap_root"
29 kira namor # lsof /dev/vg/snap_root
30 kira namor # fuser -a /dev/vg/snap_root
31 /dev/vg/snap_root:
32 kira namor # lvremove /dev/vg/snap_root
33 Do you really want to remove active logical volume snap_root? [y/n]: y
34 Logical volume "snap_root" successfully removed
35
36 What I tried so far was:
37 -> calling: lvchange -an $SNAP_PARTITION #fails iff lvremove fails
38 -> updating to lvm2-2.02.56-r3 and updating the initramfs #fixes nothing
39
40 I have no idea what causes this random behavior.
41 Help much appreciated.
42
43 Regards,
44 Roman Naumann

Replies

Subject Author
Re: [gentoo-user] Random failures: lvremove Roman Naumann <roman_naumann@××××××××.fm>