* Re: mdadm RAID1 with 3 disks active on 2 disks configuration
2020-02-23 20:40 ` antlists
@ 2020-02-24 9:23 ` Aymeric P.
2020-02-24 9:25 ` Aymeric
1 sibling, 0 replies; 4+ messages in thread
From: Aymeric P. @ 2020-02-24 9:23 UTC (permalink / raw)
To: antlists, linux-raid
Le 23 février 2020 21:40:44 GMT+01:00, antlists <antlists@youngman.org.uk> a écrit :
>On 23/02/2020 17:38, Aymeric wrote:
>
>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.
Well, for some reason that didn't happen that way..
>> 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.
I would prefer to revert to sdc as a spare, it's a really a slow disk (5400rpm with a sata1 while others are 7200 at sata3). For a spare disk it's good enough to give me time to get a new disk in case of failure but not for daily.
> 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.
>
So I tried with the --grow option to change the number disk in the array but it doesn't want to change...
# mdadm --grow /dev/md0 --raid-devices=2
mdadm: /dev/md0: no change requested
# mdadm --grow /dev/md0 --raid-devices=3
mdadm: Need 1 spare to avoid degraded array, and only have 0.
Use --force to over-ride this check.
When looking with --examine, sdc3 is marked a replacement device.
# mdadm --examine /dev/sda3 /dev/sdb3 /dev/sdc3|grep 'dev\|Role\|State'
/dev/sda3:
State : clean
Device Role : Active device 1
Array State : AR ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdb3:
State : clean
Device Role : Active device 0
Array State : AR ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdc3:
State : clean
Device Role : Replacement device 1
Array State : AR ('A' == active, '.' == missing, 'R' == replacing)
Thanks,
Aymeric
--
Aymeric P.
Phone: +33 685 674 843
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: mdadm RAID1 with 3 disks active on 2 disks configuration
2020-02-23 20:40 ` antlists
2020-02-24 9:23 ` Aymeric P.
@ 2020-02-24 9:25 ` Aymeric
1 sibling, 0 replies; 4+ messages in thread
From: Aymeric @ 2020-02-24 9:25 UTC (permalink / raw)
To: antlists, linux-raid
Le 23 février 2020 21:40:44 GMT+01:00, antlists <antlists@youngman.org.uk> a écrit :
>On 23/02/2020 17:38, Aymeric wrote:
>
>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.
Well, for some reason that didn't happen that way..
>> 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.
I would prefer to revert to sdc as a spare, it's a really a slow disk (5400rpm with a sata1 while others are 7200 at sata3). For a spare disk it's good enough to give me time to get a new disk in case of failure but not for daily.
> 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.
>
So I tried with the --grow option to change the number disk in the array but it doesn't want to change...
# mdadm --grow /dev/md0 --raid-devices=2
mdadm: /dev/md0: no change requested
# mdadm --grow /dev/md0 --raid-devices=3
mdadm: Need 1 spare to avoid degraded array, and only have 0.
Use --force to over-ride this check.
When looking with --examine, sdc3 is marked a replacement device.
# mdadm --examine /dev/sda3 /dev/sdb3 /dev/sdc3|grep 'dev\|Role\|State'
/dev/sda3:
State : clean
Device Role : Active device 1
Array State : AR ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdb3:
State : clean
Device Role : Active device 0
Array State : AR ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdc3:
State : clean
Device Role : Replacement device 1
Array State : AR ('A' == active, '.' == missing, 'R' == replacing)
Thanks,
Aymeric
--
Aymeric P.
Phone: +33 685 674 843
Aymeric
^ permalink raw reply [flat|nested] 4+ messages in thread