Autoassembly of MD devices
From openSUSE
MD autoassembly on iSCSI devices
Using MD over iSCSI has the initial problem that iSCSI is started only after the network and with that far too late for the boot.md script to activate any MD RAID devices. With SLES10 SP2 we've integrated mdadm into udev, so that MD devices can now be started from udev directly.
Of course you don't have to run MD on iSCSI for this to work. You can as well use it for MD on local disks and don't activate /etc/init.d/boot.md, just for the coolness factor.
How to configure
- You have to use MD metadata format '1.2'. In principle other formats might work but using '1.2' protects against accidental enabling of this feature. In addition the udev rules will only trigger autoassembly if a metadata format '1.2' is detected.
- Create the MD array on the component disks.
- Create a /etc/mdadm.conf containing the DEVICE and ARRAY sections. A sample mdadm.conf file could look like this:
DEVICE /dev/dm-*
ARRAY /dev/md1
uuid=266cab2a:5165b37f:7b5d9e6a:8d371b5f
ARRAY /dev/md0
uuid=8d51be7f:a9a4665f:fc6779fb:49a1da7d
If you are running MD on top of multipath make sure to only scan device-mapper devices (ie restrict the DEVICE section to /dev/dm-*) so as not to start MD on the underlying block devices.
That's all. If you want to have the array started automatically on boot you have to switch the iSCSI component devices to 'automatic', so that the initiator will log into the target automatically on boot.

