Have to manually build RAID array every boot and cannot add third drive - MDADM
If you need to issue mdadm --build
to assemble the array, it means that you created an "old-style" array, with no superblock. In other words, the array geometry (and other metadata) are not stored on the affected disks, rather the system expect these information to be provided on the command line or to find them in a configuration file called /etc/mdadm.conf
Regarding the other issue (inability to add a third active disk), let see what the man page says about --build
(no-superblock) arrays:
When used with --build, only linear, stripe, raid0, 0, raid1, multipath, mp, and faulty are valid.
As you can see, RAID5 is not allowed with legacy arrays. By issuing the first --grow
command you forced the system into a unexpected scenario and the following --add
could only set the new disk as a spare. The second --grow
then fails because it can not find a valid superblock on the member disks.
I strongly suggest you to backup your data and to re-create a RAID5 array with both a superblock and a write bitmap. To accomplish that, you simply need to use mdadm
default setting. In other words, something as
mdadm --create /dev/md0 -l 5 -n 3 /dev/sda1 /dev/sdb1 /dev/sde1
should be enough. Be sure to understand that the above command will erase all your data from the affected disks, so be sure to have a confirmed-good backup before issuing it.