Skip to Content

How to Install Ubuntu Server 16.04 on a Software RAID 1 (Mirror)

It’s pretty straight forward installing an operating system on hardware RAID, but what if you want to use software RAID? In this tutorial, you’ll learn how to install Ubuntu Server 16.04 using the built in software RAID.

Starting the Installation

Begin the installation by booting up the Ubuntu Server DVD or USB and then following the wizard through to the Partition disks screen.

Partitioning the OS Disks

In the following steps we will create two identical partition layouts on each physical disk. In the example below the server has 8 GB of RAM, therefore the swap partition will be 8 GB and the root partition will use the remaining space.

Step 1: Select Manual for the Partitioning method and then press Enter.

Step 2: In the following image there are 6 hard disks, the first two disks are the same size and we will install the operating system on them using software RAID 1. Select the first hard disk labeled SCSI33 (0,0,0) (sda) and then press Enter.

Step 3: Select Yes and then press Enter to create an empty partition on the first disk.

Step 4: Repeat steps 2 and 3 for the second hard disk labeled SCSI33 (0,1,0) (sdb).

Step 5: Select the FREE SPACE option of the first hard drive and then press Enter.

Step 6: Select Create a new partition and then press Enter.

Step 7: Enter 13.5 GB for the first partition, select Continue and then press Enter. This will leave 8 GB of free space for our swap partition.

Step 8: Select Primary for the type of partition and then press Enter.

Step 9: Select Beginning for the location of the new partition and then press Enter.

Step 10: Make the partition bootable by selecting the Bootable flag option and then pressing Enter.

Step 11: The bootable flag option should now say On. Select Done setting up the partition and then press Enter.

Step 12: Select the remaining FREE SPACE of the first drive and then press Enter.

Step 13: Select Create a new partition and then press Enter.

Step 14: Select Logical for the partition type and then press Enter.

Step 15: Enter 8 GB for the partition size, select Continue and then press Enter.

Step 16: Select the Use as option and press Enter.

Step 17: Select swap area and then press Enter.

Step 18: Select Done setting up the partition and then hit Enter.

Step 19: You should now see the two created partitions for the first disk.

Step 20: Repeat steps 5 to 19 for the second disk. You should see the following partition layout:

As you can see in the image above we now have 2 disks with identical partition layouts. We are now ready to configure Ubuntu software RAID.

Configure Software RAID

Now that we have created the same partition layout on both disks we need to configure software RAID1 so that the data on both partitions is mirrored. This will prevent the operating system from crashing should a drive fail.

Step 1: Select the Configure software RAID option and then press Enter.

Step 2: Select Yes to write the partition changes to the disks and then press Enter.

Step 3: Select Create MD Device and then press Enter.

Step 4: Select RAID1 (mirroring) and then press Enter.

Step 5: Leave the number of active devices for the RAID1 array as 2, select Continue and then press Enter.

Step 6: Set the number of spare devices to ****, select Continue and then press Enter.

Step 7: Select the two root partitions from each hard drive by pressing SPACE, select Continue and then press Enter.

Step 8: Confirm the changes and setup RAID1 on the root partition by selecting Yes and then pressing Enter.

Step 9: Repeat steps 3 to 8 to create the RAID1 mirror for the swap partition. Once finished, select Finish and then press Enter.

Step 10: Select the first 13.5 GB partition on the RAID1 device then press Enter.

Step 11: Select Use as and then hit Enter.

Step 12: Select Ext4 Journaling file system then press Enter.

Step 13: Select Mount point then press Enter.

Step 14: Change the mount point to the root file system then press Enter.

Step 15: Select Done setting up the partition then press Enter.

Step 16: Select the 8 GB swap partition on the RAID1 device then press Enter.

Step 17: Select Use as and then hit Enter.

Step 18: Select swap area and then press Enter.

Step 19: Select Done setting up the partition then press Enter.

Step 20: Select Finish partitioning and write changes to disk, then press Enter.

Step 21: Select Yes and then press Enter to write the changes to disk and kick off the copy process.

Step 22: Wait for the files to be copied to the hard disk, then proceed to the next step to finish the installation.

Finish Installation

Follow the rest of the wizard until the installation is complete. Once finished, eject the installation media and power on the system.

Ubuntu Server 16.04 should now be installed and running on a redundant RAID 1 mirror.

If you’re feeling adventurous, you can pull out one of the hard disks while the system is running and make sure Ubuntu Server does not crash.