From feef447b8368244525dd98582b662a369098b2f7 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Mon, 6 Dec 2010 13:15:15 +0100 Subject: lvm: enable/disable monitoring of lvm2 groups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Monitoring does not work when /var is mounted ro, so only enable monitoring when we know that /var is rw. Thanks to Thomas Bächler for pointing this out. --- rc.shutdown | 7 +++++++ rc.sysinit | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/rc.shutdown b/rc.shutdown index ba4699f..8a63966 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -60,6 +60,13 @@ stat_busy "Deactivating Swap" /sbin/swapoff -a stat_done +# stop monitoring of lvm2 groups before unmounting filesystems +if [[ $USELVM =~ yes|YES && -x /sbin/lvm && -d /sys/block ]]; then + stat_busy "Deactivating monitoring of LVM2 groups" + /sbin/vgchange --monitor n >/dev/null 2>&1 + stat_done +fi + stat_busy "Unmounting Filesystems" /bin/umount -a -r -t noramfs,notmpfs,nosysfs,noproc,nodevtmpfs -O no_netdev stat_done diff --git a/rc.sysinit b/rc.sysinit index 0337826..211ee0a 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -236,6 +236,16 @@ run_hook sysinit_premount /bin/mount -a -t $NETFS -O no_netdev stat_done +# enable monitoring of lvm2 groups, now that the filesystems are mounted rw +if [[ $USELVM =~ yes|YES && -x /sbin/lvm && -d /sys/block ]]; then + stat_busy "Activating monitoring of LVM2 groups" + if /sbin/vgchange --monitor y >/dev/null; then + stat_done + else + stat_fail + fi +fi + status "Retrying failed UDEV events" /sbin/udevadm trigger --action=add --type=failed status "Activating Swap" /sbin/swapon -a -- cgit v1.2.3