Is RAID5 more robust than RAID1 ?

Posted by: andy

Is RAID5 more robust than RAID1 ? - 29/07/2009 07:48


I am about to replace an old hardware RAID5 array with a Linux software RAID1 array. I was talking to a friend and he claimed that RAID5 was more robust than RAID1.

His claim was that with RAID5, on read the parity data was read to make sure that all the drives were returning the correct data. He further claimed that on RAID1 errors occurring on a drive will go unnoticed because no such checking is done with RAID1.

I can see how this could be true, but can also see that it all depends on how the RAID systems in question are implemented. Surely a RAID5 system doesn't have to read and check the parity data on a read and a RAID1 system could just as easily read from all drives on read to check they were all holding the same data and therefore achieve the same level of robustness (with a corresponding loss of performance).

So the question is, what do RAID5/RAID1 systems in the real world actually do ? Do RAID5 systems check the parity data on reads ? Are there RAID1 systems that read from all drives and compare the data on read ?

See also:

http://serverfault.com/questions/47458/is-raid5-more-robust-than-raid1
Posted by: mlord

Re: Is RAID5 more robust than RAID1 ? - 29/07/2009 11:09

Your friend's points are all true, and are the sort of thing that enterprise storage vendors like to fret over. New, high-end drives are now getting extensions that provide extra parity bits and the like for end-to-end data integrity.

BUT.. for real-people, SATA and/or UDMA-IDE is good enough. The drives, internally, always use massive ECC on the data. So if they return data, you are assured it is "parity-corrected".

The reason for SATA and/or UDMA-IDE, is that those interfaces also assure CRC protection on the link between the drive and the host controller. So it is protected against most bit errors on that path, too.

The only thing RAID5 buys over RAID1 here, is protection between the controller and the system memory. Which really isn't meaningful.

Note also, that anything attached with USB has _no_ parity/crc protection over the USB cable..

Cheers
Posted by: wfaulk

Re: Is RAID5 more robust than RAID1 ? - 29/07/2009 11:39

Originally Posted By: andy
Do RAID5 systems check the parity data on reads?

I don't know this, but it seems to me unlikely that it does. Remember that in order to calculate the parity, it will have to read the block from all drives in your RAID set and then do math to determine correctness, whereas if it doesn't, it just just does the read off of one drive. Also, if your read is for less than one block, a parity-check read would have to expand it to a full block, whereas a regular read wouldn't. (Assuming, of course, that the RAID block is bigger than the disks' blocks. I think that reads from disk have to be of full blocks. If not, my point is even more valid.)

So, from my point of view, yes, it could do that, but if it did, it would be inefficient, and I doubt that any are implemented that way.

Again, though, I have no personal knowledge of actual implementations.
Posted by: wfaulk

Re: Is RAID5 more robust than RAID1 ? - 29/07/2009 11:49

Hm. That serverfault web site looks interesting. I'll have to keep that one on my radar.
Posted by: drakino

Re: Is RAID5 more robust than RAID1 ? - 29/07/2009 11:53

The Compaq/HP controllers I worked with would run data integrity checks on any RAID set when the controller was idle. All it did was read the entire RAID set, and check for errors coming back from disks indicating one might be failing.

Definitely ensure some sort of full read is done to the array at some point, even if under linux it is a simple cat /dev/device > /dev/null. I had a 2 drive failure on my RAID 5 software array when one disk died completely, and a second one had a bad spot. I did manage to recover the majority of data in the end, but would have preferred to know ahead of time one of the disks was having problems.
Posted by: mlord

Re: Is RAID5 more robust than RAID1 ? - 29/07/2009 12:19

For that, just ensure you have smartmontools installed and configured to do regular (say, weekly) surface scans of the media.

Cheers
Posted by: andy

Re: Is RAID5 more robust than RAID1 ? - 29/07/2009 12:25

The Linux mdadm tools include a "checkraid" script, which I believe checks for array consistency.
Posted by: andy

Re: Is RAID5 more robust than RAID1 ? - 29/07/2009 12:47

Originally Posted By: wfaulk
Hm. That serverfault web site looks interesting. I'll have to keep that one on my radar.


See also:

http://www.stackoverflow.com/
http://www.superuser.com/ (still in "private" beta, password ewok.adventure )
Posted by: LittleBlueThing

Re: Is RAID5 more robust than RAID1 ? - 31/07/2009 10:47

The most critical factor in selecting drives for RAID:
"do they offer advance-replacement RMA service?"

In the UK that is Samsung - dodgy drives... great service.

As for the other questions : http://linux-raid.osdl.org/

checkraid essentially does :
echo check > /sys/block/mdX/md/sync_action

If however you do
echo repair > /sys/block/mdX/md/sync_action

Then it will read all blocks for a stripe and if a read-error occurs, will calculate the block from parity and attempt to write the block that failed to read.