[null, {"document_url": "https://help.ubuntu.com/community/Installation/SoftwareRAID", "unformatted_src": "/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_00.png", "src": "https://help.ubuntu.com/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_00.png", "alt_text": "ubuntu_raid_00.png"}, null, {"document_url": "https://help.ubuntu.com/community/Installation/SoftwareRAID", "unformatted_src": "/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_01.png", "src": "https://help.ubuntu.com/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_01.png", "alt_text": "ubuntu_raid_01.png"}, null, {"document_url": "https://help.ubuntu.com/community/Installation/SoftwareRAID", "unformatted_src": "/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_02.png", "src": "https://help.ubuntu.com/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_02.png", "alt_text": "ubuntu_raid_02.png"}, {"document_url": "https://help.ubuntu.com/community/Installation/SoftwareRAID", "unformatted_src": "/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_03.png", "src": "https://help.ubuntu.com/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_03.png", "alt_text": "ubuntu_raid_03.png"}, null, {"document_url": "https://help.ubuntu.com/community/Installation/SoftwareRAID", "unformatted_src": "/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_04.png", "src": "https://help.ubuntu.com/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_04.png", "alt_text": "ubuntu_raid_04.png"}, {"document_url": "https://help.ubuntu.com/community/Installation/SoftwareRAID", "unformatted_src": "/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_05.png", "src": "https://help.ubuntu.com/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_05.png", "alt_text": "ubuntu_raid_05.png"}, null, {"document_url": "https://help.ubuntu.com/community/Installation/SoftwareRAID", "unformatted_src": "/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_06.png", "src": "https://help.ubuntu.com/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_06.png", "alt_text": "ubuntu_raid_06.png"}, null, {"document_url": "https://help.ubuntu.com/community/Installation/SoftwareRAID", "unformatted_src": "/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_06.png", "src": "https://help.ubuntu.com/community/Installation/SoftwareRAID?action=AttachFile&do=get&target=ubuntu_raid_06.png", "alt_text": "ubuntu_raid_06.png"}, null]
RAID is a method of using multiple hard drives to act as one. There are two purposes of RAID:

There are three ways to create a RAID:


Installing via the GUI

Install Ubuntu until you get to partitioning the disks Partitioning the disk

Warning: the /boot filesystem cannot use any softRAID level other than 1 with the stock Ubuntu bootloader. If you want to use some other RAID level for most things, you'll need to create separate partitions and make a RAID1 device for /boot.

Warning: this will remove all data on hard drives.

1. Select "Manual" as your partition method 2. Select your hard drive, and agree to "Create a new empty partition table on this device ?" 3. Select the "FREE SPACE" on the 1st drive then select "automatically partition the free space 4. Ubuntu will create 2 partitions: / and swap, as shown below: 5. On / partition select "bootable flag" and set it to "on" 6. Repeat steps 2 to 5 for the other hard drive

Configuring the RAID

Boot Loader

In case your next HDD won't boot then simply install Grub to another drive:

Boot from Degraded Disk

If the default HDD fails then RAID will ask you to boot from a degraded disk. If your server is located in a remote area, the best practice may be to configure this to occur automatically:

# Please provide URL to support claim: (this option is not supported from mdadm-3.2.5-5ubuntu3 / Ubuntu 14.04 onwards)

Verify the RAID


Swap space doesn't come up, error message in dmesg

Provided the RAID is working fine this can be fixed with:

Using the mdadm CLI

For those that want full control over the RAID configuration, the mdadm CLI provides this.

Checking the status of your RAID

Two useful commands to check the status are:

Example output:

From this information you can see that the available personalities on this machine are "raid1, raid6, raid4, and raid5" which means this machine is set-up to use raid devices configured in a raid1, raid6, raid4 and raid5 configuration.

You can also see in the three example meta devices that there are two raid 1 mirrored meta devices. These are md0 and md5. You can see that md5 is a raid1 array and made up of disk /dev/sda partition 7, and /dev/sdb partition 7, containing 62685504 blocks, with 2 out of 2 disks available and both in sync.

The same can be said of md0 only it is smaller (you can see from the blocks parameter) and is made up of /dev/sda1 and /dev/sdb1.

md6 is different in that we can see it is a raid 5 array, striped across three disks. These are /dev/sdc1, /dev/sde1 and /dev/sdd1, with a 64k "chunk" size or write size. Algorithm 2 shows it is a write algorithm pattern, which is "left disk to right disk" writing across the array. You can see that all three disks are present and in sync.

Replace * with the partition number.

Disk Array Operation

Note: You can add, remove disks, or set them as faulty without stopping an array.

1. To stop an array, type:

Where /dev/md0 is the array device.

2. To remove a disk from an array:

Where /dev/md0 is the array device and /dev/sda is the faulty disk.

3. Add a disk to an array:

Where /dev/md0 is the array device and /dev/sda is the new disk.Note: This is not the same as "growing" the array!

4. Start an Array, to reassemble (start) an array that was previously created:

ddadm will scan for defined arrays and start assembling it.

5. To track the status of the array as it gets started:

Known bugs

Ubuntu releases starting with 12.04 does not support nested raids like levels 1+0 or 5+0 due to an unresolved issue https://bugs.launchpad.net/ubuntu/+source/mdadm/+bug/1171945


Installation/SoftwareRAID (last edited 2015-09-12 06:06:22 by Matt)