Bug 134102

Summary: LVM fails to execute vgchange -a y in rc.sysinit
Product: Red Hat Enterprise Linux 4 Reporter: Al Tobey <albert.tobey>
Component: lvm2Assignee: Alasdair Kergon <agk>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-29 16:55:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Al Tobey 2004-09-29 16:46:05 UTC
Description of problem:
On the first boot of a freshly installed laptop with RHEL4b1,
filesystems could not be mounted because rc.sysinit didn't execute
vgchange -a y.   Copying the line that's supposed to do this to just
after the if/fi block for LVM2 makes everything work.   I'm guessing
LVM was looking at my DVD drive or something like that.

Instead of using vgscan's return value (which can fail due to cdroms
and floppy drives returning errors), maybe use this:

if lvm.static vgchange -t -a y --ignorelockingfailure >/dev/null 2>&1
then
   action "blah blah" lvm.static vgchange -a y --ignorelockingfailure
fi

Here's what the filesystem layout looks like:
[root@linuxws1 tmp]# df -hP
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda2             479M  342M  113M  76% /
none                  252M     0  252M   0% /dev/shm
/dev/mapper/vgroot-lv_home  9.7G  4.4G  4.8G  48% /home
/dev/mapper/vgroot-lv_opt  993M  140M  803M  15% /opt
/dev/mapper/vgroot-lv_ora  496M   11M  460M   3% /ora
/dev/mapper/vgroot-lv_tmp  496M   27M  444M   6% /tmp
/dev/mapper/vgroot-lv_usr  4.9G  2.9G  1.7G  64% /usr
/dev/mapper/vgroot-lv_usrlocal  496M   11M  460M   3% /usr/local
/dev/mapper/vgroot-lv_var  993M  149M  794M  16% /var

Here is the modified portion of rc.sysinit:
# LVM2 initialization
if [ -x /sbin/lvm.static ]; then
    if ! LC_ALL=C fgrep -q "device-mapper" /proc/devices 2>/dev/null ;
then
    modprobe dm-mod >/dev/null 2>&1
    fi
    echo "mkdmnod" | /sbin/nash --quiet >/dev/null 2>&1
    [ -n "$SELINUX" ] && restorecon /dev/mapper/control >/dev/null 2>&1
    if [ -c /dev/mapper/control -a -x /sbin/lvm.static ]; then
    if /sbin/lvm.static vgscan --mknodes --ignorelockingfailure >
/dev/null 2>&1 ; then
        action $"Setting up Logical Volume Management:"
/sbin/lvm.static vgchange -a y --ignorelockingfailure
    fi
    fi
fi

# execute vgchange -a y no matter what because it isn't working
# for some reason (-tobeya)
        action $"Setting up Logical Volume Management:"
/sbin/lvm.static vgchange -a y --ignorelockingfailure
# LVM initialization

Comment 1 Alasdair Kergon 2004-09-29 16:53:26 UTC
Should be fixed in 2.00.25-1.


Comment 2 Alasdair Kergon 2004-09-29 16:54:50 UTC

*** This bug has been marked as a duplicate of 132870 ***