--- rc-scripts-1.4.16.orig/init.d/checkfs 2004-11-29 10:59:20.000947255 -0600 +++ rc-scripts-1.4.16.orig/init.d/checkfs 2004-11-29 10:59:48.000007020 -0600 @@ -33,11 +33,11 @@ then ebegin "Setting up the Logical Volume Manager" #still echo stderr for debugging - /sbin/vgscan >/dev/null + /sbin/vgscan --ignorelockingfailure --mknodes -P >/dev/null if [ "$?" -eq 0 ] && [ -x /sbin/vgchange ] && \ [ -f /etc/lvmtab -o -d /etc/lvm ] then - /sbin/vgchange -a y >/dev/null + /sbin/vgchange --ignorelockingfailure -P -a y >/dev/null fi eend $? "Failed to setup the LVM" fi --- rc-scripts-1.4.16.orig/init.d/halt.sh 2004-11-29 10:59:20.000900143 -0600 +++ rc-scripts-1.4.16.orig/init.d/halt.sh 2004-11-29 10:59:44.000093614 -0600 @@ -124,14 +124,60 @@ eend 0 # Stop LVM -if [ -x /sbin/vgchange ] && [ -f /etc/lvmtab -o -d /etc/lvm ] && \ +if [ -x /sbin/vgchange ] && \ + [ -x /sbin/lvdisplay ] && \ + [ -x /sbin/vgdisplay ] && \ + [ -x /sbin/lvchange ] && \ + [ -f /etc/lvmtab -o -d /etc/lvm ] && \ [ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ] then - ebegin "Shutting down the Logical Volume Manager" - /sbin/vgchange -a n >/dev/null - eend $? "Failed to shut LVM down" + einfo "Shutting down the Logical Volume Manager" + # If these commands fail it is not currently an issue + # as the system is going down anyway based on the current LVM + # functionality as described in this forum thread + #https://www.redhat.com/archives/linux-lvm/2001-May/msg00523.html + + LOGICAL_VOLUMES=`lvdisplay |grep "LV Name"|awk '{print $3}'|sort|xargs echo` + VOLUME_GROUPS=`vgdisplay |grep "VG Name"|awk '{print $3}'|sort|xargs echo` + for x in ${LOGICAL_VOLUMES} + do + LV_IS_ACTIVE=`lvdisplay ${x}|grep "#"|awk '{print $3}'` + if [ "${LV_IS_ACTIVE}" = 0 ] + then + ebegin " Shutting Down logical volume: ${x} " + lvchange -an --ignorelockingfailure -P ${x} >/dev/null + eend $? + fi + done + + for x in ${VOLUME_GROUPS} + do + VG_HAS_ACTIVE_LV=`vgdisplay ${x}|grep "Open LV"|awk '{print $3}'|xargs echo` + if [ "${VG_HAS_ACTIVE_LV}" = 0 ] + then + ebegin " Shutting Down volume group: ${x} " + vgchange -an --ignorelockingfailure -P ${x} >/dev/null + eend + fi + done + + for x in ${LOGICAL_VOLUMES} + do + LV_IS_ACTIVE=`lvdisplay ${x}|grep "#"|awk '{print $3}'` + if [ "${LV_IS_ACTIVE}" = 1 ] + then + + ROOT_DEVICE=`mount|grep " / "|awk '{print $1}'` + if [ ! ${ROOT_DEVICE} = ${x} ] + then + ewarn " Unable to shutdown: ${x} " + fi + fi + done + einfo "Finished Shutting down the Logical Volume Manager" fi + # This is a function because its used twice below this line as: # [ -f /etc/killpower ] && ups_kill_power ups_kill_power() {