How to Configure RAID-1 in Redhat Linux

Configuring RAID-1(Mirroring)

RAID-1 Mirroring means having the same data on both the hard-disks,i.e exact clone of the same data copied on both the disks.

Minimum Requirements to configure RAID-1:

1.Minimum 2 Hard-disks required(You can also add more than two disks 4,6,8 for that the server should have the RAID Physical adapter installed)

Advantages of RAID-1

1. Read performance is better than writing data to the hard disk

2.If one disk fails there is no data loss since we have the same data on both the disks.

3.50% of space will be lost,i.e if we have two disks with 250GB size total, it will be 500GB but in mirroring it will show only 250GB.

Configure RAID-1

Step:1 Check the drives whether there is already RAID configured by using the below command

#mdadm  -E  /dev/[b-c]

As you can see from the above output there is no RAID superblock detected i.e no RAID defined yet

Step:2 Partition Drive for RAID

As I have mentioned already minimum 2 harddisks required to configure RAID-1, I have attached two disks /dev/sdb,/dev/sdc for configuring RAID-1, Let us create partitions on these two hard disks and change the pariton type to RAID while creation.

Procedure to create RAID type partitions on the drives

1. Choose ‘n’ to create a new partition

2. Then choose ‘p’ for a primary partition

3. Now select the partition number ‘1’

4. Give the default full size and then press enter

5. Now press ‘p’ to check the mentioned partition

6.Press “L” to list all the available partition types

7.Type ‘t‘ to choose the partition

8. Now choose ‘fd’ for the Linux RAID and press enter

9.choose ‘p’ once again to confirm the changes we made

10.type ‘w’ to save the changes

Step:3

#fdisk /dev/sdb

 

Follow the same above  procedure to create the partition on /dev/sdc drive

Step:4

#fdisk /dev/sdc

Step:5

We have successfully created the partitions on both the drives, verify the changes on both the drives /dev/sdb & /dev/sdc  using the following command

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

From the above output, you will see no md superblock detected because there is no RAID defined on /dev/sdb1 and /dev/sdc1.

Step:4 Configure RAID device  /dev/md0  using the following syntax

#mdadm   --create   /dev/md0   --leve=raid1 --raid-devices=2  /dev/sdb  /dev/sdc

After executing the above command, check the RAID-1 status by using the below syntax

#cat  /proc/mdstat

 

Step:7 Check the RAID Array and device types by using the following command

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

#mdadm  --detail   /dev/md0

From the above output, RAID devices successfully created by using the /dev/sdb and /dev/sdb drives

Step:8 Creating a file system on RAID devices

#mkfs  /dev/md0

Step:9 Mount the file system to some mount point directory

#mkdir  /RAID

#mount  /dev/md0    /RAID

To check the mounted filesystem status

#df -h

From the above output, the RAID devices successfully mounted under the RAID directory.

If you found this article useful, Kindly Subscribe here 👉  Click this link to Subscribe

Never miss an article Do like my official  FB page 👉 Learn Linux in an easier way

##############################################################################################

 

 

About Author:

Hello readers! Let me introduce my self first. My name is Vasanth Nirmal Singh J S having 9+ years of experience in IT on all flavours of Unix operating systems ,Storage's and many more .. I would like to share my technical experience i have come across - can be help to other people. So in this blog, I'll post my thoughts related to ITIS. I'll share experiences that I've had while working in different environments. You can expect content related to Unix,Solaris,Linux,EMC Storeages,HP-UX and many others. I hope this blog can be useful for you! Your comments will be appreciated!

Leave a Reply

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