Protecting my data using RAID 5

Way back at the end of March I read a post on Duane’s blog about RAID 5 – Raid 5 & Cheap Storage – and I remember thinking at the time that it was a great idea. However, I didn’t really have any ‘spare’ cash to pick up some extra drives to implement it in my server. I made a mental note to come back to it when time / money permitted.

For some reason, the topic came up at work the other day and a guy I work with seemed pretty keen to get this going at his place. He went out and picked up a couple more 500 GB drives (he already had one), found a quick guide on the internet and set it up himself. After talking with him about it for a little while, it seemed way too easy to not do it myself. The only problem, of course, was that I still didn’t have any extra drives and money is tighter these days since Amy is on maternity leave. Luckily, this same guy at work happened to have a couple of extra 160 GB drives ‘laying around’ since he just purchased two new 500 GB drives. That worked out perfect because I had a 160 GB drive myself to make the three that I needed. I purchased the two drives, for a good deal, and went to work last night setting everything up.

I followed this guide pretty much to the letter. One thing I will note is that using GParted to set up the partitions and ‘format’ the drives takes forever! After every operation it has to scan all devices, and that took a really long time on my system. Of course my system only has a Celeron 1.2 GHz processor with 512 MB of RAM so… I also ran into some issues using GParted to create the partitions at first. The two drives I got from the guy at work had been in a mac previously, and GParted didn’t seem to want to delete the old partitions on them for some reason. I ended up using fdisk to accomplish that.

Once I got through the inital setup of the RAID array, I wanted to simulate a failure so that I’d know how to handle it if/when it happens in the future. I did this by following the instructions here. Once I manually failed a drive, I got the following email from my server:

This is an automatically generated mail message from mdadm running on HsWeb

A Fail event had been detected on md device /dev/md0.

Faithfully yours, etc.

P.S. The /proc/mdstat file currently contains the following:

Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid5 sdb1[0] sdd1[3](F) sdc1[1]
312576512 blocks level 5, 64k chunk, algorithm 2 [3/2] [UU_]

unused devices:

Sweet! It’ll be painfully obvious when a failure occurs. After testing the failure, I removed the drive from the array and then re-added it and the recovery process is currently under way (13.9% complete as of right now). It’s taking a while to do it, will probably be over 2 hours by the time it’s done, but while that is going on, the array is still usable. In fact, I simulated the failure, removed the drive from the array, and then re-added it all while I have been streaming a movie to my TV that is stored in the array! I’m super happy with this. I just wish I had larger drives, but that can come later when I get a new case / motherboard / CPU for the server.

In the end, I’ve now got about 320 GB of redundant storage available on my server, which is double the non-redundant storage I used to have, so I’m pretty happy about that. I guess now I just play the waiting game… (waiting for a real failure to occur)

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>