1

I'm putting together a cheap NAS box and I've read some articles about raid5 not being as robust as I'd imagined. I wanted to get some answers to the following questions before I proceed. I'm proposing the following setup: 1 disk for the OS, 3 disks for the array, Linux software raid to manage the array as raid 5, LVM on top to carve out partitions, some form of encryption on some partitions (probably encfs because I'm used to it).

With three disks managed as raid 5 under Linux, if there is a catastrophic failure of one of the disks and also an unrecoverable read error on another of the disks, is it possible to recover all data on the array apart from the block with the unrecoverable read error? Can I read from a raid array with one disk removed?

If there is a bad sector on one of the disks can I determine which disk that bad sector is on and recover the data from the other two disks?

If I encrypt the whole raid array does this change the answers to the above? My understanding of encryption is poor, but I thought that any error in encrypted data would have knock on effects on the rest of the data. I imagine this would depend on the encryption being used.

  • 1
    Just to be the pedantic one, someone has to say it: just remember that RAID is not backup when deciding how to design your solution. – phoebus Oct 21 '13 at 18:55
  • He phoebus, thanks for the input. I just want to get a feeling from the fault tolerance of raid5 so I can make a sensible decision. If I'm getting nothing or very little from raid5 then I'll choose to have 9TB rather than 6TB of storage. – Dom Oct 21 '13 at 19:00
  • For values of 1TB+, RAID 5 is not seriously a consideration. The risk of data loss is too high. – Michael Hampton Oct 21 '13 at 19:02
  • Maybe my original question was badly phrased but I'm trying to ascertain two things: how much data is at risk and what is that level of risk. – Dom Oct 21 '13 at 22:44
2

The short answer is yes, it depends, and yes. Depends. And, finally, you are correct, it depends.

I don't know where you read RAID5 isn't robust. It's more robust than using a 1 drive system; especially for the price-point. If you could afford a RAID10 (RAID1+0), then that's probably as good as you're going to get, unless you invest in some ridiculous configuration more expensive than you can afford. Then again, you could be a billionaire and can afford anything you wanted. Seeing as how you're opting for SOFTWARE RAID over HARDWARE RAID, I'm leaning towards no. There are arguments for both sides, but if you can, go hardware RAID.

RAID5 is great for redundancy and reliability. It uses block level striping and parity across all drives, so, in a 3-drive RAID5, the most damage that subsystem can endure is one failed drive. If there are read errors on the disk, it depends on the type of read error. If it's a bad block, meaning a bad drive, then, yes, you can still read the data, so long as it's just one drive acting up. If two drives are acting up, you might get lucky, but it's best to replace the suspect drive as quickly as possible.

If there is a bad sector on a disk, you can run normal disk checking utilities, just like a regular drive, but repairing bad sectors is tricky without causing problems for the RAID5 configuration. Usually, pulling out the drive and letting it auto-rebuild, will resolve most of your problems. If it doesn't, then you'll need to replace the drive.

Note: You are worrying way too much about failing sectors and bad bits. Unless you're using a bad batch of old IDE hard drives that you have to literally keep on ice to keep them from knocking, your likelihood of running into these issues is more paranoia than statistical anomaly.

Regardless of encryption, rebuilding the drive won't be a problem. The system will see the encrypted RAID5 subsystem like regular RAID5 subsystem, because it's the data that's encrypted, not the RAID5 configuration. However, if you use software RAID, and you encrypted the OS drive and the OS drive failed, then you'll have a problem.

Lastly, I suggest you read more about RAIDs to get a better understanding: Wikipedia Article

Note: RAID5 does have its limitations, and other RAID levels are better for other circumstances.

| improve this answer | |
  • Thanks for you detailed answer. You're absolutely correct about financial resources! My My paranoia is based on this article (zdnet.com/blog/storage/why-raid-5-stops-working-in-2009/162) by Robin Harris. If you loose a disk then the chance of getting an unrecoverable read error on one of the remaining disks when rebuilding is so high that the rebuild will fail and you'll loose your data. I've never had a disk completely fail in 15 years of self build experience with the cheapest components, but I do know a friend who had such a failure. – Dom Oct 21 '13 at 19:17
  • That article was from 2009 and you have to read all "news" articles with a grain of salt; they're written to grab attention, not always to tell the whole truth. There's risk in everything you do. You just calculate the chances of it happening against the cost of securing against that risk and figure out your own answer. Also, it's a matter of how much you use your drives vs the quality of the subsystem in place. Basically, you get what you pay for. I've lost a disk in RAID5 before and I've recovered without problems, because my RAID system was set up properly and I maintained it regularly. – CIA Oct 21 '13 at 19:23
  • What scenarios does RAID 5 protect me from and what scenarios doesn't it protect me from (apart from the obvious, multi disk failure)? – Dom Oct 21 '13 at 22:47
  • Isn't that a good enough reason? The Wikipedia covers benefits and pitfalls, too. – CIA Oct 22 '13 at 0:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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