Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 201565 - genkernel-3.4.9_pre11 does not create /dev/md1, /dev/md2 when using mdadm and lvm2
Summary: genkernel-3.4.9_pre11 does not create /dev/md1, /dev/md2 when using mdadm and...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-07 07:59 UTC by Michael Gisbers
Modified: 2008-07-29 11:58 UTC (History)
2 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 Michael Gisbers 2007-12-07 07:59:45 UTC
I recently tried to combine software raid and lvm2 using genkernel. Invoking genkernel with options '--mdadm' and '--lvm' creates a propper initramfs. After appending 'root=/dev/ram0 real_root=/dev/system/root domdadm dolvm' I tried to boot. Booting failed because of missing /dev/md1 and /dev/md2 (I configured 2 diffrent software raid1 devices).

Generating a initramfs-overlay with /dev/md1 and /dev/md2 fixed the problem.

It would be helpful if genkernel scripts could check /etc/mdadm.conf for /dev/md* - devices and create them like it is done for real_root=/dev/md*


Reproducible: Always

Steps to Reproduce:
1. use a real_root diffrent to /dev/md* because of using lvm on md
2. boot


Actual Results:  
/dev/md* does not exist, boot stops

Expected Results:  
create /dev/md* after mdadm scan and before mdadm assemble
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-12-07 08:15:22 UTC
You didn't post genkernel version; elso emerge --info is missing.
Comment 2 Michael Gisbers 2007-12-07 08:32:14 UTC
sys-kernel/genkernel-3.4.9_pre11

emerge --info
Portage 2.1.4_rc7 (default-linux/amd64/2007.0, gcc-4.2.2, glibc-2.7-r0, 2.6.24-rc4-eworm x86_64)
=================================================================
System uname: 2.6.24-rc4-eworm x86_64 Intel(R) Core(TM)2 CPU T7400 @ 2.16GHz
Timestamp of tree: Thu, 06 Dec 2007 01:46:01 +0000
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.3
dev-lang/python:     2.4.4-r6, 2.5.1-r4
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.10-r5
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.23-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -march=nocona -pipe -fomit-frame-pointer -momit-leaf-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /home/mythtv/ /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O3 -march=nocona -pipe -fomit-frame-pointer -momit-leaf-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="de_DE@euro"
LC_ALL="de_DE@euro"
LINGUAS="de"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/armagetron /usr/portage/local/layman/secondlife /usr/portage/local/layman/synce /usr/portage/local/layman/berkano /usr/portage/local/layman/sunrise /usr/portage/local/layman/xeffects /usr/local/portage-perl /usr/local/portage-lugor /usr/local/mythtv"
SYNC="rsync://10.5.1.254/gentoo-portage/"
USE="X X509 a52 aac aalib accessibility acl acpi additions adns aiglx alsa amd64 amr amrnb amrwb apache2 ares arts artswrappersuid asf ass audiofile avahi avantgo bash-completion berkdb bitmap-fonts bittorrent bl bluetooth branding bzip2 cairo caps ccache cdaudio cdda cddb cdparanoia cdr cdrecord chipcard2 chroot cli color-console cracklib crypt css ctype cups curl daap dbus dhcp dialup directv djbfft dmi dri dts dv dvb dvd dvdnav dvdr dvdread dynamic ecc emovix emvovix enca encode exif expat fam fame festival ffmpeg fftw firefox flac fmod foomaticdb fortran fping ft ftp fuse gcj gd gdbm gif gimp glib glitz gnutls gphoto2 gpm gps gs gsm gtk hal hdhomerun howl-compat hpn http httpd iconv id3 idea ieee1394 ilbc imagemagick imlib inkjar ipf-transparent ipod iproute2 iptv ipv6 irda irmc isdnlog ithreads java javascript jpeg kde kdeenablefinal kdehiddenvisibility kerberos kig-scripting lame lcms ldap libcaca libnotify live logitech-mouse logrotate lua lzo mad md5sum mdnsresponder-compat midi mikmod mjpeg mmap mmx mmxecxt mmxext mng modplug mono moviepack moviesounds mp2 mp3 mp3rtp mp4 mpeg mplayer mppe-mppc mudflap multiuser musepack musicbrainz mysql mysqli nagios-dns nagios-game nagios-ntp nagios-ping nagios-ssh ncurses network nls nptl nptlonly nsplugin ntp obex odk ogg oggvorbis old-daemons openal openct opengl openmp openvpn ortp oss ossi pam passwordsave pcmcia pcre pcsc-lite pdf perl php png pnm posix ppds pppd python qemu qt qt3 qt3support qt4 quicktime radio rar rc5 rdesktop readline reflection remote risky rle rrdcgi rtc rtsp samba sasl scanner screen sdl sdl-image seamonkey sensord session shout simplexml skey skins slang slp smartcard smp sndfile snmp soap sockets socks5 sound sox speex spell spl sqlite sqlite3 sse sse2 ssl ssse3 stats stream subversion svg svgi swat syncengine sysfs syslog tcltk tcpd teletext themes theora threads tidy tiff tk tordns truetype truetype-fonts type1-fonts unicode upnp usb utempter v4l v4l2 vboxbfe vcd vditool vhosts vim vim-syntax visualization vlm vnc vorbis vorbis-psy wacom webdav wifi winbind wininstallers wxwindows x264 xanim xcomposite xine xinerama xinetd xml xmlreader xmlrpc xmlwriter xorg xosd xscreensaver xsl xv xvid zeroconf zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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 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" FOO2ZJS_DEVICES="hp2600n" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" LIRC_DEVICES="serial" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-12-07 09:32:29 UTC
Please post your /etc/mdadm.conf, with comments stripped.
Also, what metadata version did you use for your MD devices?
Comment 4 Michael Gisbers 2007-12-07 11:10:12 UTC
cat /etc/mdadm.conf
ARRAY /dev/md/1 level=raid1 num-devices=2 UUID=3c2e48b7:427a8eff:567f4c49:72ad87ab
ARRAY /dev/md/2 level=raid1 num-devices=2 UUID=e7ddeb0b:31764f0e:1e645441:0681b3ed

I didn't specify metadata version while creating devices. How do I get version information?
Comment 5 DEMAINE Benoît-Pierre, aka DoubleHP 2007-12-16 14:12:25 UTC
I use radi without LVM.

FYI:
root@moon_gen_2:~# cat /etc/mdadm.conf |grep -v "^#"
root@moon_gen_2:~#

clear enough ? that conf file have never been mandatory. And I sware my / is using raid:
root@moon_gen_2:~# mount |head -n1
/dev/md7 on / type ext3 (rw,noatime)
root@moon_gen_2:~#

if what you ask was supported, it would break on my machine, that actuually works fine; it would fail with message: non existing, or unparsable mdadm.conf .

I am 99% sure there is no bug, except you misreading the tutorials. Is this the first time you set up raid ?

Now, let's enter "end user help" (off topic; this would better fit the forums, but I have to justify why I think there is no bug at all). Here is my boot section:
kernel /kernel-genkernel-x86-2.6.23-gentoo-r2-Gentoo-moon_20 \
        root=/dev/md7 odmraid acpi=force splash=silent lapic quiet \
        video=matroxfb:vesa:0x117,accel,mtrr,dev:0 \
        resume=/dev/hdc6 resume2=/dev/hdc6 \
        noresume_
initrd /initramfs-genkernel-x86-2.6.23-gentoo-r2-Gentoo-moon_20

So, by which magick can my system finds this automatically ?
root@moon_gen_2:~# mdadm --examine /dev/hdc7 |grep Preferred
Preferred Minor : 7
root@moon_gen_2:~#
here is the trick :) With this, as soon as md driver and programs come in the game, they can build autocamically all arrays. They scan all mass storage, list all RD devices, list all UUID. If for a given UUID, all member devices indicate the same minor, then the kernel can set it up immediately.

IIRC, this should allow to boot with / on RAID without using initrd, but I am not 100% whether it worked or not when I tried it. If it works, it means you dont need initrd to boot on raid.

Any way, if there really was a bug, failure, or missing any-thing, many other users would have complain. Raid is whidely used.

The only case where i could see your querry usefull would be for multiple raid layer system (raid over raid).

Please clsoe wontfix.
Comment 6 Michael Gisbers 2007-12-16 18:03:00 UTC
I think you just didn't read that I don't use / on /dev/md*.

When using it your way, /dev/md* is created by parsing kernel parameter 'real_root'.

My approach is creating software raid 1 an put a lvm2 on top.

So my / is mounted from /dev/mapper/system-root which is my logical drive.

In this case /dev/md* is not being created because real_root is set to /dev/mapper/system-root and not /dev/md*

So you just missinterpreted this case.
Comment 7 Andrew Gaffney (RETIRED) gentoo-dev 2007-12-27 22:41:23 UTC
Umm, so is this "resolved"? I don't use genkernel with mdraid or LVM, so I really have no idea what's going on here.
Comment 8 DEMAINE Benoît-Pierre, aka DoubleHP 2007-12-27 23:27:21 UTC
Andrew, I dont have this problem, and the reporter does not agree with me thinking there is not big at all, but, rather (sorry, dont take this personaly Michael), some kind of PEBCAK. I consider LVM as very complex, so, I tend not to use it.

Michel asks for a feature enhancement. As long as he does not agree with me, he is waiting for a "fix". So, Andrew, the bug will stay open as long as nobody proposes a patch.

Anyway, he just asks for a reorganisation of the initrd processes:
> create /dev/md* after mdadm scan and before mdadm assemble

I personally fears this could break things for other users. I am not enough involved in LVM to evaluate/estimate this danger for other users. I really can not understand the point of his querry.
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-12-28 00:45:09 UTC
To the original poster:
The functionality you seek is already available.
Change your existing config:
'root=/dev/ram0 real_root=/dev/system/root domdadm dolvm'
to:
'root=/dev/ram0 real_root=/dev/system/root domdadm dolvm lvmraid=/dev/md1,/dev/md2'
This will trigger the older setup_md_device logic, and was how this was done before mdadm was added to genkernel.

Beyond that, domdadm, in initrd.scripts, if you have 'domdadm', will generate an /etc/mdadm.conf if not present, and SHOULD create the device nodes and assemble them. If it doesn't try to explore why not. Using /dev/mdX names instead of /dev/md/X is a good starting point (because while I can expect it to make a node, making the directory is a different matter).

DoubleHP is off on a tangent here, because raid auto-assembly by the kernel requires that: raid is built into the kernel, you are using the old raid metadata formats (0.90 instead of 1.0/1.1/1.2), and that you are on an architecture were raid auto-assembly is supported (x86 and amd64 only). Plus Linus has said he wants to get rid of the in-kernel auto-assembly stuff, moving it to klibc instead.
Comment 10 Andrew Gaffney (RETIRED) gentoo-dev 2007-12-28 02:51:46 UTC
Sounds like a non-issue to me.
Comment 11 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-12-28 03:20:25 UTC
Just reopening for the moment, so we can trace why /dev/mdX were not created for the user. I think it might be the /dev/md/X vs. /dev/mdX issue that was previously solved combined with a common mis-configuration.
Comment 12 Javier Miqueleiz 2008-02-01 21:38:39 UTC
I use the same kind of setup as Michael (LVM on top of MD). And works perfectly for me (albeit the restrictions explained on bug #198892).

Perhaps some issue with genkernel busybox cache? (Try setting CLEAR_CACHE_DIR="yes" on /etc/genkernel.conf to see).

Also, make sure you use /dev/md* device names in /etc/mdadm.conf or set MDADM="no" in /etc/genkernel.conf so that /etc/mdadm.conf is not copied to the initramfs.
Comment 13 Andrew Gaffney (RETIRED) gentoo-dev 2008-07-29 11:58:18 UTC
If you can still replicate the problem, please reopen.