Categories
linux MetaNET

Restarting linux software raid arrays

I have a server with different sets of RAID1 arrays, across two different sets of disks. The first set of arrays, on the first pair of disks, always starts fine. The second set never starts on boot. I don’t reboot this server very often, so it’s not often a problem, however I figure it’s worth looking into.

For starters, if you have an existing software RAID array that is merely not running, you can assemble it with mdadm like so:

[code]
mdadm –assemble /dev/md8 /dev/sdc1 /dev/sdd1
[/code]

mdadm also has a config file which is referred to in the system boot process, in order to work out where your arrays are. In theory this is all supposed to be self configuring, but I’ve seen enough cases where some arrays don’t start that it looks like using this config file is a recommended step.

You can generate a useful representation of your existing arrays with

[code]
mdadm –detail –scan
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=…
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=…
ARRAY /dev/md3 level=raid1 num-devices=2 UUID=…
[/code]

You can use similar syntax but specifying the specific devices used in each array, instead of the UUID, if you like. In theory, with this information appended to /etc/mdadm.conf, next time I reboot this server it should bring all the RAID devices up for me.