From: Nate Dailey <nate.dailey@stratus.com>
To: linux-lvm@redhat.com
Subject: [linux-lvm] system won't boot after disk pull, vgreduce, reboot after re-inserting disk
Date: Fri, 17 Jan 2014 15:18:02 -0500 [thread overview]
Message-ID: <52D98FFA.7020203@stratus.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2470 bytes --]
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
why).
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?
Thanks,
Nate
Here's a demonstration of the problem without requiring a reboot:
[root@node0 ~]# vgcreate testvg /dev/sdd2 /dev/sde2
Volume group "testvg" successfully created
[root@node0 ~]# lvcreate -n testlv1 -L 1G testvg /dev/sdd2
Logical volume "testlv1" created
[root@node0 ~]# lvcreate -n testlv2 -L 1G testvg /dev/sde2
Logical volume "testlv2" created
[root@node0 ~]# echo 1 > /sys/block/sde/device/delete
[root@node0 ~]# vgreduce --force --removemissing testvg
/dev/testvg/testlv2: read failed after 0 of 4096 at 1073676288:
Input/output error
/dev/testvg/testlv2: read failed after 0 of 4096 at 1073733632:
Input/output error
/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:
Input/output error
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@node0 ~]# emacs /etc/lvm/lvm.conf (change locking_type to 4 to
simulate initramfs environment)
[root@node0 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@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@node0 ~]# emacs /etc/lvm/lvm.conf (change locking_type back to 1)
[root@node0 ~]# lvscan
WARNING: Inconsistent metadata found for VG testvg - updating to use
version 5
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
[-- Attachment #2: Type: text/html, Size: 3547 bytes --]
reply other threads:[~2014-01-17 20:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52D98FFA.7020203@stratus.com \
--to=nate.dailey@stratus.com \
--cc=linux-lvm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.