Bug#884283: lvm2 prerm ought to check if root is on lvm

Ian Jackson ian.jackson at eu.citrix.com
Wed Dec 13 11:13:14 UTC 2017


Package: lvm2
Version: 2.02.111-2.2+deb8u1

A few weeks ago, I asked apt to remove dmeventd and it removed lvm2 as
a consequence.  Failing to observe that lvm2 was in the list of other
things to be removed was user error on my part.

However, it would have been nice if lvm2's prerm had observed that my
root was on lvm, and that removal of lvm2 was probably inadvisable.

(As it happens, I noticed before I next rebooted when a cron job
failed.  So I was able to reinstall lvm2 before anything really
annoying happened.)

Information that the lvm2 prerm could have used include:

root at mariner:~# grep root /etc/fstab 
/dev/mapper/vg--mariner2-lv--root /               ext4    errors=remount-ro 0       1
root at mariner:~# dmsetup table | grep lv--root
vg--mariner2-lv--root: 0 39059456 linear 254:0 2048
root at mariner:~# mount | grep 'on / '
/dev/mapper/vg--mariner2-lv--root on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
root at mariner:~# stat --format %D /
fe03
root at mariner:~# stat -L --format '%t %T %N' /dev/mapper/* 2>/dev/null | grep 'fe 3 '
fe 3 ‘/dev/mapper/vg--mariner2-lv--root’
root at mariner:~# lvm lvs | grep lv-root
  lv-root      vg-mariner2 -wi-ao----  18.62g                                                      
root at mariner:~#

Even though this is an enhancement request, I am filing this bug
report at normal severity because of the possible inconvenience caused
by this kind of error.

It would probably be worth making a similar check for /usr (which
might, of course, not be a mount point).

Thanks,
Ian.



More information about the pkg-lvm-maintainers mailing list