What exactly does a RAID 1 resync do?

6

1

I just have a quick question about RAID 1 resyncs. When a RAID 1 array performs a resync is it actually copying all the data from one disk to another or is it just analyzing the data on the disks and correcting any differences?

The reason I ask is because I have a RAID 1 array on my laptop HDD with two external HDD's and whenever I take it anywhere I disconnect the externals. This causes a resync when I plug them back in and I don't want to be putting unnecessary stress on the drives if a resync does, in fact, copy all the data again. Thanks for any info!

Mike

Posted 2010-08-14T15:15:33.600

Reputation: 63

the answer may depend on your RAID technology, so what OS are you using, and if relevant how did you set up the RAID array? – Gilles 'SO- stop being evil' – 2010-08-14T16:05:17.053

Hi Gilles, I set up my array using mdadm on Linux, specifically Fedora 13. – Mike – 2010-08-14T17:27:56.677

1Welcome to Super User! don't worry about saying stuff like "I just have a quick question", its okay to ask questions and that's what we are all here for... :-) – studiohack – 2010-08-15T02:48:16.087

Answers

4

When a RAID 1 array performs a resync is it actually copying all the data from one disk to another or is it just analyzing the data on the disks and correcting any differences?

With a two drive RAID1 array, it is hard to 'correct' differences. You only have two copies of the data, so there is no way to determine which one is correct other than flipping a coin.

IF the RAID system keeps a checksum on each disk, I am wrong. Still, only zfs does that type of double-checking as far as I know (possibly btrfs or other newer FSes). RAID1 is for drive failure, not for error-detection or correction.

What this means to you is:

  1. At best the system can only detect that there is a desynchronization and tell you about it. At worst, it will detect that, determine it is a problem, and decide which version is right without telling you.

  2. If this resync happens quickly, you can know that it doesn't re-read the drive.

  3. Reading and writing to hard disks shouldn't be 'stress', for the most part. I'd guess that setting the drive down, dropping it accidentally and being in a car on a bumpy road would be more stressful for a portable drive.

Slartibartfast

Posted 2010-08-14T15:15:33.600

Reputation: 6 899