Replacing a drive in a mirrored set (RAID1), how does it know which is “primary”

hardware-raidraidraid1

Let's say I have a RAID 1 array with two mirrored drives. One goes bad. If I order a spare online and just put it in, the hardware controller will rebuild the array, right? How does it know which drive to mirror? What if the drive I ordered wasn't wiped and was in another RAID1 array? Is there any risk of it mirroring that drive's contents to my drive?

Best Answer

For most hardware RAID cards, when you remove the failed drive it will know that it is gone. Then when you install a new drive of the same size it will just add that drive as the replacement for the removed drive that failed.

In the case of a drive that was in another RAID, the controller knows the ID of the RAID set that is written to the drives. If it finds an ID on the new drive that doesn't match the array it is configured for, it will not join it to the array. The management interface for the RAID card either by entering it during boot time or via the RAID management software within the OS will have an option to import a foreign disk or in some other way force a disk with a foreign configuration to be use.

Related Topic