Introduction
For this guide, I’ll be addressing not a neat application (at least not directly), but rather a neat way to potentially combine your existing storage solutions while also adding some protection from a catastrophic disk failure.
RAID 5, under Ubuntu 10.04 LTS (Lucid Lynx), will be the prime focus of this guide and we will make heavy use of the awesome Gnome Disk Utility tool (courtesy of Red Hat).
For those of you who do not know, RAID 5 allows you to combine multiple disks of the same size (3 minimum) into a single pool. The available storage is equal to the total disks minus the size of one disk. So, if you have three 2TB drives, you’ll have a total of 4TB available (combined into one “disk”) and, here’s the neat bit, you’ll be able to suffer the loss of a single drive, while not losing any of your data.
While I will be focusing on RAID 5 in this guide, the process should be almost exactly the same for RAID 6. Similarly, the other two RAID levels supported natively by Ubuntu, 0 and 1, will follow comparable steps as those listed below (and should, in fact, be much easier to setup).
While this guide was written for Ubuntu 10.04 LTS it should be much the same for Ubuntu 10.10 (Maverick Meerkat), 11.04 (Natty Narwhal), Linux Mint 9 (Isadora), 10 (Julia), and other Ubuntu variants like Kubuntu, Xubuntu, and Lubuntu (you’ll need to install gnome-disk-utility if it’s not already).
Similarly, other Gnome and Debian based distributions such as Debian Squeeze, aptosid, and LMDE should also be pretty close to the directions below.
Like my other guides, I will be sticking to the good ol’ GUI as much as possible, however with that said there will be some CLI usage in this one (more so than my others) and this is a more advanced topic, if formatting or partitioning your drive scares you, or you have no idea what that means you may want to hold off on this one for now.
(When in doubt, research, read through the guide completely first, and then do as you think best knowing that you’re the only one who is responsible if you mess up your system or loose your data.)
Caveats
Before we get started, there are some potential risks involved with this that one should be aware of. First off, it’s almost a cliche in some circles, but the fact is that RAID, of any level, is not a true back-up solution.
With that said, RAID (other than 0), does provide some additional measure of protection for your data. However, if your system is damaged in any way, be it fire, lightning, catastrophic file system error, or what have you, your RAID setup is not going to protect your data.
For true safety, a complete off site back-up is needed. Obviously, this may not be feasible, but it should be known before proceeding.
The second risk we need to examine is the possible risk of data loss while we construct or build the RAID array.
Any of the disks you want to use for the array will need to be wiped clean before they can be used. Further, if you need to shuffle data around your drives while doing this you could lose any of this data if something goes awry during this process.
If you are not willing to lose this data do not proceed. Hop on Newegg or Amazon and buy some additional disks and save yourself the hassle and heartache of losing large amounts of information.
The third risk to be aware of is that if more than one of your drives suffer a failure all of your data on the array will be lost. Not just the data of the two or more drives that failed. So, if you had an array with six disks, and two failed all the data on the remaining four disks would be lost.
With those few points addressed, if you are using quality hard drives, GUID partition tables, EXT4, and running Ubuntu 10.04 with the Gnome Disk Utility, there are many levels of protection already in place. GUID and EXT4 both have various checksum features in place. Ubuntu 10.04 is based on well tested software, and the Gnome Disk Utility continuously monitors your disks’ SMART status for potential failures.
If you were to also purchase a quality UPS, you should have a fair level of reliability and dependability in place. Again, this is not a replacement for a true off site back-up, but it is something.

How would you recommend testing the array? I’d like to make sure it’s capable of recovering from a (staged) single hard disc failure. Could you also tell me how to restore it?
Hi Ian,
This is something I plan to add to my next revision of the guide. Simply shutting down the system and unplugging one of the drives should simulate a failure. From there use the Disk Utility to attempt a restoration. I haven’t played around with this yet so I can’t offer concise advice but I have little doubt it’s straight forward. A virtual machine could also be used for testing as well.
Good luck!
Hey Ian,
Yeah, if you’re wanting to fully restore the array swap out the old drive and swap in a blank one and then add it to the array and restore it.
Take care,
Hello,
Thank you for the excellent guide. I do have a couple of questions which I hope that you might be able to answer for me.
Q1. At what point was Ubuntu installed?
I have followed your guide to the point of formatting the volume. I saw in your comments that you made the following comment:
“That’s right, if you format the array with a file system (Format Volume) you can begin to use the array now, however you will have zero redundancy, and even a single disk failure will cause you to loose ALL of the data on the array.”
On page 4 of your guide you go onto format the volume using EXT4, so I am a little confused.
I’m running an MSI K9N2GM/VM motherboard which has the ability to use the BIOS Raid 5, but following your guide plus a few other guides, I have turned the BIOS raid off.
I’m primarily running the Ubuntu 10.10 live cd, but am going to try again with 10.04 this afternoon.
The main problem I’m running into is that when I come to install Ubuntu, it complains about not being able to decipher the disk geometry.
I would be very grateful for your guidance. Once again, a great guide!
Many thanks in advance,
Jeremy Hannah
Hi Jeremy,
The guide assumes you already have an Ubuntu or Linux Mint operating system installed on a different drive and are using the RAID 5/6 array for archival/storage purposes (not as a boot drive).
I’m not sure what all problems you might run into with using this guide for a boot RAID 5/6 array as I’ve not tested or experimented with that. At very least you’d probably need to back-up your mdadm.conf file and import that into your new system.
At least part of the reason for going with the software RAID 5/6 setup was so that it was independent of the operating system, using the RAID array as the OS boot disk seems to, at least partially, defeat this purpose.
If you have any further questions please feel free to respond or email me directly, I’ll try to help out as best as I am able.
Take care!
daemox
I am following your guide for Linux Mint and would like to setup the RAID 5 for my os. Could you tell me what steps I would need in order to successfully setup a raid 5 instance?
Hi John,
The steps should be very similar.
I no longer run Linux Mint myself so I wont be able to give you a 1:1 guide.
As stated in my guide this really isn’t a novice user’s topic, (especially if problems arise down the line).
Best of luck to you though!
This was an awesome guide. Exactly what I had been looking for. I’ve been having some problems with the drives reporting that they are misaligned by XXXXXX (3072 bytes this time around) what gives? I have gone through this several times deleting the partitions on each drive and then reformatting the drives in GUID and recreating a RAID5. Can I ignore this, or what should I do different to start all over again.
Hi Hal,
Unfortunately, I’ve never ran into that issue so I’m unfamiliar with it. I’d recommend searching Google/Ubuntu/Linux Mint resources for answers. It may be related to your specific drives, or how they were partitioned. I honestly can’t say though.
Best of luck!
Hi there,
Thank you for this fantastic guide. It was very useful for me. I had a similar issue with misalignment. In my case it was due to the 4096 byte sector size of my 3TB drives. I was able to resolve it by using GNU parted prior to setting up the RAID. I used these instructions: http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html
I hope this helps.
Hi Ozgur,
I’m glad the guide worked out for you! Thanks for the note about the 3TB alignment as well. Unfortunately I haven’t gotten to play with 3TB drives yet so I’m currently unable to help with them. Happy you provided a link, cheers!
Hi :) This is not just an awesome guide. it’s absolutely amazing!! WOW! I’m quite new to Ubuntu and RAID and had absolutely no problem following the very simple but not over simplified steps and have now got 3x 2TB drives working in perfect harmony and auto-mounting at boot. I had Google’d for hours, trawling through complicated out of date guides that made me want to give up and shoot myself, and then I stumbled on this one. I would like to say a gigantic thank you to Daemox for all your time and effort on this guide, you deserve a huge pat on the back :) If anyone is reading this before they try and set up a RAID array and is unsure…don’t be, if I can do it then anyone can :)
Hi Daemox :)
I have a quick question…I recently installed 3x 2TB WD Green HDD’s on an ASUS M4A88T Evo Board with Ubuntu 11.04 running off a 30GB SSD and a SATA DVD drive. The SSD and one of the WD’s are showing up under the SATA controller (Disk utility) and the other two WD’s are showing up under the PATA controller! As I wrote earlier, the RAID 5 seems to work fine (thanks to your excellent guide) but I just wondered if you knew any reason why the two drives show up on the PATA controller rather than the SATA? They all use SATA leads and I haven’t used any jumpers or anything else to change the drives! Would really appreciate any thoughts :)
I have just read and used your XBMC guide too…eternally indebted ;)
Steve
Hi Steve,
I was about to respond to your other comment but I’ll throw it all together here.
Many thanks for the kind words, definitely appreciated. I’ve been a bit busy elsewhere recently, so this helps keep me motivated to keep my guides updated.
As for the controller oddity, it may come down to how your motherboard’s north and south bridge are setup. The two WD SATA drives may be going through a make shift SATA connection that uses the PATA chip on the south bridge to add a couple extra ports to the mother board.
If you’re worried you could use the benchmark utility in Disk Utility to see if there’s any performance impact on those two drives.
Anyway, I hope Ubuntu/Linux works out for you, and thanks again for the comments on my guides.
Best of luck and take care,
Hi, I’m back again ;)
After running my raid 5 array for a while on Ubuntu now I have encountered a whole heap of problems and have decided to give Suse 11 a go. I can see the three 2TB HDD’s and Suse tells me that they were in a Linux Raid, but I’m really unsure of how to re-assemble the array on Suse. The “Expert Paartitioner” seems like the right tool, but I don’t want to go in like a bull in a china shop and lose all the data on the array. Could you possibly point me in the right direction please :) Thanks in advance for any help or advice. Steve
Hi, I’m back again ;)
After running my raid 5 array for a while on Ubuntu now I have encountered a whole heap of problems and have decided to give Suse 11 a go. I can see the three 2TB HDD’s and Suse tells me that they were in a Linux Raid, but I’m really unsure of how to re-assemble the array on Suse. The “Expert Paartitioner” seems like the right tool, but I don’t want to go in like a bull in a china shop and lose all the data on the array. Could you possibly point me in the right direction please :) Thanks in advance for any help or advice. Steve
Hi again Steve!
Unfortunately, I have zero experience with RAID on SUSE. I haven’t even fired up a SUSE install in years. In Ubuntu 11.04 all that needs to be done now is to install mdadm and reboot. From there, the array will auto initialize and can be mounted manually or fstab can be edited to auto-mount it.
Sorry to hear you were having issues, but not sure if a distro hop is the best solution for you.
Cheers, and feel free to bounce ideas off me here or via email!