Bug#684708: mdadm: support external metadata arrays correctly

Michael Tokarev mjt at tls.msk.ru
Mon Aug 13 11:43:16 UTC 2012


On 13.08.2012 14:10, Miquel van Smoorenburg wrote:
> Package: mdadm
> Version: 3.2.5-1
> Severity: serious
> Tags: patch wheezy sid
> 
> The initramfs hook supplied by mdadm doesn't install mdmon. Also, mdmon
> is not included in the .udeb for the installer.
> 
> This means that if you have an array with external metadata (ddf or,
> more widely used, imsm - Intel Matrix Raid) that it will come up
> readonly. This causes the installer to hang or the system not being
> able to boot if root is on that array.

I'm not sure this is the right course of actions -- speaking of the
initramfs part, not about the d-i part.

What's wrong with the array being started read-only?  Root filesystem
has always been mounted readonly in initrd/initramfs.  There's no fsck
tool included in initramfs.  Once we switch to real root, we may start
mdmon and remount filesystem(s) read-write as appropriate, after
fsck'ing them etc.

Why the system is not being able to boot if root is on such an array?

> The attached patch does a couple of things:
> 
> - it makes sure mdadm is included in the initramfs and the udeb package

Sure it is needed in the d-i (udeb), because d-i have to write the
system to it.  But I'm not convinced it is needed in the initramfs.

> - it adds a mdadm-waitidle script that runs just before reboot/halt. For all
>   arrays that are still running, it sets safe_mode_delay to a low version,
>   sets sync_action to idle, and waits for the array(s) to go idle.
>   This is needed so that the array is clean, otherwise it will start
>   to resync at the next boot.

This is risky - we may never finish shutdown.  This is especially risky
for things like raid - eg, stalled raid (resync) thread (we've seen
these more than once) -- in such cases current code will shut down,
but with this wait it wont anymore.  Especially useful for remote
systems.  Such an approach should be tested with extra care, I'm
not sure we have resources to do that for wheezy.  Generally it is a
good idea I think.

> - it adds 2 lines of code to mdmon.c so that it symlinks its pidfile
>   into /run/sendsigs.omit.d - mdmon should not be killed at shutdown,
>   we still need it after the rootfs has been unmounted.

And I'm not sure this is needed, either: it can trivially be done in
the initscript.

> I have added support for installation on Intel Matrix raid (imsm)
> arrays using mdadm to d-i, and I'll be sending patches to the debian-boot
> list soon. Please consider this patch for inclusion in wheezy.

So far I think the only real change there is the inclusion of mdmon
to the udeb, the other changes are a bit questionable for wheezy.

Thank you!

/mjt



More information about the pkg-mdadm-devel mailing list