[linux-lvm] system won't boot after disk pull, vgreduce, reboot after re-inserting disk
nate.dailey at stratus.com
Fri Jan 17 20:18:02 UTC 2014
Hi, I'm looking for some advice as to how to deal with this situation.
A disk is pulled. Then vgreduce is used to take it out of the volume
group. System is shut down. Disk is re-inserted. Now the system won't
boot because "Recovery of volume group failed".
This is because in the initramfs, read-only locking is used. I verified
that if I changed the initramfs to use file locking (locking_type = 1),
it boots fine. I gather that this isn't safe though (it's unclear to me
Is this something that could ever be fixed in LVM, or is there just no
way out of this without manual intervention? Maybe some way that LVM
could automatically ignore the problem device?
Here's a demonstration of the problem without requiring a reboot:
[root at node0 ~]# vgcreate testvg /dev/sdd2 /dev/sde2
Volume group "testvg" successfully created
[root at node0 ~]# lvcreate -n testlv1 -L 1G testvg /dev/sdd2
Logical volume "testlv1" created
[root at node0 ~]# lvcreate -n testlv2 -L 1G testvg /dev/sde2
Logical volume "testlv2" created
[root at node0 ~]# echo 1 > /sys/block/sde/device/delete
[root at node0 ~]# vgreduce --force --removemissing testvg
/dev/testvg/testlv2: read failed after 0 of 4096 at 1073676288:
/dev/testvg/testlv2: read failed after 0 of 4096 at 1073733632:
/dev/testvg/testlv2: read failed after 0 of 4096 at 0: Input/output error
/dev/testvg/testlv2: read failed after 0 of 4096 at 4096:
Couldn't find device with uuid Nf66FO-dgXw-4pTa-lmB7-YAfL-AM4W-0iy6CA.
Removing partial LV testlv2.
Logical volume "testlv2" successfully removed
Wrote out consistent volume group testvg
[root at node0 ~]# emacs /etc/lvm/lvm.conf (change locking_type to 4 to
simulate initramfs environment)
[root at node0 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root at node0 ~]# lvscan
Read-only locking type set. Write locks are prohibited.
Recovery of volume group "testvg" failed.
Internal error: Attempt to unlock unlocked VG testvg.
Skipping volume group testvg
(this is what I see during the failed boot)
[root at node0 ~]# emacs /etc/lvm/lvm.conf (change locking_type back to 1)
[root at node0 ~]# lvscan
WARNING: Inconsistent metadata found for VG testvg - updating to use
Removing PV /dev/sde2 (Nf66FO-dgXw-4pTa-lmB7-YAfL-AM4W-0iy6CA) that
no longer belongs to VG testvg
ACTIVE '/dev/testvg/testlv1' [1.00 GiB] inherit
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the linux-lvm