RAID is Redundant Array of Inexpensive disks, used for high availability and reliability in large scale environments, where data need to be protected than normal use. Raid is just a collection of disks in a pool to become a logical volume and contains an array. A combine drivers makes an array or called as set of (group).

RAID can be created, if there are minimum 2 number of disk connected to a raid controller and make a logical volume or more drives can be added in an array according to defined RAID Levels. Software Raid are available without using Physical hardware those are called as software raid. Software Raid will be named as Poor man raid.

Setup RAID0 in Linux

Main concept of using RAID is to save data from Single point of failure, means if we using a single disk to store the data and if it’s failed, then there is no chance of getting our data back, to stop the data loss we need a fault tolerance method. So, that we can use some collection of disk to form a RAID set.

What is Stripe in RAID 0?

Stripe is striping data across multiple disk at the same time by dividing the contents. Assume we have two disks and if we save content to logical volume it will be saved under both two physical disks by dividing the content. For better performance RAID 0 will be used, but we can’t get the data if one of the drive fails. So, it isn’t a good practice to use RAID 0. The only solution is to install operating system with RAID0 applied logical volumes to safe your important files.

RAID 0 has High Performance.

Zero Capacity Loss in RAID 0. No Space will be wasted.

Zero Fault Tolerance ( Can’t get back the data if any one of disk fails).

Write and Reading will be Excellent.

Requirements

Minimum number of disks are allowed to create RAID 0 is 2, but you can add more disk but the order should be twice as 2, 4, 6, 8. If you have a Physical RAID card with enough ports, you can add more disks.

Here we are not using a Hardware raid, this setup depends only on Software RAID. If we have a physical hardware raid card we can access it from it’s utility UI. Some motherboard by default in-build with RAID feature, there UI can be accessed using Ctrl+I keys.

If you’re new to RAID setups, please read our earlier article, where we’ve covered some basic introduction of about RAID.

My Server Setup

This article is Part 2 of a 9-tutorial RAID series, here in this part, we are going to see how we can create and setup Software RAID0 or striping in Linux systems or servers using two 20GB disks named sdb and sdc.

Step 1: Updating System and Installing mdadm for Managing RAID

1. Before setting up RAID0 in Linux, let’s do a system update and then install ‘mdadm‘ package. The mdadm is a small program, which will allow us to configure and manage RAID devices in Linux.

# yum clean all && yum update
# yum install mdadm -y

Install mdadm Tool

Step 2: Verify Attached Two 20GB Drives

2. Before creating RAID 0, make sure to verify that the attached two hard drives are detected or not, using the following command.

# ls -l /dev | grep sd

Check Hard Drives

3. Once the new hard drives detected, it’s time to check whether the attached drives are already using any existing raid with the help of following ‘mdadm’ command.

# mdadm --examine /dev/sd[b-c]

Check RAID Devices

In the above output, we come to know that none of the RAID have been applied to these two sdb and sdc drives.

Step 3: Creating Partitions for RAID

4. Now create sdb and sdc partitions for raid, with the help of following fdisk command. Here, I will show how to create partition on sdb drive.

34 Responses

We are facing serious issue with RAID-0, we have created RAID-0 using your article in our Production environment. Now the scenario is our RAID-0 disks / mount point got 100% utilized and we want to extend the same RAID-0 volume.

I have tried to extend the existing RAID-0 array by adding new disk to server. And uses your article Grow Raid Array in Linux to extend the RAID array, but it got failed and it converted existing RAID-0 to RAID-4 and gone in to inactive state.

Also one of the existing disk got out of RAID-0 array and giving error “mdadm: /dev/md0 is not an active md array – aborting“.

I do have error screenshot file. Please let me know on which email ID I should send to you.

Important : Please help to learn us, how to extend existing RAID-0 array in Linux.

Hi Manoj, I am having the same scenario. I have created a raid 0 setup with 2 disks of 50 GB, now disk has been utilized to 100%. Can you please help which document to follow to add new disks in raid array so that my data will be intact

Is it possible to monitor RAID0 failover events. I set-up RAID 0 on a test environment with 2 disks of 1 GB each. Then i removed one of the disk of the disk on a running system. But still I am able to work properly on my RAID 0 filesystem of 2 GB i.e. I am able to create a new file of 2GB.

Although I have monitor mode setup via mdadm but i believe thats not gonna work as the man page suggests “Monitor one or more md devices and act on any state changes. This is only meaningful for RAID1, 4, 5, 6, 10 or multipath arrays, as only these have interesting state. RAID0 or Linear never have missing, spare, or failed drives, so there is nothing to monitor.”

So id there there any other way by which whenever a RAID0 disk fails we can get an alert of corruption message while doing anything on filesystem.

Please try to stop the RAID set md0
Then reset the superblock for sdb1
Remove the partition and recreate it.
Please go through other RAID topics you will find the solution which i have provided in comments.