<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font size="-1">Hi, I'm looking for some advice as to how to deal
      with this situation.<br>
      <br>
      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 </font><font size="-1"><font size="-1">"Recovery
        of volume group failed".<br>
        <br>
        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).<br>
        <br>
        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?<br>
        <br>
        Thanks,<br>
        <br>
        Nate<br>
        <br>
        <br>
        <br>
        Here's a demonstration of the problem without requiring a
        reboot:<br>
        <br>
      </font>[root@node0 ~]# vgcreate testvg /dev/sdd2 /dev/sde2<br>
        Volume group "testvg" successfully created<br>
      <br>
      [root@node0 ~]# lvcreate -n testlv1 -L 1G testvg /dev/sdd2<br>
        Logical volume "testlv1" created<br>
      <br>
      [root@node0 ~]# lvcreate -n testlv2 -L 1G testvg /dev/sde2<br>
        Logical volume "testlv2" created<br>
      <br>
      [root@node0 ~]# echo 1 > /sys/block/sde/device/delete<br>
      <br>
      [root@node0 ~]# vgreduce --force --removemissing testvg<br>
        /dev/testvg/testlv2: read failed after 0 of 4096 at 1073676288:
      Input/output error<br>
        /dev/testvg/testlv2: read failed after 0 of 4096 at 1073733632:
      Input/output error<br>
        /dev/testvg/testlv2: read failed after 0 of 4096 at 0:
      Input/output error<br>
        /dev/testvg/testlv2: read failed after 0 of 4096 at 4096:
      Input/output error<br>
        Couldn't find device with uuid
      Nf66FO-dgXw-4pTa-lmB7-YAfL-AM4W-0iy6CA.<br>
        Removing partial LV testlv2.<br>
        Logical volume "testlv2" successfully removed<br>
        Wrote out consistent volume group testvg<br>
      <br>
      [root@node0 ~]# emacs /etc/lvm/lvm.conf (change locking_type to 4
      to simulate initramfs environment)<br>
      <br>
      [root@node0 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
      <br>
      <br>
      [root@node0 ~]# lvscan<br>
        Read-only locking type set. Write locks are prohibited.<br>
        Recovery of volume group "testvg" failed.<br>
        Internal error: Attempt to unlock unlocked VG testvg.<br>
        Skipping volume group testvg<br>
      <br>
      (this is what I see during the failed boot)<br>
      <br>
      [root@node0 ~]# emacs /etc/lvm/lvm.conf (change locking_type back
      to 1)<br>
      <br>
      [root@node0 ~]# lvscan<br>
        WARNING: Inconsistent metadata found for VG testvg - updating to
      use version 5<br>
        Removing PV /dev/sde2 (Nf66FO-dgXw-4pTa-lmB7-YAfL-AM4W-0iy6CA)
      that no longer belongs to VG testvg<br>
        ACTIVE            '/dev/testvg/testlv1' [1.00 GiB] inherit<br>
      <br>
    </font>
  </body>
</html>