Bug 77539

Summary: lvm initialization fails at /etc/rc.d/rc.sysinit line 310.
Product: [Retired] Red Hat Linux Reporter: Dan <mothbitten1>
Component: lvmAssignee: Stephen Tweedie <sct>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-11-13 15:40:28 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Dan 2002-11-08 14:22:30 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Description of problem:
I set up a logical volume, tested it by mounting it with the mount command and 
doing a df, so no problems there. The problem is that the test at line 310:
 if [ -e /proc/lvm -a -x /sbin/vgchange -a -e /etc/lvmtab ]
fails, leading to the system not booting the rest of the way and going into a 
failsafe prompt environment, even though those files exist. When I commented 
out that line (and the fi command at line 312) everything worked fine. The 
problem is with the test.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.create an logical volume
2.add it to /etc/fstab
3.reboot
	

Actual Results:  system went into a maintenance shell

Expected Results:  system should have booted happily

Additional info:
Comment 1 Stephen Tweedie 2002-11-11 12:31:38 EST
You probably need to re-run "mkinitrd".  Kernel modules needed at boot time get
loaded along with the initial kernel image, and the installer sets all that up
so that the initrd includes the lvm.o module if needed.  Please reopen the bug
if that doesn't get things going.
Comment 2 Dan 2002-11-13 15:32:07 EST
The lvm problem--really it is not a problem with lvm itself, which works fine, 
but I was not able to determine where else to report this--is with the 
rc.sysinit file. When I start lvm manually--vgscan, vgchange -a y, and so on--
it works fine, no module errors or anything. The fix is easy: remove the 
-e /proc/lvm part of the test on line 310 of rc.sysinit. After that is done, 
all works fine. This leads me to believe that the proc filesystem is not 
testable at this stage of loading, thus the error. This error also occurs if 
lvm is set up during the installation.
Comment 3 Stephen Tweedie 2002-11-13 16:29:15 EST
The rules in Red Hat Linux are simple --- the initscripts only set up the LVM
volumes if the kernel has been set up with LVM configured.  That's NOT a bug,
it's simply the design of the initscripts.

And you *need* to rerun mkinitrd AND (unless you're using grub) lilo if you
enable LVM after the initial setup.  Otherwise, the initial kernel boot won't
load with the LVM modules, and the init scripts won't see /proc/lvm present, and
you won't get the volumes initialised.

I have many systems here using LVM perfectly happily using this.  The existing
8.0 rc.sysinit works with this scheme just fine --- IF you enable LVM in your
kernel boot (via the initrd).

If you have a reproducible case where setting up LVM in the initial install
doesn't result in LVM being enabled at run time, then please file that bug
against the installer ("anaconda").
Comment 4 Stephen Tweedie 2002-12-06 18:39:12 EST
*** Bug 79018 has been marked as a duplicate of this bug. ***
Comment 5 Dax Kelson 2003-04-15 13:41:32 EDT
Incidentally, this is NOT a problem (not having the LVM kernel moduled
loaded in the initial ram disk) in Red Hat Linux 9.

Red Hat Linux 9's rc.sysinit file will load the LVM kernel module if the
initial ram disk didn't. Here is the relevant portion.

# LVM initialization
if [ -f /etc/lvmtab -a ! -e /proc/lvm ] ; then
        modprobe lvm-mod >/dev/null 2>&1
fi
if [ -e /proc/lvm -a -x /sbin/vgchange -a -f /etc/lvmtab ]; then
        action $"Setting up Logical Volume Management:" /sbin/vgscan &&
/sbin/vgchange -a y
fi