[systemd-devel] Need help with a systemd/mdadm interaction.
NeilBrown
neilb at suse.de
Tue Nov 12 18:58:24 PST 2013
On Tue, 12 Nov 2013 03:03:44 +0100 (CET) Jan Engelhardt <jengelh at inai.de>
wrote:
>
> On Tuesday 2013-11-12 01:31, NeilBrown wrote:
> >
> >mdadm is quite good at assembling arrays incrementally. "udev" runs
> >"mdadm -I" for each new device and mdadm gathers them into arrays and
> >activates the array once all the expected devices have been gathered.
> >[mdadm might] wait [...] forever.
> >mdadm can handle this, but it needs to be told. The command:
> > mdadm -IRs
> >will find any arrays which have enough devices to start degraded but haven't
> >been started yet, and will start them.
>
> Using mdadm -R in udev would be a really bad idea, because it would
> make for a race, I think. Consider a system that has finished booting
> and is as ready as can be, and you plug in USB disks that form a RAID
> array. If you use -R, the array may start before you had the chance
> to plug them all in, causing the array to start in degraded mode,
> potentially causing a long resync when all missing devices have been
> plugged into their sockets.
>
> >Alternately, is there some "all devices have been probed, nothing new will
> >appear unless it is hot-plugged" event. That would be equally useful (and
> >probably mirrors what hardware-RAID cards do).
>
> IIRC, openSUSE had a /etc/init.d/boot.coldplug once upon a time
> (seems to be 9.3) that acted like what you describe.
> The order was like udevadm trigger, load static module list,
> udevadm settle, run mdadm, chroot /realroot, repeat for real root
> once more. Would that still work?
It is easy to do what I describe using ad hoc scripts - that's what I do in
the initrd.
But for no-root filesystems I don't really want to use some ad-hoc script. I
want to integrate into systemd to benefit from all the good bits of systemd.
Thanks,
NeilBrown
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20131113/91eb7ad6/attachment-0001.pgp>
More information about the systemd-devel
mailing list