Public bug reported:

Binary package hint: lvm2

When a disk containing an active LVM volume has been removed without
properly closing the LVM volume first, LVM becomes unusable as the LVM
mapping entries remain active but can never be closed anymore since the
disk is gone.

ls -al /dev/mapper/
totaal 0
drwxr-xr-x  2 root root     180 2008-04-27 19:55 .
drwxr-xr-x 15 root root   14880 2008-04-28 12:21 ..
crw-rw----  1 root root  10, 63 2008-04-27 21:53 control
brw-rw----  1 root disk 254,  5 2008-04-27 19:55 encrypted-debian
brw-rw----  1 root disk 254,  4 2008-04-27 19:55 encrypted-swap
brw-rw----  1 root disk 254,  3 2008-04-27 19:55 
luks_crypto_1c95cbac-b4a3-436e-9d75-56f8ff2d8947

luks_crypto_XXX is the partition on the USB disk. encrypted-debian and
encrypted-swap are the LVM volumes which were enabled with  vgchange -a
y

Then, the disk was removed (perhaps laptop suspended, disk removed when
packing it, laptop resumed, it's easy to accidentally unplug),

> vgchange -a n

  /dev/mapper/luks_crypto_1c95cbac-b4a3-436e-9d75-56f8ff2d8947: read failed 
after 0 of 4096 at 92643786752: Invoer-/uitvoerfout
  /dev/mapper/luks_crypto_1c95cbac-b4a3-436e-9d75-56f8ff2d8947: read failed 
after 0 of 4096 at 0: Invoer-/uitvoerfout
  /dev/encrypted/swap: read failed after 0 of 4096 at 805240832: 
Invoer-/uitvoerfout
  /dev/encrypted/swap: read failed after 0 of 4096 at 0: Invoer-/uitvoerfout
  /dev/encrypted/debian: read failed after 0 of 4096 at 90760478720: 
Invoer-/uitvoerfout
  /dev/encrypted/debian: read failed after 0 of 4096 at 0: Invoer-/uitvoerfout


So there is no real way to get rid of these anymore, and re-plugging this disk 
does not try to mount the Luks partition anymore. The only real way out is to 
reboot.

What should happen: the disk is not going to come back in the original
mounted state, ever again. LVM should just forget about it, discard
whatever is there, either automatically (preferred) or through a
commandline switch (which would ideally be done directly by Ubuntu when
one unplugs such a disk).

** Affects: lvm2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
LVM unusable after uncleanly unplugging USB disk
https://bugs.launchpad.net/bugs/223583
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to