Introduction
RAID: Stands For Redundant Array Of Independent Disks (Hardware Raid) or Redundant Array Of Inexpensive Disks (Software Raid) and that is technology that keeps data redundant to avoid data loss if any disk falls or is corrupted .
RAID Types ?
- Hardware RAID : is a physical controller can create array of disks and configure any level of raid on that array
- Support Fast speed cache to synchronize with OS during writing with very large amount of data
- Platform independence not depending on state of OS if work or fall , data keeped away
- Software RAID : is a software raid supported in Windows or linux
- Easy to use
- Can be performed in physical or logical hard disks
RAID Levels ?
- RAID 0 (Stripping) : can be performed in 2 disks at least
- Fast Reading
- Fast Writing
- Redundancy (Fault tolerance) none
- RAID 1 (Mirroring) : can be performed in two disks at least data can be kept if one disk fails.
- Good Reading
- Good Writing
- Redundancy (Fault tolerance) Excellent
- RAID 5 (Strip With parity ) : can be performed in 3 disks at least to infinity or number of disks available ,data can be restored if one disk fail
- Good Reading
- Good Writing
- Redundancy (Fault tolerance) Good
- RAID 6 (Strip With dual parity ) : can be performed in 4 disks at least to infinity or number of disks available,data can be restored if one disk fail
- Good Reading
- Good Writing
- Redundancy (Fault tolerance) Good
- RAID 10 (RAID 0+ RAID 1 ) : can be performed in 4 disks at least to infinity or number of disks available, we merge raid 0 with raid 1
Preferred to be even number of disks
- Fast Reading
- Good Writing
- Redundancy (Fault tolerance) excellent
How To Create RAID ?
First You need to install the mdadm tool to manage and configure Software RAID.
You can install it by following next steps :
Open your terminal
Write :
Debian\Ubuntu:
sudo apt-get update -y
sudo apt install mdadm -y
RedHat\CentOs:
yum update
sudo yum install mdadm
After Installation you need to decide which level of raid you want to configure in your disks depending on your environment and how data is important.
How To Create RAID 0 :
- Open your terminal
- Then Write :
mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sdb /dev/sdc
Hint: –create : /dev/name of array
–level= number of raid
–raid-devices= number of devices used to create raid
- Then Write :
watch cat /proc/mdstat
Hint: watch to repeat same command every 2 seconds to monitor the raid creation process if failed or done
- Then Write :
lsblk
Hint: to list your devices and knew what technology applied to your disks
How To Create RAID 1 :
- Open your terminal
- Then Write :
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc
How To Create RAID 5 :
- Open your terminal
- Then Write :
mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd
How To Create RAID 6 ?
- Open your terminal
- Then Write :
mdadm --create /dev/md0 --level=6 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde
How To Create RAID 10 ?
- Open your terminal
- Then Write :
mdadm --create /dev/md0 --level=10 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde
Conclusion:
The article clarify the best way to configure all types of software raid on linux.
For more info use command :
man mdadm