Re: Patch to add RAID autostart to IBM partitions

From: Neil Brown
Date: Thu Oct 28 2004 - 21:29:26 EST


On Tuesday October 19, zaitcev@xxxxxxxxxx wrote:
> On Tue, 19 Oct 2004 11:54:14 +1000, Neil Brown <neilb@xxxxxxxxxxxxxxx> wrote:
>
> Dear Neil,
>
> thank you for your patient reply. It makes things a lot clearer.
>
> > Yes, you haven't told it what defines "/dev/md0", so it assumes the
> > first device listed will define it, but /dev/dasda doesn't so....
>
> > You have to tell mdadm how to recognise /dev/md0. Possibly by UUID.
> > Possibly by "minor number".
> > e.g.
> >
> > DEVICE partitions
> > ARRAY /dev/md0 super-minor=0
> >
> > which means "if you find any devices listed in /proc/partitions which
> > contains an MD superblock which has a "md_minor" field of "0", then
> > use those to assemble /dev/md0.
>
> I see now. I'm sorry that I was unable to deduce it from the manual.
> One last question, if the -As worked, would it do the same?

No. -As needs a config file. Currently without the config file, it
crashes. In the next release, without a config file it will fail more
gracefully.

>
> > This will often be what you want, but might not always. e.g. if you
> > have plugged in a drive that was part of /dev/md0 in another machine,
> > then mdadm will have no way of knowing which drive is the "right" one.
>
> I guess there's nothing we can do about possible conflicts, except warn
> the operator at installation time. What is the recommended way to ask
> mdadm to list all conflicts, or simply all found array devices, for the
> benefit of an installation program reading a pipe?

These isn't really one.
mdadm -Es -c partitions

will list all possibly arrays - you could then pick the one you want.

But choosing the drives to assemble to make an md array is a lot like
choosing the partition to mount to find the root filesystem. It might
be possible to guess, but if you rely in the guess, it will sometimes
be wrong. At install time, it is safe to guess if there is only one
candidate. If there are more, you really have to ask.

After that, the boot process (or whatever process assembles the
arrays) really needs to have been told how to recognise components,
just like lilo tells linux which device has root (root=).

The output of mdadm -E could possibly be made more friendly (currently
it will happily list arrays that cannot possibly be completely
assembled right along side arrays that are likely to work).

NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/