Re: mdadm RAID1 with 3 disks active on 2 disks configuration
From: antlists <hidden>
Date: 2020-02-23 20:40:44
On 23/02/2020 17:38, Aymeric wrote:
Hello, I've a system with a RAID1 using two disks (sda + sdb) + 1 spare (sdc). For some stupid reason (cable) the spare (sdc) became active and sda was out the array. I then added back sda to the RAID1 but now I've RAID1 with three active disks and zero spare. I don't understand why the spare device didn't switch back as spare after sda have been rebuild.
Because rebuilding sda is a lot of work. The sensible option would have been to leave sdb and sdc active, and left sda as spare.
I used the following command to add sda to the RAID1: # mdadm /dev/md0 --add /dev/sda3 What did I do wrong here? And how to fix it? Do I have to set sdc to faulty and add it back?
I'd just leave it as a 3-disk raid. But no, if you do want to set it back to a 2-disk raid don't do a "faulty and re-add" - that'll just make re-sync it again. Somehow you've got active devices set to 3, so just set that back to two. If you look on the wiki it covers the scenario of converting a three-disk raid to two. The only thing I will add about a 3-disk raid is that if you want to change it to anything else, you'll have to revert to 2 first, but do that when you want to change things, leave it at 3 for the moment.
Thanks!
Cheers, Wol