Thursday, 28 November 2019

How to Configure Software RAID 0 (Striping) on CentOS 7



RAID (Redundant Array of Independent \Inexpensive Disk) is a data storage technology that combines multiple physical disk drives into a single logical volume to provide data redundancy and performance which vary depending on the RAID levels. mdadm (multiple devices admin) is a widely used tool to manage RAID on most of the Linux distributions.
This article describes How to Configure Software RAID 0 (Striping) on CentOS7. Two additional hard disk partitions (sdb1 and sdc1 Linux raid autodetect) which use in RAID 0 Configuration:

[root@linuxcnf ~]# fdisk -l /dev/sdb /dev/sdc

Disk /dev/sdb: 8589 MB, 8589934592 bytes, 16777216 sectors
…………………..
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    16777215     8387584   fd  Linux raid autodetect

Disk /dev/sdc: 8589 MB, 8589934592 bytes, 16777216 sectors
………………….
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048    16777215     8387584   fd  Linux raid autodetect
[root@linuxcnf ~]#

Step 1. mdadm Package Installation: mdadm tool is not available in CentOS 7 minimal installation. Run the following command to install mdadm packages and its dependencies:

[root@linuxcnf ~]# yum install mdadm -y
Loaded plugins: fastestmirror
…………………..
Installed:
  mdadm.x86_64 0:4.1-1.el7

Dependency Installed:
  libreport-filesystem.x86_64 0:2.1.11-43.el7.centos

Complete!
[root@linuxcnf ~]#

Step 2. Create RAID 0: Run the following command to create RAID 0 with two hard disk partitions:

[root@linuxcnf ~]# mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdb1 /dev/sdc1
mdadm: chunk size defaults to 512K
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
[root@linuxcnf ~]#

Step 3. Verify RAID 0 Status: Run the following command to verify RAID creation:

[root@linuxcnf ~]# cat /proc/mdstat
Personalities : [raid0]
md0 : active raid0 sdc1[1] sdb1[0]
      16764928 blocks super 1.2 512k chunks

unused devices: <none>
[root@linuxcnf ~]#

Done!!! RAID 0 (Striping) is created successfully with two hard disks and RAID partition /dev/md0 is ready to create file system for use.

No comments:

Post a Comment