Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have seen people recommend RAID 10 over RAID 5 for databases due to RAID 10 giving better performance and a better chance of recovering from a hardware failure.

This confuses me as I thought the purpose of using RAID 5 was more a matter of the parity allowing the detecting and correcting write errors to ensure the integrity of the data. My understanding was that RAID 10 can not recover from write errors. I.e. if a bit has an error, it will be the opposite of the bit in the mirrored drive, and thus it will be impossible to tell which bit is the one with the error, and which is the correct one.

However, I tried googling along the lines of detect "write error" with raid 5 vs raid 10 to see if anyone covered this point, and came up empty handed.

Am I making this all up in my head?

Can a RAID 5 array detect and recover from write errors using the 3 parity bit? Or does the detection not occur until much later when the data is read and the parity indicates an error?

If a RAID 10 array has a write error, will it be able to determine which of the mirrored bits is the one in error? I.e. the drive indicates a read failure for that particulor bit, or does it just see the bits do not match and since there is no parity it can't determine which is in error?

I see some discussion of rebuilds being triggered by a read error. Do write errors not get detected until later when the data is being read? In other words, does the writer error occur, but the erroneous data just sits there until possibly much later when the data is read and the parity indicates an error. Is that why you are at risk of getting additional read errors during rebuild, in that you could be writing a large amount of data with errors but the errors will not be detected until the next time the data is read?

I would like to clarify that tape backups do not address the above question. If you have a scenario where data integrity is very important, and you can't detect write errors, then all the tape backups in the world won't help you if the data you are backing up already has errors.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

I believe the case you are worried about is the one where there is a failed write that the drive does not report. This is a critical failure of a drive, so manufacturers strive to make sure it never happens. The storage stack is built on the assumption that the terminal storage device will report both read and write errors.

I have seen some specialist systems perform a read immediately after a write to ensure the data really was comitted, but not in the last 10 years.

To answer your question, neither RAID handles the stated error better than the other.

Where they do differ is handling write errors reported by the device. R5 reponds in a vendor specific way; it could re commit the most recent write with parity compute. With R1 the mirror pair that did not return a write error can be assumed to be correct, and that one block copied from the good member to the bad member.

share|improve this answer

Neither can record from write errors unless the RAID vendor is doing some sort of checksum process. RAID is to prevent against disk failure. In RAID 5 when a disk is replaced the parity information is used to rebuild the missing data. In a RAID 10 when a disk is replaced the data is copied from the partner disk.

As to if RAID 10 can support more disk failures, it can depending on which disk fails second. RAID 10 is basically a bunch of RAID 1 array's striped together. If the second disk that fails is the partner of the first one which failed (which is possible if the first disk failed because of a hotspot of data) then you'll loose all the data when the second disk fails because the stripe is now broken. Where with RAID 5 is any disk fails as the second disk you've lost the array.

In either case backups to tape are mandatory for anything that you can't afford to loose.

share|improve this answer
1  
+1 for tape backups being mandatory. –  user3914 Sep 10 '11 at 7:58
    
Thank you for taking the time to respond, however I didn't say anything about tape backups in my post. Data integrity and data backup are two different concepts. You can make all the tape backups you want to, but they are all useless if the data that they are backing up already has errors. Additionally, I understand what RAID 10 is regards to disk failure. I'm asking about data integrity, not disk failure. They are two different concepts. I'm well versed in the various disk failure scenarios as well as appropriate data backup procedures. Not what I'm asking about, sorry. –  AaronLS Sep 11 '11 at 3:56
1  
Data integrity problems and disk failures go hand in hand. If you've got a RAID 1 mirror and you've got a 0 on one disk and 1 on another odds are you have a problem with a disk that is going to fail and the disk said it got the value but it wrote the wrong value to the platter. If bad data was sent to the disk from the OS the data will be wrong on both disks and there would be no way for the disks to know there was a problem. –  mrdenny Sep 11 '11 at 5:35
    
Disks have a rating that indicates the error rate per number of bytes written. It is possible to have write errors without a hard disk failure. Additionally, leading up to the hardrive failure ifthat is the case, the issue of data integrity is still seperate. If you handled a stock trading transaction and recorded that transaction as a row to a table stored on a RAID 5 or 1 array, and the hardrive experiences one of these write errors, You are dealing with a data integrity problem that can cast doubt on the validity of your transactional system. –  AaronLS Sep 12 '11 at 9:10
    
This scenario doesn't involve a harddrive failure. So one issue at hand is whether or not the error is detected at the time of the write error or at the time of the read error. In other words, after a write, does the raid controller verify the write by reading the results to verify they match or parity checks. I will clarify that I am not concerned about the "OS sends wrong data" scenario. –  AaronLS Sep 12 '11 at 9:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.