Is it possible to assemble a specific RAID array using mdadm and its scan-functionality, but without the need for a configuration file?
I'm using a custom-made initramfs to setup my system (dm-crypt and other stuff). Everything is done and configured within the init script and that's the way I'd like to keep it, i.e. without any additional config files.
Within the init script, I'd like to assemble one specific RAID array using command-line only. The array is identified via its UUID, the md device name is given and array members should be scanned for (since e.g. an attached USB stick or a failed device would mess up /dev/sdX names). All other devices and potential RAID arrays are to be ignored, since during boot only that one array is of interest (carries the root filesystem).
Thoroughly reading mdadm's man page and performing several tests I came up with this:
mdadm --assemble --uuid <uuid> /dev/md0
This seems to be working, but is this the right way to do it?
From the man page:
If precisely one device is listed, but --scan is not given, then mdadm acts as though --scan was given and identity information is extracted from the configuration file.