[Bug 737198] New: lvm: Making a vg unavailable sometimes fails if it was used before
https://bugzilla.novell.com/show_bug.cgi?id=737198 https://bugzilla.novell.com/show_bug.cgi?id=737198#c0 Summary: lvm: Making a vg unavailable sometimes fails if it was used before Classification: openSUSE Product: openSUSE 12.1 Version: Final Platform: x86-64 OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: Yarny@public-files.de QAContact: qa@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20100101 Firefox/8.0 When I create a LVM volume group and a logical volume, and then try to set the volume group unavailable (with "vgchange -a n"), this sometimes fails. Reproducible: Sometimes Steps to Reproduce: I tested this in a VirtualBox (hosted on oS 11.4) with a fresh 48GiB harddisk, which is booted from November's 12.1 KDE-LiveCD. Caution: This destroys /dev/sda ! Run this: ################################################################ DEV=/dev/sda dd if=/dev/zero of=$DEV bs=1K count=1K pvcreate $DEV vgcreate testvg $DEV lvcreate -l 100%VG -n testlv testvg mkswap -f /dev/testvg/testlv vgchange -a n testvg ################################################################ Actual Results: Can't deactivate volume group "testvg" with 1 open logical volume(s) Expected Results: 0 logical volume(s) in volume group "testvg" now active It only fails if this script is saved to a file and executed as a whole by bash. Manually typing in the commands is too slow. To repeat the script after a failure ("Can't deactivate..."), you will have to wait a few seconds, then again "vgchange -a n testvg", which should succeed. It does not always fail. Here's what I observed. After booting the machine, the script succeeds several times. After maybe a dozen cycles of the script, it suddenly fails for the first time, and then it fails in most cases. mkswap seems to be innocent. After a reboot, I couldn't get it to fail without the mkswap-line, but after the first failure, it mostly fails even without the mkswap-line. I'm quite sure there is a race-condition involved somewhere. I retried it with a loop-device that is backed by a file in /tmp. On the Live-CD such a file resides entirely in memory I understand. It never failed on this device. Then I created an ext4 on /dev/sda and used a file on this fs for a loop device. There it failed, but I had the impression that it failed less often. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=737198
https://bugzilla.novell.com/show_bug.cgi?id=737198#c
zj jia
https://bugzilla.novell.com/show_bug.cgi?id=737198
https://bugzilla.novell.com/show_bug.cgi?id=737198#c2
GuangLiang Zhao
https://bugzilla.novell.com/show_bug.cgi?id=737198
https://bugzilla.novell.com/show_bug.cgi?id=737198#c3
--- Comment #3 from Yarny Yarny
Can you collect the log when vgchange fails? Here is the very-verbose output of vgchange --- I hope that's what you ment. There are no messages about this in /var/log/messages or in dmesg. Yarny
-- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=737198
https://bugzilla.novell.com/show_bug.cgi?id=737198#c4
--- Comment #4 from GuangLiang Zhao
https://bugzilla.novell.com/show_bug.cgi?id=737198
https://bugzilla.novell.com/show_bug.cgi?id=737198#c5
GuangLiang Zhao
Created an attachment (id=469304) --> (http://bugzilla.novell.com/attachment.cgi?id=469304) [details] Output of "vgchange -an testvg -vvvvvvvvvvvvvvvv" (stdout+stderr)
Hi GuangLiang Zhao,
Can you collect the log when vgchange fails? Here is the very-verbose output of vgchange --- I hope that's what you ment. There are no messages about this in /var/log/messages or in dmesg. Yarny
Hi Yarny, Mkswap will trigger an event of udev, because the swap partition is a device-mapper device. I think you need to use "udevadm settle" to wait that udev's finishing to prevent from race condition. your script should be like this: DEV=/dev/sda dd if=/dev/zero of=$DEV bs=1K count=1K pvcreate $DEV vgcreate testvg $DEV lvcreate -l 100%VG -n testlv testvg mkswap -f /dev/testvg/testlv + udevadm settle vgchange -a n testvg -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=737198
https://bugzilla.novell.com/show_bug.cgi?id=737198#c6
--- Comment #6 from Yarny Yarny
https://bugzilla.novell.com/show_bug.cgi?id=737198
https://bugzilla.novell.com/show_bug.cgi?id=737198#c7
GuangLiang Zhao
participants (1)
-
bugzilla_noreply@novell.com