2000-11-14 12:05:59

by Ian Grant

[permalink] [raw]
Subject: RAID modules and CONFIG_AUTODETECT_RAID

In 2.2.x we were able to build a kernel with RAID modules and have it
autodetect RAID partitions at boot time - so we could use raid root partitions.

In 2.40 the configuration option CONFIG_AUTODETECT_RAID is explicitly disabled
unless at least one RAID module is built into the kernel. I presume there is
a good reason for this and that it's not just a mistake.

Are there any plans to re-enable this feature? It would be nice to be able to
have a single kernel for all our machines without having to have RAID in the
kernel when it isn't needed.


--
Ian Grant, Computer Lab., New Museums Site, Pembroke Street, Cambridge
Phone: +44 1223 334420 Personal e-mail: iang at pobox dot com



2000-11-15 09:38:27

by Peter Samuelson

[permalink] [raw]
Subject: Re: RAID modules and CONFIG_AUTODETECT_RAID


[Ian Grant]
> In 2.2.x we were able to build a kernel with RAID modules and have it
> autodetect RAID partitions at boot time - so we could use raid root
> partitions.

Really? Funny, because IIRC RAID autodetection does not even exist in
2.2.x kernels. Perhaps you are referring to vendor-patched kernels --
some distributions ship 2.2 kernels with RAID patches applied.

> In 2.40 the configuration option CONFIG_AUTODETECT_RAID is explicitly
> disabled unless at least one RAID module is built into the kernel. I
> presume there is a good reason for this and that it's not just a
> mistake.

What would be the point? Autodetection is only needed for mounting the
root filesystem. After root is mounted, you can use raidtools.

Peter

2000-11-15 10:08:37

by Ian Grant

[permalink] [raw]
Subject: Re: RAID modules and CONFIG_AUTODETECT_RAID

>
> [Ian Grant]
> > In 2.2.x we were able to build a kernel with RAID modules and have it
> > autodetect RAID partitions at boot time - so we could use raid root
> > partitions.
>
> Really? Funny, because IIRC RAID autodetection does not even exist in
> 2.2.x kernels. Perhaps you are referring to vendor-patched kernels --
> some distributions ship 2.2 kernels with RAID patches applied.

Sorry, I am referring to 2.2.x with Ingo's RAID patches.

> > In 2.40 the configuration option CONFIG_AUTODETECT_RAID is explicitly
> > disabled unless at least one RAID module is built into the kernel. I
> > presume there is a good reason for this and that it's not just a
> > mistake.
>
> What would be the point? Autodetection is only needed for mounting the
> root filesystem. After root is mounted, you can use raidtools.

I'll try again: we need autodetection to mount a RAID root filesystems on
those machines that have them, but we don't want RAID *built in* to the kernel
- we want it as modules, because lots of our machines don't have RAID
partitions on their disks at all. i.e. I want CONFIG_MD_{LINEAR,RAID{0,1,5}}=m
but then I can't say CONFIG_AUTODETECT_RAID=y We could do this with Ingo's
patches for 2.2.x but we can't do it with 2.4.0

Of course we need an initrd with the raid modules on it before we can boot
from a RAID root partition.

--
Ian Grant, Computer Lab., New Museums Site, Pembroke Street, Cambridge
Phone: +44 1223 334420 Personal e-mail: iang at pobox dot com


2000-11-15 10:24:51

by Peter Samuelson

[permalink] [raw]
Subject: Re: RAID modules and CONFIG_AUTODETECT_RAID


[Ian Grant <[email protected]>]
> Of course we need an initrd with the raid modules on it before we can
> boot from a RAID root partition.

raidtools can't run from an initrd?

Peter

2000-11-15 13:14:32

by Igmar Palsenberg

[permalink] [raw]
Subject: Re: RAID modules and CONFIG_AUTODETECT_RAID

On Wed, 15 Nov 2000, Peter Samuelson wrote:

>
> [Ian Grant]
> > In 2.2.x we were able to build a kernel with RAID modules and have it
> > autodetect RAID partitions at boot time - so we could use raid root
> > partitions.
>
> Really? Funny, because IIRC RAID autodetection does not even exist in
> 2.2.x kernels. Perhaps you are referring to vendor-patched kernels --
> some distributions ship 2.2 kernels with RAID patches applied.

I call the CONFIG_MD_BOOT option a RAID autodetection :)

> > In 2.40 the configuration option CONFIG_AUTODETECT_RAID is explicitly
> > disabled unless at least one RAID module is built into the kernel. I
> > presume there is a good reason for this and that it's not just a
> > mistake.
>
> What would be the point? Autodetection is only needed for mounting the
> root filesystem. After root is mounted, you can use raidtools.

Please notice the 'filesystem'. I needed to put /boot on a non-RAID
partition, else it was a nogo.

> Peter


Igmar

2000-11-15 22:20:37

by NeilBrown

[permalink] [raw]
Subject: Re: RAID modules and CONFIG_AUTODETECT_RAID

On Wednesday November 15, [email protected] wrote:
>
> [Ian Grant <[email protected]>]
> > Of course we need an initrd with the raid modules on it before we can
> > boot from a RAID root partition.
>
> raidtools can't run from an initrd?
>
> Peter

There is a realy issue here.
raidstart currently does not reliably start an array in the face of
drive failure or device renaming. So it could be used in an initrd
setup, but it might not be as reliable as autodetect.

2.4 has appropriate ioctls to allow for a more reliable raidstart, but
that raidstart hasn't been written yet. I have some patches for the
standard raidstart that improve the situation a bit, but I would
prefer a very different looking config file.

So while I would prefer that autodetection were done by user-space,
especially if initrd were being used, I can see that that isn't going
to happen just now, and that it shouldn't be too hard to do in the
kernel, and it is not really unreasonable to do it there.

Ian, could you please try the attached patch?
It looks ok to me, and compiles, but I am not in a good position to
test it at the moment.
Hopefully it will do an auto-detect when you load md.o, and will
automatically load raidX.o as required.

Let me know how it goes, and if there are no problems I will see what
Linus thinks of it.

NeilBrown



--- ./drivers/md/md.c 2000/11/14 21:36:22 1.2
+++ ./drivers/md/md.c 2000/11/15 21:46:28 1.3
@@ -3806,7 +3806,11 @@
#ifdef MODULE
int init_module (void)
{
- return md_init();
+ int rv = md_init();
+#ifdef CONFIG_AUTODETECT_RAID
+ if (rv==0) rv=md_run_setup();
+#endif
+ return rv;
}

static void free_device_names(void)
--- ./drivers/md/Config.in 2000/11/15 20:51:53 1.1
+++ ./drivers/md/Config.in 2000/11/15 21:46:29 1.2
@@ -13,6 +13,8 @@
dep_tristate ' RAID-4/RAID-5 mode' CONFIG_MD_RAID5 $CONFIG_BLK_DEV_MD
if [ "$CONFIG_MD_LINEAR" = "y" -o "$CONFIG_MD_RAID0" = "y" -o "$CONFIG_MD_RAID1" = "y" -o "$CONFIG_MD_RAID5" = "y" ]; then
bool ' Boot support' CONFIG_MD_BOOT
+fi
+if [ "$CONFIG_MD_LINEAR" = "y" -o "$CONFIG_MD_RAID0" = "y" -o "$CONFIG_MD_RAID1" = "y" -o "$CONFIG_MD_RAID5" = "y" -o "$CONFIG_BLK_DEV_MD" = "m" ]; then
bool ' Auto Detect support' CONFIG_AUTODETECT_RAID
fi