Bug 471 - Root on software raid don't boot on new 2.5 kernel since after 2.5.45
Summary: Root on software raid don't boot on new 2.5 kernel since after 2.5.45
Alias: None
Product: IO/Storage
Classification: Unclassified
Component: MD (show other bugs)
Hardware: i386 Linux
: P2 high
Assignee: Daniele Venzano
Depends on:
Reported: 2003-03-18 14:14 UTC by Troels Liebe Bentsen
Modified: 2004-07-17 17:13 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.5.65
Regression: ---
Bisected commit-id:


Description Troels Liebe Bentsen 2003-03-18 14:14:54 UTC
 Linux Mandrake 9.0 (std kernel 2.4.21-pre1)
Hardware Environment:
 ASUS A7M266-D ACPI BIOS Revision 1006
 Promise 20268 PCI IDE Controler
 Intel Ethernet Pro 100
 ATI Radeon QD

Problem Description:
 The software raid setup I have boots on 2.4 but not on newer 2.5 kernels, i
have everything need compiled in and the 2.5 kernel also rapports that it has
found /dev/md2 but it rapports that is's unable to mount the root partition for
this device. I have tried to pass /dev/md0 as the root but this hangs the
kernel, is root on raid broaken in kernel 2.5 or am I doing something wrong?

        append=" devfs=mount"

        append=" devfs=mount"

  /dev/hda1             1     20318  10240240+   7  HPFS/NTFS
  /dev/hda2         20319    116301  48375432    5  Extended
  /dev/hda5         20319     20522    102784+  83  Linux
  /dev/hda6         20523     22554   1024096+  83  Linux
  /dev/hda7         22555    116301  47248456+  fd  Linux raid autodetect

  mdadm: # UUID removed
   ARRAY /dev/md0 level=raid1 num-devices=2 
   ARRAY /dev/md1 level=raid1 num-devices=2
   ARRAY /dev/md2 level=raid1 num-devices=2 
   ARRAY /dev/md3 level=raid0 num-devices=2

  /dev/md0 on /boot type ext3 (rw)
  /dev/md2 on / type reiserfs (rw,notail)
  /dev/md3 on /dist type reiserfs (rw,notail)

   /dev/md2 / reiserfs notail 1 1
   /dev/md0 /boot ext3 defaults 1 2
   /dev/md1 swap swap defaults 0 0
   /dev/md3 /dist reiserfs notail 1 1
Comment 1 robert stanford 2003-03-22 18:53:42 UTC
I'm getting the same, however at boot the kernel goes to autodetect the md's and
finds nothing. In my case, am running raid1 on / with ext3 on Debian Unstable
Comment 2 Troels Liebe Bentsen 2003-05-25 15:57:55 UTC
Sorry for the long wait,
Yes is was using devfs and lilo, and that was the problem "/dev/md/2" vs.
/dev/md2, but should it hang?, and also it looks like lilo resolves to some dev
number, it then pases to the kernel when the root= option is used, but this
number has apprently changed from 2.4 til 2.5, i don't know if this should be
viewed as a kernel bug or just the realization that i should be useing grub instead.

Also would there be any problem in still supporting lilo's way of doing things,
ie. the device number thing. And for people who use a less broaken bootloader,
why not allow them to use the old /dev/md[0-9] kind of root even if devfs
support is compilled in, like in 2.4.
Comment 3 Daniele Venzano 2003-07-07 10:44:23 UTC
This bug is still present on kernel 2.5.74. I have three RAID-1 md devices with 
the root on /dev/md2. Linux won't boot saying that he can't find /dev/md2 and
that a correct root= parameter should be specified.
The md devices get correctly autoprobed and activated before the boot stops.
I've tried with devfs and GRUB (so it's not LILO related).
I'll try without devfs and report if there'll be something new.
Comment 4 Daniele Venzano 2003-07-15 13:28:51 UTC
Just tried 2.6.0-test1 without devfs and it works, so it seems a devfs problem.

Will someone ever fix (or just look into) this bug ? I just don't know anything
on that part of the kernel...
Comment 5 Alan 2003-07-27 04:25:59 UTC
Doesn't look like a bug to me. 2.4 devfs also uses /dev/md/0 /dev/md/1 /dev/md/2 etc
Comment 6 Daniele Venzano 2003-07-28 14:37:51 UTC
This patch from Andrew Morton fixes the bug, with this the kernel boots fine
with root=/dev/mdX as boot option.
Thanks also to Andrey Borzenko who helped finding the problem.

diff -puN init/do_mounts_devfs.c~read_dir-fix init/do_mounts_devfs.c
--- 25/init/do_mounts_devfs.c~read_dir-fix      2003-07-28 00:21:40.000000000 -0700
+++ 25-akpm/init/do_mounts_devfs.c      2003-07-28 00:21:40.000000000 -0700
@@ -54,7 +54,7 @@ static void * __init read_dir(char *path
        if (fd < 0)
                return NULL;

-       for (size = 1 << 9; size <= (1 << MAX_ORDER); size <<= 1) {
+       for (size = 1 << 9; size <= (PAGE_SIZE << MAX_ORDER); size <<= 1) {
                void *p = kmalloc(size, GFP_KERNEL);
                int n;
                if (!p)

Note You need to log in before you can comment on or make changes to this bug.