There is a lot of information on how to configure a RAID 5 setup in Ubuntu Server out of there in the Internet, but somehow I had a hard time finding an easy to follow tutorial when I was setting up  the server this blog is currently running on.  the server is a high end PC, and even though the computer already comes with a BIOS RAID setup utility,I chose to use the Ubuntu Server RAID software, because it has more capabilities. one of the important things to keep in mind while setting up a RAID in Ubuntu is:

Ubuntu cannot boot from a RAID 5 partition.

so you need to create at least two partitions to install Ubuntu. one with either RAID 0 or RAID 1 for the operating system and the other with RAID 5 for the file directory.

on this tutorial I will use a VM with 5 small virtual disks for a RAID 1 and RAID 5 setup. please remember that in Ubuntu you can add partitions to a RAID as well, so you don’t necessarily have to have 5 physical drives for this setup. as long as you have a big hard drive, you can slice it into partitions to configure the RAIDs.

without further talks, let’s jump in.

fire up your Ubuntu Server. the initial windows will come up:

image

choose your language and hit Enter.

the installation Server wizard windows will pop-up:

image

Press the enter key on your keyboard. choose your language again in the following Window:

image

then choose your country:

image

choose NO on the keyboard layout detection:

image

choose the right settings for your keyboard on the following two windows:

image

the keyboard detection, and other component scanning window will show up:

image

choose a hostname for your server on the following window:

image

choose your time zone:

image

the partition manager will come up. choose Manual :

image

Choose the first partition on the list and press Enter:

image

the following warning will come up. choose Yes.

image

The new created partition will show up as free space on the next window:

image

Select the partition and press the Enter. the create a new partition window will come up:

image

press Enter again. type the size for the partition. in this case, it is the entire disk:

image

click  on continue. and choose Primary on the partition type:

image

click on Done setting up the partition on the following window:

image

do the same thing we just did for the rest of the drives. once you have all the drives partitioned. they should look like this:

image

select Configure Software RAID on the top menu:

image

say Yes on the following warning:

image

the changes will be written to the disk:

image

after that, the Software RAID configuration window will come up:

image

select Create MD device. and press Enter.

we will create the RAID 1 drive first. choose RAID1 on the following menu:

image

choose the number of drives on the following window. RAID1 needs 2 drives, so enter the number 2 and click on continue:

image

enter 0 for spare devices on the following window, and click on Continue.

image

choose the drives on the following menu. only choose 2 for RAID1 by using the down arrow key and the space bar. after the two drives are chosen, click on Continue:

image

Say Yes to the following warning:

image

by now, the RAID 1 configuration should be completed. Now let’s setup the RAID 5. click on Create MD configuration again:

image

choose RAID5 on the following window, and hit Enter.

image

choose the number of disks on the following window.  choose 3. and click on Continue.

image

put 0 as spare drives. and click Continue.

image

choose the disks you want to configure. choose the 3 disks and click on Continue.

image

click yes on the following warning:

image

that’s it. we have completed the RAID setup on Ubuntu. click on Finish.

image

now you should have two partitions available on your Ubuntu server. one for 10 GB ( mirrored RAID1 drive ) and 21 GB the RAID 5 partition.

image

lets setup the installation now. select the first 10GB partition, and hit Enter.

on the following window. select use As: and hit enter. on the list choose the first option. Ext4 Journaling File System and hit enter again:

image

then select Mount Point and choose / – the root file system and click enter again:

image

choose Done setting up the partition on the below menu:

image

do the following to setup the 21GB RAID 5 partition, but instead of choosing the / mount point, choose /Var for the mount point. if you are using the server for web hosting apache WWW directory is at the /Var directory. you make your own decision to what directory you assign the RAID 5 partition.

after you’re done with the partitions setup. click Finish partitioning and write changes to disk on the menu below:

image

from here on continue the installation of Ubuntu as usual.

after finishing the installation. you should have a fully functioning Ubuntu server with RAID1 for the boot partition, and a RAID 5 for the /Var file system:

image

I hope this tutorial gives you an idea on how to setup a RAID on Ubuntu server. please if you have a question or suggestion use the comment section below.

take care. Nelson.

9 thoughts on “How To Configure RAID 5 On Ubuntu Server

  1. First, thanks for writing such a concise how-to. Now a question. If you were going to set up your raid 5 drives so that some windows users could access it, would you still use ext4 or would you go with something else. Some of the files will be really large (movie files for a HTPC) so I was wondering how you would handle that. I know that SAMBA will have to be installed, but I was wondering if the HTPC would be able to see/use the files if they were on a ext4 disk. As you can tell I am a new too Ubuntu/linux (noob alert!) so any guidance you could give would be much appreciated. Thanks again

    Reply
    • Hi Peter, thanks for your comment. yes, definitively you should not have any problem with formatting your Ubuntu drives with ext4 partitions and then use SAMBA to share files from this Linux box with Windows users.. SAMBA should take care of that.

      let me know how it goes.
      cheers,
      Nelson.

      Reply
  2. I’m a little confused. If i have 6-1TB drives i have to sacrifice 2TB just for the operating system, so that leaves my raid5 with 3TB instead of 5TB? Am i understanding this correctly?

    Reply
    • Hi Chris, no, just create a separate partition for the operating system. for example, if you have 6 1TB drives, then from one drive create a 20GB partition( or whatever size you want ) then add the rest of the drive to your RAID-5 configuration. if you have a spared small drive, use that to install the operating system, and use the 6 1TB drives for the RAID.

      Reply
  3. Thanks for this post. Just want to know if it possible to have the whole 0S on a raid 5.. or do I have to first create a raid 1 (for the root partition) and then a raid 5 on the rest.. I have 8 146GB disks

    Reply

Leave a reply

required

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