I have two mdadm arrays on my system:
alex@fileserver:~$ cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md1 : active raid5 sdc1 md0 sde1 7759197184 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] md0 : active raid0 sdd1 sdb1 3907019776 blocks super 1.2 512k chunks unused devices: <none>
If you look real close, you'll see that
md0 in its array. (I had two 4 TB disks and two 2 TB disks, and this is how I wanted it working together...)
This works great, except on boot. Even though my
mdadm.conf has these lines:
ARRAY /dev/md/0 metadata=1.2 UUID=ba271258:3f18f660:1d5d19aa:2bd0d8e3 name=fileserver:0 ARRAY /dev/md/1 metadata=1.2 UUID=262a6823:3fafb521:75e315ab:f2de4329 name=fileserver:1
it manages to assembly
md0 just fine, but
md1 is missing
md0 in its array, and ends up sitting there inactive, with only
sde1 as spares. I'm guessing mdadm tries to assemble its arrays in parallel or something?
If, after boot, I do
mdadm --stop /dev/md1 and then
mdadm --assemble --scan, the array is correctly put together.
My scenario is probably not very standard, but is there some simple solution to this issue? E.g. some way to tell mdadm.conf that
md1 depends on
md0? I could always just write a small init script that does the stop/assemble commands for me after mdadm, but I'd rather avoid such hacks if a proper solution exists, especially since I have system services that rely on
md1 being present and mounted to work properly.