Re: let md auto-detect 128+ raid members, fix potential race condition

From: Alexandre Oliva
Date: Mon Jul 31 2006 - 23:33:53 EST

On Jul 31, 2006, Alexandre Oliva <aoliva@xxxxxxxxxx> wrote:

>> mdadm --assemble --scan --homehost='<system>' --auto-update-homehost \
>> --auto=yes --run

>> in your initrd, having set the hostname correctly first. It might do
>> exactly what you want.

> I'll give it a try some time tomorrow, since I won't turn on that
> noisy box today any more; my daughter is already asleep :-)

But then, I could use my own desktop to test it :-)

FWIW, here's the patch for Fedora rawhide's mkinitrd that worked for
me. I figured even without --homehost it worked fine, even without
HOMEHOST set in mdadm.conf.

I hope copying mdadm.conf to initrd won't ever hurt, can you think of
any case in which it would?

--- /sbin/mkinitrd 2006-07-26 15:43:41.000000000 -0300
+++ /tmp/mkinitrd 2006-08-01 00:06:14.000000000 -0300
@@ -1240,10 +1240,19 @@

if [ -n "$raiddevices" ]; then
+ if test -f /sbin/mdadm.static; then
+ if test -f /etc/mdadm.conf; then
+ inst /etc/mdadm.conf "$MNTIMAGE/etc/mdadm.conf"
+ fi
+ inst /sbin/mdadm.static "$MNTIMAGE/sbin/mdadm"
+ emit "mkdir /dev/md"
+ emit "mdadm --quiet --assemble --scan --auto-update-homehost --auto=yes --run"
+ else
for dev in $raiddevices; do
cp -a /dev/${dev} $MNTIMAGE/dev
emit "raidautorun /dev/${dev}"
+ fi

if [ -n "$vg_list" ]; then

Alexandre Oliva
Secretary for FSF Latin America
Red Hat Compiler Engineer aoliva@{,}
Free Software Evangelist oliva@{,}