Bug 57563 - rc.sysinit fails to activate LVM
Summary: rc.sysinit fails to activate LVM
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
: 65280 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2001-12-15 21:33 UTC by Frode Tennebø
Modified: 2014-03-17 02:24 UTC (History)
6 users (show)

Clone Of:
Last Closed: 2002-07-22 01:15:03 UTC

Attachments (Terms of Use)
patch to load lvm-mod before initilising volume groups. (842 bytes, patch)
2002-07-22 01:14 UTC, Matthew Melvin
no flags Details | Diff

Description Frode Tennebø 2001-12-15 21:33:48 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.79 [en] (X11; U; Linux 2.4.9-13custom i686)

Description of problem:
I have set up LVM which works nicely manually. When I reboot it appears
that lvm is not present in /proc which results in vgscan and vgchange not
being run due to:

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

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

How reproducible:

Steps to Reproduce:
1. Set up LVM
2. Add to /etc/fstab
3. reboot

Additional info:

I'm not entirely sure that above steps are enough to reproduce the problem
since I actually haven't rebooted earlier after setting up LVM. What
initated this reboot was my 1 year old daughter hitting the power-off
button which resulted in the ext3-filesystem being marked as dirty and
hence I initated an integrity check on them. This might have had something
to do with it....

Comment 1 Frode Tennebø 2002-01-18 23:01:23 UTC
I trust the holiday was good. What gives? :)

Comment 2 Bill Nottingham 2002-02-07 03:35:32 UTC
Is this reproducible? Do you never have LVM in /proc?

Do you have it compiled as a module, and is it loaded in your initrd?

Comment 3 Frode Tennebø 2002-02-09 22:30:03 UTC
Never is a strong word, but yes, I have been able to reproduce this every time
so far.

LVM is compiled as a module, but is not my root partition.

I'm using the RedHat 2.4.9-13 kernel (including initrd setup) but patched with
LVM 1.0.1-rc4.

Comment 4 Bill Nottingham 2002-02-10 02:04:55 UTC
OK, what happens if you make your initrd with '--with=lvm-mod'?

Comment 5 Frode Tennebø 2002-02-26 19:02:33 UTC
Thank you. This indeed works. However,
1) I was under the impression that /lib/modules/* are used as soon as / is 
mounted rw? And

2) It is not included in 2.4.9-13 kernel while /etc/rc.d/rc.sysinit suggest 
the functionality works.

Comment 6 Jason Tibbitts 2002-04-22 14:27:55 UTC
I'm having essentially the same problem with Skipjack-beta2 (initscripts
6.61-1). However, only my large data partitions are on LVM; my system partitions
are accessible without LVM loaded so there should be no need to put LVM in the
initrd.  If I edit rc.sysinit and add a modprobe lvm-mod in the appropriate
place, things work.  If I instead remove the existence check for /proc/lvm,
things also work.  The presense of /etc/lvmtab, /sbin/vgchange and /sbin/vgscan
should be enough to try activating the volume groups; with module autoloading,
there is no reason to believe that /proc/lvm would exist before this.

Since LVM is now in the kernel and the LVM tools are now included in the
distribution, this should be enough to bump the severity to high (because my
machines won't boot without modifications).

Comment 7 Lindsay Todd 2002-05-09 19:06:27 UTC
I am also seeing this problem, with RedHat 7.3.  I put /home on a logical
partition, and now my system will not boot!

My solution:

    rm -f /boot/initrd-2.4.18-3.img
    mkinitrd --preload lvm-mod /boot/initrd-2.4.18-3.img 2.4.18-3

The preload is essential.

I concur with tibbs@math.uh.edu that this is a severe problem that should be fixed.

Of course, I'd also like to see anaconda support LVM, so I could install and
safely upgrade my system with all my file systems (perhaps sans /boot) and swap
spaces as logical partitions...

Comment 8 Falko Sonne 2002-05-16 12:22:33 UTC
I've got the same problem with RH7.3. /proc/lvm doesn't exist when rc.sysinit 
reaches the LVM initialisation section. When the fstab entries with some lvm's 
are being processed, lvm-mod is loaded into memory and /proc/lvm is created but 
now it's too late.

The solution from toddr@rpi.edu works fine for me too:
   mkinitrd --preload lvm-mod /boot/initrd-2.4.18-3.img 2.4.18-3

Thank you!

Comment 9 Miguel Armas 2002-05-21 10:48:31 UTC
Same problem here, also fixed with an initrd image to load lvm-mod...

Since lvm is compiled as a module, and /proc/lvm doesn't exist until you load
lvm-mod, it doesn't make sense to check for /proc/lvm before initializing LVM.

If rc.sysinit just runs "vgchange -ay", lvm-mod gets loaded automatically and
everything works. No need to create a initrd image...

Comment 10 Eric Hopper 2002-05-30 13:21:25 UTC
This bug is strongly related to Bug# 55460

Comment 11 Bill Nottingham 2002-06-12 07:09:44 UTC
If you do mkinitrd *without* the --preload, does it put LVM in the initrd?

Comment 12 Bill Nottingham 2002-06-12 07:09:55 UTC
*** Bug 65280 has been marked as a duplicate of this bug. ***

Comment 13 Matthew Melvin 2002-07-22 01:14:34 UTC
Created attachment 66204 [details]
patch to load lvm-mod before initilising volume groups.

Comment 14 Matthew Melvin 2002-07-22 01:14:58 UTC
Okay.. so I was bitten by this too. Why can't lvm be like md?  We don't need the
md module in our initrd unless we're using md for our / filesystem.  The same
should hold true for the lvm module. md has a check like...

if [ -f /etc/raidtab ]; then
        # Add raid devices
        [ -f /proc/mdstat ] || modprobe md >/dev/null 2>&1

... before it checks for /proc/mdstat and sets up the raid devices.  Why can't
lvm do something similar like...

if [ -f /etc/lvmtab ]; then
        # Add lvm devices
        [ -f /proc/lvm ] || modprobe lmv-mod >/dev/null 2>&1

... with the rest remaining unchanged.  Patch attached.

Comment 15 Bill Nottingham 2002-10-18 20:09:25 UTC
Something like this is in current CVS.

Comment 16 Need Real Name 2002-11-07 14:01:34 UTC
The correct work is that you create a new initscript rpm !
Why you close problem without modify initscript? (on rh7.2 errata nothing is
change and in last release rh8.0 the package rpm is not patched)

Note You need to log in before you can comment on or make changes to this bug.