Tutorial
Before continuing on, please be aware of this site’s CC BY-SA license and disclaimer. Both can be found at the bottom of this (or any other) page.
Pre-Installation
Multi-Disk Administrator
Before we get started, go back and read the above Caveat section if you haven’t already. If you loose data or hose your system it’s on you.
Now, once you understand and have accepted the risks we can continue on with the pre-installation steps. This guide assumes you already have three or more drives installed on your system that aren’t being used for booting or running your system. If this is not the case, then you’ll need to rectify this before you are able to continue on below.
First off, we’ll need to install the multi-disk administrators tool, or mdadm.
To do so click on the Applications menu on the top left of your system and go down and select Ubuntu Software Center. In the search field here type in
mdadm
wait a half-second or hit the Enter key and you should see a single entry for the
tool to administer Linux MD arrays (software RAID). If so, click on the Install button, enter in your user password if prompted, and wait for it to finish (if you don’t get it, double check your spelling and make sure you haven’t transposed any letters).
During the installation, you’ll be prompted to setup Postfix Configuration, unless you know you’re using this select
No Configuration
from the drop down list and hit Forward. This should be all you need to do apart from waiting for the installation to complete.
Gnome Disk Utility
Now that we have mdadm, or the multi-disk administrator installed we can fire up our nice little Disk Utility tool and continue with the Pre-Installation steps for our RAID 5 setup.
Disk Utility can be found under the System and then Administration menu toward the very top of the list.
Once you have this handy-dandy application up and running you should see a
screen similar to the one on right here. You’ll have different disks and controllers of course (different systems and all), but the general idea will be the same.
Take a few (or several) minutes here and get comfortable with the Disk Utility. Also, to be safe, you may wish to run the SMART tests on all the disks that you are planning to use for the RAID array (if not all of your disks).
Now, we have approached the point of no return, this is your last chance to turn back if you don’t have all your data backed up or if you might be in over your head.
If you’re still with me, and again, are happy to accept any consequences of moving ahead we will begin with formatting new partition tables on all of the drives that will be added to the RAID 5 array.
Select the first drive you’ll be using in your array, then towards the top left, below Drive click on Format Drive (not to be confused with Format Volume). You’ll be presented with a drop down list with four options, the option I strongly recommend using is the GUID Partition Table.
Note: The GUID Partition Table is the Master Boot Record’s replacement. It has several benefits over the MBR (such as supporting disk sizes in excess of 2TB), additional checksumming features, and is fully supported under Ubuntu. Your system and needs vary from mine, and you will have to decide or find out for yourself if there is any reason that you should currently not use the GUID Partition Table.
Once you have selected the GUID Partition Table from the drop down list, click on Format, last chance to turn back, if you’re solid click on Format again, put in your user password if prompted, and your drive will begin to format with a GUID Partition Table.
As this is happening, you can proceed to repeat the Format Drive process on the remaining drives you wish to use in the array. All three (or more) drives should be formatted with the same partition table before continuing on to the RAID 5 Installation section.

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!