Bug 65260

Summary: rc.sysinit fails to call vgscan in certain configurations
Product: [Retired] Red Hat Linux Reporter: Brett Frankenberger <rbf>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED DEFERRED QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: rbf, rvokal, teg, zmousm
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-29 19:57:56 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 Brett Frankenberger 2002-05-21 02:35:10 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (WinNT; U)

Description of problem:
In a configuration with a single physical volume on a software RAID disk (/dev/md?) (and possibly in other configurations as well), rc.sysinit fails 
to 
call vgscan, resulting in the lvm system not coming up, and lvm-based filesystems not mounting at startup.

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


How reproducible:
Always

Steps to Reproduce:
NOTE: The prodedure below matches that I did.  I'm not sure if it's a requirement to have only one physical volume, and to have that physical 
volume 
on a RAID disk, but that's the configuration I used.  

1.  Install a standard RedHat 7.3 installation.  Don't create any RAID disks during the install.  If the install didn't result in the lvm package being 
installed, manually add it with rpm.

2. After the install is complete, create a RAID partition (/dev/md0).  Don't put a filesystem on it.

3. Use pvcreate and vgcreate to create a new volume group, with /dev/md0 as the physical volume.  (NOTE: This should be the only volume group 
and the only physical volume in the system.)

4. Create a logical volume in that volume group, create a filesystem on that logical volume, add an entry for that fileystem into /etc/fstab.

5.  Manually mount the filesystem to verify that it works.  

6.  Reboot.

Actual Results:  At startup, the system failed to mount the filesystem created in step 4.  Research indicated that the problem was that vgscan and 
vgchange had never been run.  

Expected Results:  rc.sysinit should have ran vgscan and "vgchange -a y" and mounted the filesystem in question.

Additional info:

Manually runing vgscan and "vgchange -a y" followed by "mount (mountpoint)" will get the filesystem mounted.  Removing the check forthe 
existance 
of  "/proc/lvm" from the rc.sysinit scripts will also eliminate the problem and allow the filesystem to be mounted at startup.

NOTE: rc.sysinit attempts to run vgscan twice, once before RAID initialization, and once after RAID initialization.  Both of them have checks for the 
existance of /proc/lvm.  I'm not sure if my problem is unqiue to RAID -- perhaps if there is a native LVM partition, the LVM partition type causes the 
lvm module to be loaded prior to vgscan being executed, I haven't tested that case.  But in my case, there is only one physical volume, and it's a 
RAID disk (/dev/md0), so there are no partitions with the LVM type.  And in my case, the lvm module (lvm-mod) doesn't get loaded until vgscan is 
run.  Since lvm-mod creates /proc/lvm, the startup script's requirement that /proc/lvm exist as a prerequisite for running "vgscan" creates a 
chicken-and-egg problem.

Comment 1 James B. Byrne 2002-05-27 22:32:07 UTC
I am having a similar problem with a single ide disk, redhat 7.3 installation 
(kernel 2.4.18-4 upgrade applied) using one PV.  sysinit.rc does not call 
vgscan.  Further, running "vgchange -a y" gives syntax error.  
Running "vgchange -ay" produces desired result.  I am not sure if this is a bug 
or a documentation error.

Comment 2 James B. Byrne 2002-05-30 16:37:31 UTC
The basic problem is described in bug 57563, the default ramdisk images
are not built with the lvm-mod loaded.  This means that /proc/lvm does not
exist when the rc.sysinit script runs and the lvm conditional tests fail in
consequence.  The choices are to create a new ramdisk image using mkinitrd and 
applying the option --preload=lvm-mod; or modify rc.sysinit to just run 
vgchange -ay without a conditional test, this will load the lvm module; or 
modify the conditional code in rc.sysinit to remove references to /proc/lvm.  
This seems to make the most sense since /proc/lvm shouldn't exist until after 
the lvm-mod is loaded.  It seems pointless to test for a condition that can't 
be met until the dependent action occurs.

refer to 57563 for further information.

Comment 3 Bill Nottingham 2005-09-29 19:57:56 UTC
Closing bugs on older, no longer supported, releases. Apologies for any lack of
response.

If this persists on a current release, such as Fedora Core 4, please open a new bug.