Red Hat Bugzilla – Bug 77539
lvm initialization fails at /etc/rc.d/rc.sysinit line 310.
Last modified: 2007-04-18 12:48:14 EDT
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):
Steps to Reproduce:
1.create an logical volume
2.add it to /etc/fstab
Actual Results: system went into a maintenance shell
Expected Results: system should have booted happily
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.
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.
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").
*** Bug 79018 has been marked as a duplicate of this bug. ***
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
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