This is an old revision of the document!
Table of Contents
LVM
Get rid of detatched PVs
After removing a LVM physical device without unmounting and deactivating the volumes first, you see this kind of error:
~ # pvs /dev/vg_foo/lv_bar: read failed after 0 of 4096 at 53687025664: Input/output error /dev/vg_foo/lv_bar: read failed after 0 of 4096 at 53687083008: Input/output error /dev/vg_foo/lv_bar: read failed after 0 of 4096 at 0: Input/output error /dev/vg_foo/lv_bar: read failed after 0 of 4096 at 4096: Input/output error PV VG Fmt Attr PSize PFree /dev/md127 vg_fnords lvm2 a-- 742.96g 177.71g : :
To get rid of them, you have to check for /dev/dm-
XX device corresponding to the logical volume(s) in question:
~ # ls -la /dev/disk/by-label total 0 drwxr-xr-x 2 root root 840 Jul 12 16:40 ./ drwxr-xr-x 8 root root 160 Jul 12 16:40 ../ : lrwxrwxrwx 1 root root 11 Jul 12 16:22 foobar -> ../../dm-37 :
(assuming the filesystem label of the logical volume in question has been “foobar”)
No you can remove that device mapper device from the system by
~ # dmsetup remove /dev/dm-37
… and your lvm commands are quiet again
Boot with /usr etc. on LVM
Recent Ubuntu and Mint distributions seem to have trouble booting systems where relevant filesystems on LVM are referenced by label or uuid instead of /dev/
… .
Tracking this down on Mint 18.2 lead me to the file /usr/share/initramfs-tools/scripts/local-block/lvm2
, where lvm lvchange
is only called for devices matching the pattern /dev/*/*