Outils pour utilisateurs

Outils du site


issue79:labo_linux

Ceci est une ancienne révision du document !


When the 1 terabyte hard drive in my wife’s PC failed almost 2 years ago we bought a 2 terabyte hard drive to replace it. We were very fortunate because 2 terabyte hard drives were at an all time low price and our 1 terabyte drive hadn’t completely failed yet (smart reported errors) so we were able to copy all the data over to the new hard drive. Even if the drive had completely failed we had regular backups of her most important data. Although we had backups, it was still several days before I was able to buy a new hard drive from our favourite computer store.

Ever since that drive failure I intended to investigate RAID, Redundant Array of Independent Disks. The key for us is redundancy, if one hard drive fails, we want the system to keep humming until we have a replacement drive.

Before looking into RAID I knew a few things about RAID: it involves multiple hard drives, sometimes the drives are used in a stripe, combined together for more space and speed, and sometimes for redundancy, when one drive mirrors the contents of another, and sometimes a combination of both. I also knew that there were several levels of RAID, RAID 0, 1, 2, 3, 4, 5, 6, and nested RAID levels (0+1/10, 100, 30, 50 and 60).

What I didn’t really know was that RAID is not a backup solution. It’s true that when you mirror a drive you do get an identical copy of the drive, but therein lies the backup problem - if you accidentally delete a file from one drive it’s gone from all mirrored drives. If you really want a backup, RAID by itself isn’t going to help you retrieve lost data.

I also wasn’t sure about was which level to use, disks to buy, or how to best implement RAID. Luckily the organization I work for has a great sysadmin I can bug from time to time (thanks Paul!). If there’s one lesson I can impart: plan your RAID array before buying equipment. In our case we already had the computer the RAID array would go in, but I wished we had other equipment as I was building the array.

I borrowed 4 x 250GB Seagate STxxxxxx drives from work to as a test before going out and shelling out lots of money for 4 new drives. As I went to put the drives into the computer I ran into 2 issues: even though there were lots of drive bays the case felt cramped and the new power supply I bought didn’t have enough Serial ATA ends to power all the drives plus the SATA Blueray drive.

All four hard drives fit into the case, however the top drive was getting dangerously close to blocking the SATA headers on the motherboard. When connecting the SATA power connectors it felt like there wasn’t enough space between drives. I’ve seen my fair share of broken SATA connections on both hard drives and optical media and the cramped nature of the power connections made me think that over time the drive power headers might break. The case I was working with was a mid-tower sized case but it really felt like I should have bought a roomier gaming case with a bit more space both horizontally and vertically.

It also dawned on me that I might not have enough SATA data headers on the motherboard, I had 4 hard drives plus a SATA Blueray drive, requiring 5 headers (luckily the board had enough). Some motherboards might only have a couple of SATA headers, so check before you buy a bunch of drives. If you don’t have enough drives you can always buy PCI or PCIe SATA card, though if you’re going to buy an expensive card you might look at a cheaper NAS box (at least for home) since the price is almost the same as an expensive RAID card.

My wife doesn’t like to wait on her computer, so while redundancy was important speed was also equally important - I couldn’t have the RAID array slowing down her system. RAID 0, known as striping, stripes your data across multiple drives giving you better performance, but it provides no mirroring of data or parity error checking. If one drive in a RAID 0 configuration dies your entire stripe is rendered useless, thus RAID 0 really isn’t RAID (redundancy). Because we want redundancy we also need to mirror the drive. RAID 1 provides mirroring, but no parity error checking and no striping. In a RAID 1 configuration as long as you have 1 good drive functioning the RAID array will continue to function.

For this month we’ll be creating a RAID 10 configuration (RAID 1+0), we’ll mirror a couple of striped drives (250GB+250GB=500GB) to another set of drives. Although we’ll be using 1TB of drives only 500GB will be available to us. RAID 10 needs a minimum of 4 drives (Linux can do RAID 10 with only 2 drives using the Linux MD driver, but this isn’t official “industry standard” RAID 10), 2 get striped together and the other two mirror the data.

When I started connecting up all the drives I noticed RAID features in the motherboard BIOS. Initially this was how I thought I’d set up the RAID array. Having lived through software replacements of hardware (winmodems, video cards stealing from motherboard RAM, etc) I’ve always subscribed to the idea that a hardware solution is better than a software one. I didn’t really want to go out and buy a couple of hardware RAID controllers for home because good hardware RAID controllers are costly and you need an identical controller for backup (even revision matters) if one fails. After spending a bunch of time fiddling with the RAID BIOS I did a bit more research and found a lot of advice against using motherboard RAID. Some research suggested that if the motherboard dies you lose your data, other research said it might be possible to recover the data using an identical board but indicated most motherboard RAID took more cycles away from your CPU than dedicated RAID hardware.

Ultimately I decided to use the Linux software MD-RAID setup. While it also draws cycles from the CPU it’s less expensive to implement and easier to recover (buying an identical motherboard would have been pretty difficult since the motherboard I’m using is no longer manufactured).

TO BE CONTINUED….

issue79/labo_linux.1390303537.txt.gz · Dernière modification : 2014/01/21 12:25 de andre_domenech