Skip to contentSkip to conversation

What does --replace actually do?

DISCUSSION Eyal Lebedinsky 3 participants 3 messages Apr 15, 2016 MD RAID

lore
Share & tools
lore
#0 lore raw

When I request to replace sda with sdj (RAID6 in my case), does it create sdj from the other members (NOT using sda) or does it make a copy of (by reading) sda?

I hope it is the former, assuming sda is having issues and the action is precautionary.

I see on stackexchange is mentioned that it actually does the latter:
http://unix.stackexchange.com/questions/74924/how-to-safely-replace-a-not-yet-failed-disk-in-a-linux-raid5-array

And while I am here, can I replace two members at the same time? This should save time as it takes about 10 hours to reconstruct a 4TB member.

TIA

Signature · 1 line
Eyal Lebedinsky ([email protected])
#1 lore raw
Quoted 1 line · Eyal Lebedinsky

When I request to replace sda with sdj (RAID6 in my case), does it create sdj from the other members (NOT using sda) or does it make a copy of (by reading) sda?

It reads sda and copies it to sdj. When it's done it'll fail sda. If it has problems reading from sda, it'll use the rest of the drives to recreate/recalculate the block and write that to sdj.

Signature · 1 line
Mikael Abrahamsson    email: [email protected]
#2 lore raw
In reply to Eyal Lebedinsky
Quoted 7 lines · Eyal Lebedinsky

When I request to replace sda with sdj (RAID6 in my case), does it create sdj from the other members (NOT using sda) or does it make a copy of (by reading) sda?

I hope it is the former, assuming sda is having issues and the action is precautionary.

It's the latter. The data is copied from the existing disk, unless a read-error occurs, in which case it'll be reconstructed from the other members. This will be faster and have a far lower impact on performance than using the other members for everything. If you cannot trust the disk you're replacing then it should be failed and a normal rebuild carried out instead.

Quoted 3 lines

And while I am here, can I replace two members at the same time? This should save time as it takes about 10 hours to reconstruct a 4TB member.

I've no idea on this one I'm afraid. I can't think of any immediate reason why this wouldn't be possible, but whether the current implementation supports it or not is another matter. You could test with loopback devices.

Cheers,
Robin

Signature · 4 lines
     ___        
    ( ' }     |       Robin Hill        <[email protected]> |
   / / )      | Little Jim says ....                            |
  // !!       |      "He fallen in de water !!"                 |