Adding _live_ spare to raid1+0. Howto?

Posted by MarchH4re@reddit | linuxadmin | View on Reddit | 25 comments

I've got a set of 4 jumbo HDDs on order. When they arrive, I want to replace the 4x 4TB drives in my Raid 1+0 array.

However, I do not wish to sacrifice the safety I get by putting one in, adding it as a hot spare, failing over from one of the old ones to the spare, and having that 10hr time window where the power could go out and a second drive drop out of the array and fubar my stuff. Times 4.

If my understanding of mdadm -D is correct, the two Set A drives are mirrors of each other, and Set B are mirrors of each other.

Here's my current setup:

Number Major Minor RaidDevice State
7 8 33 0 active sync set-A /dev/sdc1
5 8 49 1 active sync set-B /dev/sdd1
4 8 65 2 active sync set-A /dev/sde1
8 8 81 3 active sync set-B /dev/sdf

Ideally, I'd like to add a live spare to set A first, remove one of the old set A drives, then do the same to set B, repeat until all four new drives are installed.

I've seen a few different things, like breaking the mirrors, etc. These were the AI answers from google, so I don't particularly trust those. If failing over to a hot spare is the only way to do it, then so be it, but I'd prefer to integrate the new one before failing out the old one.

Any help?