How does RAID 1 determine which drive should act as the source for a rebuild

hard driveraid

Here's my scenario — both drives were working perfectly fine. I removed one of the drives for a while (building a new PC, didn't think I was going to use RAID anymore but changed my mind). I actually switch the SATA type to AHCI and was operating for about a week on the new system before deciding to re-enable RAID and reinstall the drive I had removed.

It's currently rebuilding, but I'm curious how it knows which one is the source and which one is out-of-date?

Best Answer

if you had it powered up at any point with one drive. it will usually have something like a write counter on the drive. so it will take whichever one is higher as the master.

So if you take out drive A for a week, but keep running with drive B, it would have had some writes in that time, and have a higher write counter. and then it would be the master.

Some controllers will base it off of what was there on last boot. if a drive was missing for a week, then it re-appears, it is now considered out of sync.

If you were to remove both drives simultaneously, it would depend on the controller as to what it would do. Most likely just show a foreign array you can import.

Related Question