Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 292833 - sys-kernel/genkernel: udev-146-r1, lvm2-2.02.51-r1, renders lvm2 machine unbootable
Summary: sys-kernel/genkernel: udev-146-r1, lvm2-2.02.51-r1, renders lvm2 machine unb...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal with 1 vote (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
: 293123 295945 307979 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-11-11 19:44 UTC by Christopher Byrne
Modified: 2012-03-27 03:21 UTC (History)
22 users (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 Christopher Byrne 2009-11-11 19:44:00 UTC
After updating udev and lvm2, by machine would no longer boot. depending on the version of genkernel used, either the initramfs wouldn't find the lvm2 volumes at all, or it would, but then the boot process would fail later on seeing if the volumes needed to be fsck'd when the node didn't exist in /dev, trying to activate the lvm2 volumes manually at that point procedure "Locking type -1 initialization failed". Adding --ignorelocking made it active it, but the nodes still didn't appear in dev, even after a udev --trigger. Nor could the boot process continue on, as even I remount the root volume read/write, it would just reboot thinking there was an error because fsck failed, as the nodes didn't exist 

In the meantime, as a workaround, I've added the new udev/lvm2 packages to package.mask so I can start my machine. 

emerge --info:

Portage 2.1.6.13 (default/linux/x86/10.0/desktop, gcc-4.3.4, glibc-2.9_p20081201-r2, 2.6.30-gentoo-r8 i686)
=================================================================
System uname: Linux-2.6.30-gentoo-r8-i686-Intel-R-_Celeron-R-_CPU_2.66GHz-with-gentoo-1.12.13
Timestamp of tree: Wed, 11 Nov 2009 05:30:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p28
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.6.2-r1
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -g"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=pentium4 -O2 -pipe -g"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildpkg ccache distlocks fixpackages metadata-transfer parallel-fetch protect-owned sandbox sfperms splitdebug strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="C"
LDFLAGS="-Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac accessibility acl acpi alsa avahi berkdb bluetooth branding bzip2 cairo caps cddb cdr cli consolekit cracklib crypt cups dbus dri dts dv dvd dvdr dvdread eds emboss encode evo fam ffmpeg flac fortran gdbm gif gnome gnome-keyring gnutls gpm gstreamer gtk hal iconv ipod ipv6 java jpeg ldap libnotify logrotate mad mikmod mmx mmxext modules mono mp3 mp4 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp pam pcre pdf perl png ppds pppd pulseaudio python qt3support quicktime readline reflection samba sasl sdl session spell spl sse ssl startup-notification svg sysfs tcl tcpd thunar tiff tk truetype unicode usb v4l2 vorbis x264 x86 xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse void" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="dummy fbdev vesa nv nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Rafał Mużyło 2009-11-11 19:46:37 UTC
The proper solution (as noted on the forums)
was to update your initramfs.
Comment 2 Christopher Byrne 2009-11-11 20:00:26 UTC
I already did that (using genkernel --no-clean --lvm initramfs). I even cleared out the cached files in /var/cache/genkernel and did it again. Even reinstalling or using the latest version of genkernel doesn't fix it. It still won't start. 
Comment 3 Christopher Byrne 2009-11-11 22:18:44 UTC
At least part of the problem is in genkernel. Like many of the people having problem with booting, the static lvm binary was renamed. The current stable version of genkernel copies the wrong one: append_lvm in gen_initramfs.sh copies /sbin/lvm rather than /sbin/lvm.static. That's why the stable version doesn't work at all if the initramfs is rebuilt (can't even get past the initramfs), where as unstable version suceeds in mounting the root.

However, the device nodes for the volume group are still not being created (but it does get activated with the current unstable genkernel, hence the locking error), which causes the boot procses to fail later whe nit tries to see if needs a fsck. This part probably has something to do with udev rather than genkernel, though.
Comment 4 Rafał Mużyło 2009-11-11 22:21:40 UTC
There is a certain thing that could make this a valid bug:
perhaps recent lvm2 wasn't tested against baselayout-1 setups.

Post more characteristics of your lvm2 setup.
Comment 5 Christopher Byrne 2009-11-11 22:33:09 UTC
It's a very simple setup. One disk, 2 paritions. One (sda1) is boot partition, the other (sda2) is the LVM2 PV. There only 1 volume group, called "Gentoo", and it has 2 LV's: one named "swap" (1 G), and one named "root" (110 G).
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-11-11 22:44:00 UTC
Please test with the ~arch genkernel.
Comment 7 Christopher Byrne 2009-11-11 23:00:47 UTC
Already done. The ~arch genkernel does produce an initramfs that sucesfully mount the root partition and starts the init process. But then fails on the fsck, becasue the node is missing.

Actually, the /dev/mapper/Gentoo-root and /dev/mapper/Gentoo-swap ARE there, but the "convenience symlinks" (/dev/Gentoo/root and /dev/Gentoo/swap) are missing, which what is referenced in grab and fstab files. If I change it the the /dev/mapper names, combined with the new genkernel, the system now boots.

However udev always create the convenience links before, so this part seems to be a regression.

Comment 8 Tom Hendrikx 2009-11-12 20:14:35 UTC
I can confirm that this works with a kernel without deprecated sysfs:

tomhendr@julie ~ $ zgrep SYSFS /proc/config.gz 
# CONFIG_SYSFS_DEPRECATED_V2 is not set
CONFIG_ACPI_SYSFS_POWER=y
CONFIG_WIRELESS_EXT_SYSFS=y
CONFIG_SYSFS=y

tomhendr@julie ~ $ genkernel --version
3.4.10.906

tomhendr@julie ~ $ uname -a
Linux julie 2.6.27-openvz-briullov.1-r3 #1 SMP Thu Nov 12 20:55:35 CET 2009 i686 Intel(R) Atom(TM) CPU N270 @ 1.60GHz GenuineIntel GNU/Linux

+1 for stabilisation: since udev-146-r1 warns explicitly about SYS_DEPRECATED during emerge, lots of people are bound to run into this.
Comment 9 Kolbjørn Fredheim 2009-11-12 20:55:36 UTC
Same issue on my trusty server here, except I'm using a custom initramfs, lvm2 root, no deprecated v2 set in kernel.

My initscript mounts proc sysfs and dev, enables lvm, mounts the root drive in /sysroot then switch_root over to the root drive.
The problems come when there are no dev nodes for my lvm system from udev, I have to use a vgmknodes call to get the /dev/mapper links up and running, but that don't still make the /dev/volumegroupname/<stuff> symlinks appear.
So I had to modify /etc/fstab to use the /dev/mapper nodes instead.

Workaround into /etc/init.d/udev:

ebegin "Hacked in here: Make lvm2 work"
vgmknodes --ignorelockingfailure
eend $?
Comment 10 Vladimir Berezhnoy 2009-11-13 20:43:28 UTC
I'm having similar issue with lvm groups not being detected by initramfs, but my vg is located on top of /dev/md1 (mdraid raid1). When I enter genkernel rescue shell vgscan command just doesn't find the volume group while the /dev/md1 device is there.
I'm using ~x86 genkernel and other stuff and don't have CONFIG_SYSFS_DEPRECATED_V2 not set
Comment 11 Vladimir Berezhnoy 2009-11-13 22:12:58 UTC
In my case the problem got resolved by enabling CONFIG_SYSFS_DEPRECATED_V2 in kernel. Although udev complains about it the system works just fine and lvm detection works as expected.
Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-11-14 00:21:50 UTC
Ok, i'll have do the device-mapper+lvm2 merge inside Genkernel, that should solve it. Hopefully done by the end of the weekend.
Comment 13 Ivan Mironov 2009-11-29 08:59:02 UTC
See also bug #255196 and bug #225249.

Problem due to which the initramfs does not see the volume groups can be solved in two ways:
* Build sys-fs/lvm2 with "static" USE-flag enabled and update sys-kernel/genkernel to >=3.4.10.905.
* Update genkernel's internal versions of device-mapper and lvm in /etc/genkernel.conf.
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-11-30 00:59:31 UTC
This is purely a genkernel issue. I just need to update genkernel to use a newer LVM2.
Comment 15 Rafał Mużyło 2009-12-06 14:23:06 UTC
*** Bug 295945 has been marked as a duplicate of this bug. ***
Comment 16 Joël 2009-12-07 00:00:03 UTC
Robin, do you know whether genkernel itself needs to be modified ? As soon as I put LVM_VER="2.02.29" (instead of 2.02.28) in /etc/genkernel.conf I get a compilation error.

Also, setting LVM="yes" in /etc/genkernel.conf does not seem to use my system's lvm2 ?
Comment 17 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-12-07 03:04:58 UTC
Yes, I need to revamp a large chunk of genkernel for the new non-split LVM2.
Comment 18 Timothy Stotts 2009-12-08 04:04:48 UTC
Same issue here.
Comment 19 Heiko Baumann 2009-12-09 15:43:42 UTC
same issue here. :( would be really great if such a pain would not get in to stable arch

however i managed to get my system booting with the ~arch genkernel + new lvm2 + fstab changes (/dev/mappper/....). thanks for sharing this workaround...
Comment 20 Richard Scott 2009-12-09 15:50:17 UTC
(In reply to comment #19)
> same issue here. :( would be really great if such a pain would not get in to
> stable arch

That's a nice idea, perhaps we need three classes in Portage:

beta (same as ~x86 or ~amd64 etc)
testing (same as current stable i.e. x86 or amd64)
stable (a new group of really really stable "testing" packages).

That way, anything that goes into the stable group is guaranteed not to mess up your system.

Rich.
Comment 21 Joël 2009-12-09 15:50:59 UTC
Heiko, do you mean that it works for you, after setting LVM="yes" in /etc/genkernel.conf and emerging a recent lvm2 package with the "static" USE-flag ? This did not work for me so far...

Could you please elaborate on which versions are required for a successful boot ? Especially the lvm2 and genkernel versions, and what did you change in /etc/genkernel.conf ? Thanks in advance.
Comment 22 Matthew Lange 2009-12-09 17:16:27 UTC
This works for me:
KEYWORDS=~x86 emerge =sys-kernel/genkernel-3.4.10.906
genkernel --lvm ramdisk
Comment 23 Olu 2009-12-09 18:52:55 UTC
Noticed the problem this morning. however it is resolved (i use x64)

unmask the lastest genkernel-3.4.10.906
install
etc-update

edit /etc/genkernel
LVM="yes"

cd /usr/src/linux
# CONFIG_SYSFS_DEPRECATED_V2 is not set
# CONFIG_ACPI_SYSFS_POWER is not set
CONFIG_WIRELESS_EXT_SYSFS=y
CONFIG_SYSFS=y

Made the LVM needed modules built in
CONFIG_BLK_DEV_DM=y
CONFIG_DM_DEBUG=y
CONFIG_DM_CRYPT=y
CONFIG_DM_SNAPSHOT=y
CONFIG_DM_MIRROR=y
# CONFIG_DM_LOG_USERSPACE is not set
CONFIG_DM_ZERO=y
CONFIG_DM_MULTIPATH=y
# CONFIG_DM_MULTIPATH_QL is not set
# CONFIG_DM_MULTIPATH_ST is not set
CONFIG_DM_DELAY=m
CONFIG_DM_UEVENT=y


Compiled kernel
genkernel --no-clean --no-mrproper --symlink --config=/usr/src/linux/.config --lvm  --loglevel=2 all


If you are getting fsck error at boot, edit /ets/fstab
Intial was
/dev/vg/root	/	ext3		noatime	0 1          ---> vg is volume group, path is symlinked

final
/dev/mapper/vg-root	/	ext3	   noatime	  0 1       ---> full path

I will check back if anyone has any problems with this.
cheer guys


Comment 24 Olu 2009-12-09 19:09:55 UTC
(In reply to comment #23)
> Noticed the problem this morning. however it is resolved (i use x64)
> 
> unmask the lastest genkernel-3.4.10.906
> install
> etc-update
> 
> edit /etc/genkernel
> LVM="yes"
> 
> cd /usr/src/linux
> # CONFIG_SYSFS_DEPRECATED_V2 is not set
> # CONFIG_ACPI_SYSFS_POWER is not set
> CONFIG_WIRELESS_EXT_SYSFS=y
> CONFIG_SYSFS=y
> 
> Made the LVM needed modules built in
> CONFIG_BLK_DEV_DM=y
> CONFIG_DM_DEBUG=y
> CONFIG_DM_CRYPT=y
> CONFIG_DM_SNAPSHOT=y
> CONFIG_DM_MIRROR=y
> # CONFIG_DM_LOG_USERSPACE is not set
> CONFIG_DM_ZERO=y
> CONFIG_DM_MULTIPATH=y
> # CONFIG_DM_MULTIPATH_QL is not set
> # CONFIG_DM_MULTIPATH_ST is not set
> CONFIG_DM_DELAY=m
> CONFIG_DM_UEVENT=y
> 
> 
> Compiled kernel
> genkernel --no-clean --no-mrproper --symlink --config=/usr/src/linux/.config
> --lvm  --loglevel=2 all
> 
> 
> If you are getting fsck error at boot, edit /ets/fstab
> Intial was
> /dev/vg/root    /       ext3            noatime 0 1          ---> vg is volume
> group, path is symlinked
> 
> final
> /dev/mapper/vg-root     /       ext3       noatime        0 1       ---> full
> path
> 
> I will check back if anyone has any problems with this.
> cheer guys
> 

i also had to remount / as rw
mount -o remount rw /
Comment 25 Robert Trace 2009-12-09 21:08:27 UTC
Boot failures _after_ the initramfs (when checkroot/fsck complains the lvm root device being missing) are caused by a locking bug in lvm 2.0.51.  It's fixed in 2.0.52.  See bug #296198 comment 5 for an analysis and comment 6 for a patch that'll fix the issue.
Comment 26 Ed Santiago 2009-12-10 02:07:57 UTC
Thanks to everyone who suggested emerging a newer gentoolkit (and, in bug 296198, lvm2). I just emerge --updated world this morning, had a shutdown due to a long power outage, then spent 2+ hours trying to get my system back up.  These threads helped.  Thank you.
Comment 27 Flavio 2009-12-10 10:55:42 UTC
Hi! 
I had a lot of trouble today after a udev and lvm2 upgrade. I upgraded from 141 to 146-r1 version of udev an I wasn't able to boot correctly anymore.
I have RAID 0 and 1 on my system and /dev/md* devices are not recognized and udev always fail to start. I was able to boot, but not using the raid. I booted using only one of the disk instead.
Many services failed to start too.

After many attempts, I solved the problem downgrading udev to version 141 and masking the 146-r1 version, since it's broken in my opinion. All now is back to the normality with version 141.

Best regards, 

Flavio
Comment 28 Olu 2009-12-11 12:03:01 UTC
(In reply to comment #27)
> Hi! 
> I had a lot of trouble today after a udev and lvm2 upgrade. I upgraded from 141
> to 146-r1 version of udev an I wasn't able to boot correctly anymore.
> I have RAID 0 and 1 on my system and /dev/md* devices are not recognized and
> udev always fail to start. I was able to boot, but not using the raid. I booted
> using only one of the disk instead.
> Many services failed to start too.
> 
> After many attempts, I solved the problem downgrading udev to version 141 and
> masking the 146-r1 version, since it's broken in my opinion. All now is back to
> the normality with version 141.
> 
> Best regards, 
> 
> Flavio
> 

umask and install the lastest genkernel. 
Comment 29 Samuli Suominen (RETIRED) gentoo-dev 2009-12-11 14:58:04 UTC
*** Bug 293123 has been marked as a duplicate of this bug. ***
Comment 30 Flavio 2009-12-11 16:43:18 UTC
(In reply to comment #28)
> umask and install the lastest genkernel. 
I don't use genkernel at all!
Comment 31 Jean-Philippe Robichaud 2009-12-11 20:06:44 UTC
Hum, I'm hit this this issue as well (I had a bad feeling about this 'stable' upgrade...)

Now I have emerged lvm2.02.56-r1 and rebuilt udev (and hal)

I've recreated my initrd 'disk' (using a script really analogue to the one attached, and it used to work in the past)

I still can't boot.  I tried /dev/mapper/vg0-root or /dev/vg0/root as my root partition and it fails.  

I read the comment about genkernel so I tried that route.  It 'crashes' after the 'mdev' step where it says that it "can't find root partition in ."  I've entered /dev/mapper/vg0-root manually ant it booted.

I guess I'm missing some parameter on the grub kernel line. Any clue?
Comment 32 Jean-Philippe Robichaud 2009-12-11 20:25:17 UTC
Ok, I've search a little bit and it's now working:

kernel line from grub:
kernel /kernel-genkernel-x86_64-2.6.31-gentoo-r5-take6 root=/dev/ram0 real_root=/dev/mapper/vg0-root dolvm2 dodmraid

my genkernel command line:
genkernel --no-clean --no-mrproper --config=/usr/src/linux/.config --lvm2 --mdadm --loglevel=2 all


Thanks for the info!
Comment 33 Steven Elling 2009-12-14 05:06:13 UTC
I had to remove device-mapper due to it blocking lvm2-2.02.51-r1 and then update lvm2 but my system was unable to boot due to not finding the root device, which is on lvm, too.  udev was not updated during my system update.

I went back to the previous installed version of lvm2 (lvm2-2.02.36) and device-mapper (device-mapper-1.02.24-r1) as I use my laptop for work and cannot have it down.

I'm masking lvm2-2.02.51-r1 until a suitable solution is found.
Comment 34 Richard Scott 2009-12-14 10:52:12 UTC
(In reply to comment #33)
> I'm masking lvm2-2.02.51-r1 until a suitable solution is found.

See comment #22, or wait for that version of genkernel to become available. 

Comment 35 Trenton D. Adams 2009-12-16 01:40:04 UTC
(In reply to comment #23)
> If you are getting fsck error at boot, edit /ets/fstab
> Intial was
> /dev/vg/root    /       ext3            noatime 0 1          ---> vg is volume
> group, path is symlinked
> 
> final
> /dev/mapper/vg-root     /       ext3       noatime        0 1       ---> full
> path
> 
> I will check back if anyone has any problems with this.
> cheer guys
> 

I only have one problem with this: it's not the proper solution.  It is the only thing that works.  Thanks.

This appears to be a boot order problem of some sort.  Once my system boots, with the above solution, then the /dev/vg/* is available.
Comment 36 Robert Trace 2009-12-16 02:47:57 UTC
(In reply to comment #35)

> This appears to be a boot order problem of some sort.  Once my system boots,
> with the above solution, then the /dev/vg/* is available.

It's a bug in lvm 2.02.51.  See bug 296198 comment 6.  The solution is to unmask 2.02.56-r1.
Comment 37 Olu 2009-12-17 00:02:21 UTC
(In reply to comment #35)
> (In reply to comment #23)
> > If you are getting fsck error at boot, edit /ets/fstab
> > Intial was
> > /dev/vg/root    /       ext3            noatime 0 1          ---> vg is volume
> > group, path is symlinked
> > 
> > final
> > /dev/mapper/vg-root     /       ext3       noatime        0 1       ---> full
> > path
> > 
> > I will check back if anyone has any problems with this.
> > cheer guys
> > 
> 
> I only have one problem with this: it's not the proper solution.  It is the
> only thing that works.  Thanks.
> 
> This appears to be a boot order problem of some sort.  Once my system boots,
> with the above solution, then the /dev/vg/* is available.
> 

As long as you can boot, Its all good. I also did notice it when i first encountered the problem, but left the new changes in fstab as is.
Comment 38 Joël 2009-12-18 21:35:32 UTC
I had the problem where 2.6.32 was unbootable, due to no VG being found.

Upgrading to genkernel 3.4.10-906 and lvm2-2.02.56-r1 solved it for me. I have the simple laptop setup with 2 partitions (boot & lvm2) and the root fs on a LV inside the 2nd partition.
Comment 39 Sebastian Koehler 2009-12-29 09:26:54 UTC
lvm2-2.02.56-r1 solved the issue for me on ppc, too.
Comment 40 Chris 2010-02-19 02:39:51 UTC
genkernel 3.4.10-906 and lvm2-2.02.56-r1 did NOT solve this issue for me.  Every time I boot, it does not create the nodes in /dev.  The vgscan says: "Reading all physical volumes.  This make take a while..." but never finds any volumes.  Using lmv2-2.02-56-r2 (which is now stable) didn't help either.

I'm on an amd64 system, using md-raid with lvm on top of it.  Used to work...

made  with
genkernel --mdadm --lvm2 initramfs
(custom-compiled kernel)

tried following options in grub:
udev dolvm root=/dev/ram0 root=/dev/vg/slash lvmraid=/dev/md3 real_root=/dev/vg/slash
in all different permutations.  Nothing works
Comment 41 Ivan Mironov 2010-02-19 05:05:12 UTC
(In reply to comment #40)
> genkernel 3.4.10-906 and lvm2-2.02.56-r1 did NOT solve this issue for me. 
> Every time I boot, it does not create the nodes in /dev.  The vgscan says:
> "Reading all physical volumes.  This make take a while..." but never finds any
> volumes.  Using lmv2-2.02-56-r2 (which is now stable) didn't help either.
> 
> I'm on an amd64 system, using md-raid with lvm on top of it.  Used to work...
> 
> made  with
> genkernel --mdadm --lvm2 initramfs
> (custom-compiled kernel)

The system in initramfs, generated by genkernel, can automatically find and activate software RAID arrays. So option --mdadm (which copies /etc/mdadm.conf into the initramfs image) is not needed.

> tried following options in grub:
> udev dolvm root=/dev/ram0 root=/dev/vg/slash lvmraid=/dev/md3
> real_root=/dev/vg/slash
> in all different permutations.  Nothing works
> 

Try something like this (after rebuilding initramfs without --mdadm option):
    domdadm dolvm real_root=/dev/vg/slash
Comment 42 Chris 2010-02-19 14:04:28 UTC
> So option --mdadm (which copies /etc/mdadm.conf
> into the initramfs image) is not needed.
>  
> Try something like this (after rebuilding initramfs without --mdadm option):
>     domdadm dolvm real_root=/dev/vg/slash
> 

That boots!  I still get "Starting up RAID devices [ !! ] at boot.  Not sure why because everything seems to work fine.  Something I can do to address that?

Thanks for the help.
Comment 43 memphis 2010-03-11 16:01:43 UTC
I have same issue with kernel 2.6.33. I have lvm2 over raid1, but by boot vgscan  never finds any volumes.

I have
lvm2-2.02.56-r1 ( i tried  lvm2-2.02.56-r3 too )
genkernel-3.4.10.906 ( genkernel-3.4.10.907 too ) 


title Gentoo 2.6.33 -  LVM
root (hd0,0)
kernel /kernel-2.6.33 root=/dev/ram0 real_root=/dev/mapper/system-root dolvm do
dmraid
initrd /initramfs-genkernel-x86_64-2.6.33-gentoo


genkernel --lvm --dmraid ramdisk
Comment 44 Chris 2010-03-11 16:17:55 UTC
Try getting rid of the dmraid options in your grub and your genkernel, my understanding is that isn't really for linux software raid, that is for fake (bios) raid.

Comment 45 Markos Chandras (RETIRED) gentoo-dev 2010-03-14 11:05:45 UTC
*** Bug 307979 has been marked as a duplicate of this bug. ***
Comment 46 Vladimir Berezhnoy 2010-03-14 14:25:38 UTC
This critical bug has been reported 4 months ago and still remains unfixed. The only solution is a workaround with USE=static for lvm2. Is there a way to at least add this workaround to the portage so that the users don't get their systems broken all of a sudden.

Thanks
Comment 47 Paul Berens 2010-06-21 17:50:11 UTC
(In reply to comment #46)
> This critical bug has been reported 4 months ago and still remains unfixed. The
> only solution is a workaround with USE=static for lvm2. Is there a way to at
> least add this workaround to the portage so that the users don't get their
> systems broken all of a sudden.
> 
> Thanks
> 

So if i set the static userflag on my lvm2 it won't alter anything else and I can proceed to upgrade?
Comment 48 Steven Elling 2010-09-07 16:10:26 UTC
This problem is back with lvm2-2.02.73 (static use flag is set) and genkernel-3.4.10.906.

A newly built initramfs doesn't help.
Comment 49 Steven Elling 2010-09-07 16:15:47 UTC
Follow up to comment #48:

And, my system is configured to use the symlinks directly in /dev instead of those in /dev/mapper.
Comment 50 Robert Wolf 2010-09-20 20:17:24 UTC
genkernel-3.4.10.907 (with busybox-1.7.4, device-mapper-1.02.22, lvm2-2.02.28), using vanilla-sources, /boot is /dev/sda1, rootfs is LV on /dev/sda2.

genkernel generated kernel and initramfs for kernel 2.6.31.6 activate VG and creates links /dev/vg/lv for all LVs.

starting kernel 2.6.34 dies without any PV. on the debug shell of initramfs using lvm pvscan with -v -v -v I can see messages, then lvm scanning block devices, trying /dev/sda2 with "skipping (sysfs)".

This bug looks like bug from debian bugreport http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=488332, but the debian bug is from 2008 with kernel 2.6.25. But it is probably similar problem, again with incompatibility between kernel's sysfs and old LVM version.

Any ideas? I wanted to configure newer version of lvm2 in genkernel config and to try make new initramfs. Is it solution? Then someone can update genkernel's config to newer version of lvm2. Or do I need newer version of busybox and/or device-mapper?

Thank you for help
Comment 51 Richard Scott 2010-09-21 07:39:57 UTC
(In reply to comment #50)

Have you disabled CONFIG_SYSFS_DEPRECATED_V2 in your kernel?
Comment 52 Robert Wolf 2010-09-26 11:20:44 UTC
(In reply to comment #51)
> (In reply to comment #50)
> 
> Have you disabled CONFIG_SYSFS_DEPRECATED_V2 in your kernel?
> 

*** Yes, CONFIG_SYSFS_DEPRECATED_V2 was disabled. I have enabled and now LVM can find PV. Interesting is, that for kernel 2.6.31.6 is other title in menuconfig for CONFIG_SYSFS_DEPRECATED_V2 - "remove sysfs features which may confuse old userspace tools". Since 2.6.32 (2.6.32.9 on my host) there is description "enable deprecated sysfs features which may confuse old userspace tools".

But still, there is something wrong. I compile kernel on one host with minimal gentoo in chroot and then copy it to other gentoo systems (company and home).

On company PC I can boot kernel 2.6.34 (with root on /dev/sda2) without any problem, but at home, initrd can now find PV, mount root fs and starts init, but udev does not create /dev/sda* nodes (/dev/sda1 is /boot), neither creates /dev/VG/LV symlinks and /dev/disk/* symlinks. But I have to clean-up my home gentoo first.

Thank you for hint.
Comment 53 Steven Elling 2010-10-06 19:35:44 UTC
I have updated my server at home (different from my other machine with problems) and now I'm having the same problem as that in comment #52.

I was trying to resize a LV when I found the lvm symlinks and the sda block device files were not created.  I got around this problem by running 'MAKEDEV sda' in /dev/, then 'vgscan' and finally 'vgmknodes'.

I'm running kernel 2.6.29-gentoo-r5 with udev 151-r4 and have yet to remove CONFIG_SYSFS_DEPRECATED, CONFIG_SYSFS_DEPRECATED_V2 and CONFIG_IDE as instructed by the udev ebuild to see if this fixes the problem.  I'm currently trying to solve a problem which appears to be caused the sandbox ebuild first.

Also, the "Gentoo udev Guide"[1] should probably be updated to warn user's about the kernel config.

[1] http://www.gentoo.org/doc/en/udev-guide.xml
Comment 54 Javier Miqueleiz 2011-02-17 13:39:24 UTC
Same problem here as explained in comment #50. Seems the lvm2 version in genkernel-3.4.10.907 is too old for recent kernels without CONFIG_SYSFS_DEPRECATED_V2.

For booting the system I entered genkernel's shell and edited /etc/lvm/lvm.conf. I changed sysfs_scan=0 to sysfs_scan=1. This way the system is able to find the lvm2 volumes.

I wanted a cleaner solution, so I tried genkernel-3.4.12.6-r2 that comes with a newer lvm2 version (2.02.74). This version is able to find the volumes and the system boots normally.

Here are the versions I tried successfully:

sys-kernel/genkernel            3.4.12.6-r2
sys-kernel/hardened-sources     2.6.36-r9
sys-fs/lvm2                     2.02.73-r1
sys-fs/udev                     151-r4
Comment 55 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-03-27 03:21:55 UTC
genkernel has a much newer LVM2 now.