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:
choose your language and hit Enter.
the installation Server wizard windows will pop-up:
Press the enter key on your keyboard. choose your language again in the following Window:
then choose your country:
choose NO on the keyboard layout detection:
choose the right settings for your keyboard on the following two windows:
the keyboard detection, and other component scanning window will show up:
choose a hostname for your server on the following window:
choose your time zone:
the partition manager will come up. choose Manual :
Choose the first partition on the list and press Enter:
the following warning will come up. choose Yes.
The new created partition will show up as free space on the next window:
Select the partition and press the Enter. the create a new partition window will come up:
press Enter again. type the size for the partition. in this case, it is the entire disk:
click on continue. and choose Primary on the partition type:
click on Done setting up the partition on the following window:
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:
select Configure Software RAID on the top menu:
say Yes on the following warning:
the changes will be written to the disk:
after that, the Software RAID configuration window will come up:
select Create MD device. and press Enter.
we will create the RAID 1 drive first. choose RAID1 on the following menu:
choose the number of drives on the following window. RAID1 needs 2 drives, so enter the number 2 and click on continue:
enter 0 for spare devices on the following window, and click on Continue.
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:
Say Yes to the following warning:
by now, the RAID 1 configuration should be completed. Now let’s setup the RAID 5. click on Create MD configuration again:
choose RAID5 on the following window, and hit Enter.
choose the number of disks on the following window. choose 3. and click on Continue.
put 0 as spare drives. and click Continue.
choose the disks you want to configure. choose the 3 disks and click on Continue.
click yes on the following warning:
that’s it. we have completed the RAID setup on Ubuntu. click on Finish.
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.
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:
then select Mount Point and choose / – the root file system and click enter again:
choose Done setting up the partition on the below menu:
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:
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:
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.
23 people found this helpful
23 people found this helpful