Hi, I wonder if I could get some advice.... 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.
This simple rule falls down if some expected device doesn't appear. If an array is marked as degraded then mdadm doesn't expect the missing device and will happily start the degaded array. However if the system shuts down with the md array fully functional, and a device is removed before the system is restarted, then mdadm does not know that the device is missing and will effectively wait for it 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. I used this quite effectively in out initrd. There is a loop that count up to N waiting for the root device to appear and when we get to "N/2" I run "mdadm -IRs" which makes any newly-degraded arrays appear. I'm wondering how to integrate this with systemd. Systemd has its own mechanism to wait for devices to appear, but I cannot see anyway to run "mdadm -IRs" at the half-way mark. It would of course be sufficient to wait for the complete timeout, then run "mdadm -IRs", then check if the device has appeared, but I can't see how to fit this into systemd either. So: how can I fit this need for "run some command on device timeout which might be successful in activating the device"? 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). Thanks, NeilBrown
signature.asc
Description: PGP signature
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel