What is RAID and How To Configure Software RAID ?

Started by Dipak Bhoi, February 21, 2014, 06:34:53 PM

Previous topic - Next topic

Dipak Bhoi

Hello guys,

What is RAID ?
RAID stands for Redundant Array of Independent Disks.
A redundant array of independent disks, or RAID, is a way of storing the same data in different places on multiple hard disks. A physical drives are said to be in RAID which is accessed by the operating system as on single drive.
Below are the different kinds of a RAID that are used today.

1) RAID 0
2) RAID 1
3) RAID 4
4) RAID 5
5) RAID 6
6) RAID 10

                                                      Lets start with RAID 0

RAID 0 is also popular as disk striping. In this type the data has been save in particular format of two  stripes fromat on two different hard disk. By this the increased the speed of I/P and O/P operations and performance of system, but there is a big disadvantage, if one disk would be failed, causes loss of all data.

                                                 Requirement for configuring RAID 0

RAID 0 requires at least two RAID partitions. No matter these on same disk or different disks. By configuring this you can put data on multiple storage devices. To configure it we use following command in RHEL 6.

Command used - mdadm
The name is derived from the md ( multiple devices ) device node it administers or manage.
Just go to your system and fire the command as below.

Quote#mdadm --create /dev/md0 --level=0 --raid-devices=3 /dev/sda1 /dev/sdb1 /dev/sdc1
After running this command it will asked you for confirmation, Just type Y and press enter. It will show the message like " mdadm: array /dev/md0 started ". You can also see the detail information about this partition by below command. It will show the information like how many partition be used to make it.
Quote#mdadm --detail /dev/md
To use this RAID partition, you have to format and mount it. Below are the steps to fromat and mount the partition.

Quote#mkfs.ext4 /dev/md0
#mkdir /RAID
#mount /dev/md0 /RAID
#mount
You will get the output as below.
Quote/dev/md0 on / RAID ext4

How to Destroy RAID 0 ?

To destroy the RAID 0 you have to first unmount it and then stop it.
Quote#umount /RAID
#mdadm --stop /dev/md0
mdadm: stopped /dev/md0
Quote#mdadm --detail /dev/md0
mdadm: cannot open /dev/md0: No such file or directory

                                                        [ Confirgure RAID 1 ]

RAID 1 is also known as disk mirroring. To configure this you have to at least two disk and you can also add a spare disk if you want. In RAID 1 whatever the data which kept as mirror format in other disk. Mean whatever the you write and make change it also performed on other disk.  It is easy to configure and If one hard disk would failed, only then you also access the data from other hardisk. Its provide the data reliability  and improve performance.
The storage capacity of the level 1 array is equal to the capacity of the smallest mirrored hard disk in a Hardware. Consider you have a two hard disk first with 200 GB capacity and other is 100 GB capacity then you will get the 100 GB  of available space. To create it, command is same as used above.

Quote#mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sda1 /dev/sdb1

It will show the message like " mdadm: array /dev/md0 started ". After that follow the steps as mentioned above. Format the RAID, make directory, mount the partition.

Quote#mkfs.ext4 /dev/md0
#mkdir /RAID1
#mount /dev/md0 /RAID1

b]How to Destroy RAID 1 ?[/b]

To destroy the RAID 1 you have to first unmount it and then stop it.
Quote#umount /RAID1
#mdadm --stop /dev/md0
mdadm: stopped /dev/md0
Quote#mdadm --detail /dev/md0
mdadm: cannot open /dev/md0: No such file or directory

                                                        [How to Confirgure RAID 5 ]

RAID 5 is also called as " Disk Striping with Single Distributed Parity ". It provide the Fault tolerance as well as also increased the Input and Output operations.
In Disk Striping with Single Distributed Parity, suppose you have disk1, disk2, disk3, and disk4. It store the parity information in 3rd hard disk. You can see in picture disk 1a, 1b an 1c same as 2a, 2b and 2c's  of the data is going to stripe format on these hard disk. And parity of these three hard disk data saved on 4th hard disk.
Like as same the datas parity of 4th, 3rd and 2nd hard disk saved on 1st hard disk means in Distributed way it will save. Means parity will be used for all hard disk. All the disk you will use from that drain will be -1.
Ex: If you are using four hard disk then available hard disk would be the equivalent of three.



Now you have to configure RAID 5. Before configure it you have to make the four partition on these disk.
Ex. Make partition as /dev/sda1 on 1st, /dev/sdb1 on 2nd, /dev/sdc1 and sdd1 on 4th hard disk.
We used same command to create the RAID 5. ie mdadm .

Quote#mdadm --create /dev/md5 --level=5 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
You will get the message " mdadm: array /dev/md5 started ".

Now,
Quote#mkfs.ext4 /dev/md0
#mkdir /Raid5
#mount /dev/md5 /Raid5

To destroy the RAID 5
Quote#umount /Raid5
#mdadm --stop /dev/md5
mdadm: stopped /dev/md5
Quote#mdadm --detail /dev/md5
mdadm: cannot open /dev/md5: No such file or directory

                                                       [How to Confirgure RAID 6 ]

RAID 6 is known as " Disk Striping with Single Dual Distributed Parity ". To create it you need at least 4 disks. We will place the parity on two disk, benefit of it is if two hard disk would be failed then also you can able to retrieve your data. It also faster the read-write operations, also provide the redundancy and fault tolerance. If you are using four hard disk then available hard disk would be the equivalent of two.



To create RAID 6,  Please check the partition is available or not, if not then create them first and then run the following command.

Quote#mdadm --create /dev/md --level=6 --raid-devices=4 /dev/sda2 /dev/sdb /dev/sdc3 /dev/sdd4
You will get the message " mdadm: array /dev/md6 started ".

To use RAID 6, format and mount it.

Quote#mkfs.ext4 /dev/md0
#mkdir /Raid6
#mount /dev/md6 /Raid6

To destroy the RAID 6
Quote#umount /Raid6
#mdadm --stop /dev/md6
mdadm: stopped /dev/md6
Quote#mdadm --detail /dev/md6
mdadm: cannot open /dev/md6: No such file or directory

                                                        [How to Confirgure RAID 10 ]

RAID 10 is a combination of RAID 0 and RAID 1, RAID 1 use for mirroring two disk and the we implement the RAID 0  on it.











MilesWeb - 30-Day Money Back
cPanel Web Hosting - cPanel Hosting in India
Grab a Free SSL for your website.  WordPress Optimized Solution.