Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 147015 - genkernel initrd doesn't properly set up lvm2
Summary: genkernel initrd doesn't properly set up lvm2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2006-09-09 18:37 UTC by Eric Holk
Modified: 2006-09-18 05:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Holk 2006-09-09 18:37:01 UTC
I compiled a kernel by hand and then used genkernel to make an initrd because my root is on LVM.  The command I used was

genkernel -lvm2 initrd

When I boot my system, it says /dev/vg/root is not a valid device and lets me drop into a shell to try and fix things.  Before this it said that it started 0 Logical Volumes in my volume group.  From the shell I try to see my logical volumes by doing:

lvm lvscan

It shows my 5 logical volumes, but said it can't open /dev/mapper/control.  It turns out the device file is actually at /dev/device-mapper, so I made a symlink from there to /dev/mapper/control and then I was able to activate my logical volumes and boot.  Could the initrc script that genkernel produces be modified to make this symlink automatically?  Also, upon booting the symlinks to /dev/vg/* had disappeared, so I modified my fstab to point to /dev/mapper/vg-* instead.  It'd be nice if the symlinks were in place though.
Comment 1 Nicolai Guido Klausen 2006-09-12 04:13:34 UTC
I get the same problem on x86
Comment 2 Chris Gianelloni (RETIRED) gentoo-dev 2006-09-14 05:31:37 UTC
Can you test this patch?  It edit /usr/share/genkernel/generic/initrd.scripts and should resolve the issue for you.  You'll need to rebuild your initrd once you've made this change.

Index: initrd.scripts
===================================================================
RCS file: /var/cvsroot/gentoo/src/genkernel_bradmssw/generic/initrd.scripts,v
retrieving revision 1.58
diff -u -b -B -r1.58 initrd.scripts
--- initrd.scripts      12 Sep 2006 21:09:01 -0000      1.58
+++ initrd.scripts      14 Sep 2006 12:30:10 -0000
@@ -488,6 +488,14 @@
 startVolumes() {
        #good_msg 'Checking if volumes need to be started...'
 
+       # Here, we check for /dev/device-mapper, and if it exists, we setup a
+       # a symlink, which should hopefully fix bug #142775 and bug #147015
+       if [ -e /dev/device-mapper ]
+       then
+               mkdir -p /dev/mapper
+               ln -sf /dev/device-mapper /dev/mapper/control
+       fi
+
        if [ "${USE_DMRAID_NORMAL}" -eq '1' ]
        then
                if [ -e '/sbin/dmraid' ]
Comment 3 Chris Gianelloni (RETIRED) gentoo-dev 2006-09-14 05:37:13 UTC
I just realized that I probably should have attached the patch instead.

It is attached at http://bugs.gentoo.org/attachment.cgi?id=96961 for another bug.  I am hoping I can kill two birds with one patch... ;]
Comment 4 Chris Gianelloni (RETIRED) gentoo-dev 2006-09-14 11:27:49 UTC
OK.  I've gone ahead and added the patch to CVS.  This should fix the bug.  If you find that it does not, please let us know.
Comment 5 Eric Holk 2006-09-14 21:54:53 UTC
I just applied the patch, rebuilt initrd, and rebooted, and everything worked like a charm!  Thanks a lot for the quick response!
Comment 6 Tim Yamin (RETIRED) gentoo-dev 2006-09-16 03:59:06 UTC
Fixed in 3.4.1, thanks!
Comment 7 Joël 2006-09-18 05:12:16 UTC
Now works for me too.

Well done, thanks !