Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 42563 - Kernel 2.6 fails to boot from md with initrd
Summary: Kernel 2.6 fails to boot from md with initrd
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: x86-kernel@gentoo.org (DEPRECATED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-23 01:54 UTC by Wouter Coppens
Modified: 2004-07-15 13:00 UTC (History)
1 user (show)

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


Attachments
.config for gentoo-dev-sources-2.6.3-r1 (.config,23.57 KB, text/plain)
2004-02-23 01:57 UTC, Wouter Coppens
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wouter Coppens 2004-02-23 01:54:41 UTC
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"
Comment 1 Wouter Coppens 2004-02-23 01:57:24 UTC
Created attachment 26148 [details]
.config for gentoo-dev-sources-2.6.3-r1
Comment 2 Jason Cox (RETIRED) gentoo-dev 2004-04-13 21:18:30 UTC
Does this work if you compile raid1 into the kernel? How about a newer kernel?
Comment 3 Wouter Coppens 2004-04-15 01:49:06 UTC
If I compile raid1 in the kernel, it works perfectly.

I tried it with 2.6.5-gentoo and it still fails.
Comment 4 Jason Cox (RETIRED) gentoo-dev 2004-04-15 19:03:36 UTC
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?
Comment 5 Wouter Coppens 2004-04-16 02:49:46 UTC
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.
Comment 6 Jason Cox (RETIRED) gentoo-dev 2004-04-16 17:32:38 UTC
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.
Comment 7 Jason Cox (RETIRED) gentoo-dev 2004-04-16 18:40:15 UTC
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?
Comment 8 Jason Cox (RETIRED) gentoo-dev 2004-06-02 17:28:58 UTC
I guess this is closed. We found a solution, but no response back.
Comment 9 Wouter Coppens 2004-06-03 02:11:44 UTC
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.
Comment 10 Tim Yamin (RETIRED) gentoo-dev 2004-06-06 01:50:04 UTC
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?
Comment 11 Wouter Coppens 2004-06-09 06:41:27 UTC
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

Comment 12 Wouter Coppens 2004-06-25 08:25:19 UTC
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.
Comment 13 Wouter Coppens 2004-06-29 02:45:40 UTC
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.
Comment 14 Tim Yamin (RETIRED) gentoo-dev 2004-07-15 13:00:52 UTC
[ 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!