How to Create a Software RAID 0 on Ubuntu 16.04

storage_raid_00_desktop

In this article, we will guide you how to configure RAID 0 Array using the ‘mdadm’ utility on ubuntu 16.04. The ‘mdadm’ is a utility which is used to create, manage and monitor software RAID devices. The administrators are having a great flexibility in managing the individual storage devices and creating the logical storage with a high performance and redundancy.

RAID 0, also known as disk striping, your data will be spreads across all the disk drives in a RAID group, the benefit of RAID 0 is that it improves performance but there is no redundancy and all data will be lost if one of your disk has problem.

Prerequisites

This article assumes you have at least basic knowledge of linux, know how to use the shell, root user or non-root user account with sudo privileges set up on your server.

Minimum two storage devices for creating RAID 0 storage.

Step 1 – Check harddisk

To find the attached storages in the machine, we can use the below command.

As we can see in the above output we have 2 disks without any filesystem with 40GB and the devices are named as /dev/xda and /dev/xdb

Step 2 – Creating the Array

For creating the RAID 0 array, we will use the ‘mdadm’ – create command with the device name we want to create and the raid level with the no of devices attaching to the RAID.

We will use the ‘mdadm’ ultility for creating the RAID 0 array, create array using disk named /dev/xda and /dev/xdb using this command below

it will take some time to complete the configuration, we can monitor the process using command below

In the above output, we can see the /dev/md0 device is being created with RAID 0 using the /dev/xda, /dev/xdb  storage devices.

Step 3 – Creating and Mounting the Filesystem

After raid 0 has been created successfully we need to mount the raid device.

Before we can mount the device we need to create filesystem on the array /dev/md0

We will now create a mount point and attach the new RAID disk.

Verifying the new mount point or RAID disk

You can see the new filesystem is mounted and accessible at /mnt/raiddisk1

Now we can scan the active array and append the file with the below command

We needed to update the ‘initramfs’ file so that the RADI array will be available when the machine get started with the boot process.

Adding the RAID array to mount automatically at the boot time.

Add the below line to the /etc/fstab.

Congratulations,  you have successfully Create a Software RAID 0 on Ubuntu 16.04

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *