Raid array, how does the controller know which drives needs repairing

Soldato
Joined
21 Oct 2002
Posts
18,022
Location
London & Singapore
Say you have a Raid 1 array of 2 drives...

You unplug one of these drives for say one month.

Then you plug it back in.

How does the controller know which drive is the "good" one and which is the one that needs rebuilding?

It must keep some sort of "last used timestamp" against the drive serial number? And then it would know which drive is the good one?
 
My money is with yours, still this is a guess.

If on the completion of each block of writes the driver writes a time stamp, or some other notionally unique but incremental code, to an otherwise protected area of the drive then the unplugged drive can be detected as out of date.

A new drive, or a drive new to the array, can be detected by checking the validity of the data in the protected area.
 
Would it not ask you?

And place the decision process in the worst possible place, between the keyboard and chair ? Shudder. I for one welcome our silicon overlords: 'Your memories have been determined inconsistent and out of date, prepare for upload'.

But until that glorious day arrives I suppose it could simply ask ;)
 
I can tell you with the Solaris OS, the drives serial numbers are stored in a database stashed away in an unused partition, as soon as a disk is removed, the database is updated on the remaining disk, marking the other disk as failed/bad/missing, and the raid in the maintainance state. Replacing the original disk, will force a resync, inserting a new disk, more work is required. (IE you have to manually update the database, removing the failed disk, and attaching the new drive to the raid)

There could be some form of timestamping, but its really not needed, if you connect both disks, it will check both disks for the raid status files, and if it finds 1 indicating an error, and the other indicating all is well, it will ignore the "all is well" data, and correctly resync.

I assume most raid hardware and software raid systems use similar systems.
 
Last edited:
Back
Top Bottom