Disk layout: /dev/md0 /boot (hda1 + hdb1) /dev/md1 swap (hda2 + hdb2) /dev/md2 / (hda3 + hdb3) md is build in kernel and raid1 is build as modules. devfs is left out of kernel. initrd is build with mkinitrd and raid1.ko is in initrd (I have double checked it) The same configuration works fine with kernel-2.4 Reproducible: Always Steps to Reproduce: 1. 2. 3. Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.21-gss) ================================================================= System uname: 2.4.21-gss i686 Intel(R) Pentium(R) M processor 1700MHz Gentoo Base System version 1.4.3.13 Autoconf: sys-devel/autoconf-2.58-r1 Automake: sys-devel/automake-1.7.7 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O3 -march=pentium3 -funroll-loops -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share / config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-O3 -march=pentium3 -funroll-loops -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://212.219.56.162/sites/www.ibiblio.org/gentoo/ http://ftp.s nt.utwente.nl/pub/os/linux/gentoo http://212.219.247.11/sites/www.ibiblio.org/ge ntoo/ http://212.219.247.17/sites/www.ibiblio.org/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm imlib jpeg li bg++ libwww mad mikmod motif mpeg ncurses nls ntpl oggvorbis opengl oss pam pdfl ib perl png python quicktime readline sdl slang snmp spell ssl svga tcpd truetyp e x86 xml2 xmms xv zlib"
Created attachment 26148 [details] .config for gentoo-dev-sources-2.6.3-r1
Does this work if you compile raid1 into the kernel? How about a newer kernel?
If I compile raid1 in the kernel, it works perfectly. I tried it with 2.6.5-gentoo and it still fails.
Do you object to compiling raid 1 into the kernel every time? If it's something that is needed to boot, then it should be in the kernel anyways. It sounds like a udev thing as well. Since it's compiled as as module, the devices aren't getting created until the module is loaded. Those devices are needed to boot. By failing on 2.6.5-gentoo, do you mean that it fails with raid1 compiled as a module?
The problem is that I have more then 100 servers to manage, all with different hardware. If I compile everything as modules, I can use 1 kernel for all my servers and loads the necessary drivers from an initrd. It works fine this way with kernel-2.4 If the system is installed on scsi-disks, it needs to load the scsi-module first and than the raid1. Otherwise the raid doesn't start. And I don't want to compile every driver in the kernel.
So we found a way to make it work. Are you using udev? It sounds kind of like a race condition almost. The devices aren't getting created fast enough for the kernel to use.
I'm lowering the priority, since we sort of found a solution. How many drviers would have to be built into the kernel to incorporate this fix?
I guess this is closed. We found a solution, but no response back.
I don't know if it's solved. It was not solved with gentoo-sources-2.6.5-r1 and I haven't tested it since then.
I don't see any reason it shouldn't work; this seems looks as more of an issue where the raid1 module isn't actually being loaded. Does the initrd say that it loaded the module successfully?
I have tested it again and it is not solved. File listing of the initrd: # find . ./bin ./bin/nash ./bin/modprobe ./bin/insmod ./dev ./dev/md0 ./dev/md1 ./dev/md2 ./dev/ram ./dev/null ./dev/tty1 ./dev/tty2 ./dev/tty3 ./dev/tty4 ./dev/console ./dev/systty ./etc ./lib ./lib/raid1.ko ./proc ./sbin ./linuxrc ./sysroot ./loopfs # cat linuxrc #!/bin/nash echo "Loading raid1.ko module" insmod /lib/raid1.ko echo Mounting /proc filesystem mount -t proc /proc /proc raidautorun /dev/md0 raidautorun /dev/md1 raidautorun /dev/md2 echo Creating block devices mkdevices /dev echo Creating root device mkrootdev /dev/root echo 0x0100 > /proc/sys/kernel/real-root-dev echo Mounting root filesystem mount -o noatime --ro -t reiserfs /dev/root /sysroot pivot_root /sysroot /sysroot/initrd umount /initrd/proc
I've done some additionel tests. The problem should be searched within the devices. For some reason it's missing some devices. If I compile 'devfs' and 'mount at boot' in the kernel, I can boot it with the raid1 modules in the initrd. I want to use udev and not devfs because it's obsolete. I'm gonna try to create the devices nodes in the initrd and see if I can boot.
ok, I have found what's going wrong. I took a closer look at the devices in the initrd: /dev/md0 is a symbolic link to /dev/md/0 /dev/md1 is a symbolic link to /dev/md/1 but the directory /dev/md is missing, so the symbolic links point to nowhere. I deleted the md's and recreated them with mknod. Now it works fine. So the mkinitrd script should be modified to create proper devices and not symbolic links.
[ From comment #13 ] I'm closing this bug since it is an upstream issue with the mkinitrd script and we can't do anything about that... Can I suggest filing a bug about this with its author? If you have any further issues then please feel free to reopen this bug. Thanks!