Re: Patch to add RAID autostart to IBM partitions

From: Neil Brown
Date: Mon Oct 18 2004 - 20:57:26 EST


On Saturday October 16, zaitcev@xxxxxxxxxx wrote:
> On Sat, 16 Oct 2004 12:09:39 +0100
> Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> > We had this for a few partition types (and full block devices) already
> > and it's been vetoed. Use mdadm from initrd/initramfs instead.
>
> It is doable in theory, but in practice mdadm is too retarded (I'm taliking
You sweet-talker you....

> about mdadm 1.6.0 here). Its man page says:
>
> mdadm can perform (almost) all of its functions without having a
> configuration file and does not use one by default.
>
> I guess "almost" is the key. Firstly, it collapses with any attempt to run
> "mdadm -A -s" or any variation of such, because it's full of places like
> this.
>
> mddev_ident_t array_ident = conf_get_ident(configfile, dv->devname);
> mdfd = open_mddev(dv->devname, array_ident->autof);

Hmm, thanks for the bug report. I'll fix that rather silly bit of
code..... there. The next release won't have that bug.
>
> Obviously, array_ident is NULL if a config file is not present. It is
> possible to fool the stupid thing by giving it a dummy config file,

There's that silver tongue again. It makes one feel all warm
inside....

> like this one:
>
> DEVICE partitions
> ARRAY /dev/md0
>
> It still won't scan, aborting with this:
> mdadm: /dev/dasda has no superblock - assembly aborted

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.

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.

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/