Skip to content

main/lvm2: prevent LVM error during shutdown

Whenever a machine using LVM is shutdown then the "/etc/init.d/lvm2 stop", run as part of an orderly shutdown will output an error:

  * Shutting down the Logical Volume Manager
  * ERROR: lvm failed to stop

If the vgchange command in the init.d script is modified to not hide its output then instead the following is observed:

  * Shutting down the Logical Volume Manager
   Logical volume vg0/root contains a filesystem in use.
   Can't deactivate volume group "vg0" with 1 open logical volume(s)
  * ERROR: lvm failed to stop

At this point in shutdown the majority of filesystems have already been unmounted. However, obviously, / is not yet unmounted. The above error occurs because the LV containing the rootfs cannot be deactivated as the rootfs is still mounted. Therefore this is a "normal" error when the rootfs is using LVM and should be ignored.

Merge request reports