I. Introduction to RAID
RAID is the abbreviation of Redundant Array of Independent Disks ).
To put it simply, RAID combines multiple independent hard disks (physical hard disks) in different ways to form a hard disk group (logical hard disks ), this provides higher storage performance than a single hard disk and Data Backup technology.
RAID Levels is used to form disk arrays. RAID Levels include RAID 0, RAID 1, RAID 5, and RAID 10. The levels are compared as follows:
RAID level |
Minimum Hard Disk |
Maximum Fault Tolerance |
Available capacity |
Read Performance |
Write Performance |
Security |
Purpose |
Application Industry |
0 |
2 |
0 |
N |
N |
N |
One hard disk is abnormal. All hard disks are abnormal. |
Maximum capacity and speed |
Real-time 3D rendering and video editing Cache |
1 |
2 |
N-1 |
1 |
N |
1 |
The maximum value is normal. |
Maximum Security |
Personal and Enterprise Backup |
5 |
3 |
1 |
N-1 |
N-1 |
N-1 |
High |
Maximum capacity and minimum budget |
Personal and Enterprise Backup |
10 |
4 |
N/2 |
N/2 |
N |
N/2 |
High Security |
Combining the advantages of RAID 0/1, the theoretical speed is faster |
Large Databases and servers |
Note:N indicates the total number of hard disks.
For more information about RAID, see: http://zh.wikipedia.org/wiki/RAID
Ii. System Environment
Lab environment:Oracle VM VirtualBox
System Platform:CentOS release 6.3 (Final)
Mdadm version:Mdadm-v3.2.6-25th October 2012
3. Set Disks
In the Oracle VM VirtualBox, increase the number of physical disks. In this article, we will create RAID 0, RAID 1, and RAID 5 partitions. RAID 0 requires two hard disks and RAID 1 requires two hard disks, RAID5 requires four hard disks, so eight physical hard disks are added here, each of which is 5.00 GB.
4. Install mdadm
Mdadm is short for multiple devices admin. It is a standard software RAID management tool in Linux.
4.1 check whether mdadm software is installed
# Rpm-qa | grep mdadm
5. Create RAID0
5.1 create a partition
Two hard disks are required to create RAID0, so we will use/dev/sdb and/dev/sdc for the experiment.
# Fdisk/dev/sdb // partition sdb
Enter "m", get help, and enter "p" to view the disk status before partitioning. For details about other Command actions, Google and Baidu.
6. Create RAID1
Similar to creating raid0, we use the/dev/sdd and/dev/sde hard disks for experiments.
6.1 create a new partition and modify the partition type
7. Create RAID5
RAID5 requires at least three hard disks. We will test the hard disks/dev/sdf,/dev/sdg,/dev/sdh,/dev/sdi, three disks are used as active disks and the other as hot spare disks.
7.1 create a new partition and modify the partition type
The partition result is as follows:
7.4 add raid5 to the RAID configuration file/etc/mdadm. conf and modify
# Echo DEVICE/dev/sd {f, g, h, I} 1>/etc/mdadm. conf
# Mdadm-Ds>/etc/mdadm. conf
VIII. RAID Maintenance
After completing RAID, we also need to perform routine maintenance operations. For example, if one of the hard disks is damaged, we need to replace the faulty disks, the following describes how to maintain soft RAID by simulating disk corruption in RAID 5.
8.1 disk Damage Simulation
In practice, when soft RAID detects a disk failure, it will automatically mark the disk as a faulty disk and stop read/write operations on the faulty disk. Here we simulate/dev/sdh1 as a faulty disk. The command is as follows:
# Mdadm/dev/md5-f/dev/sdh1
9. Add storage hard disks to RAID
If the RAID space is not enough, we can add a new hard disk to it to increase the RAID space.
9.1 Add a physical hard disk to a VM
We have already added eight hard disks to the VM. We need to simulate new hard disks here. So we need to first disable the VM and then add a 5 Gb hard disk to the storage. Then partition and other operations. We will not repeat them here.
10. References
- Yu Fei blog: http://www.opsers.org/base/learning-linux-the-day-that-the-system-configuration-in-the-rhel6-disk-array-raid.html
David Camp
- For technical exchange, add the QQ group:
System O & M Technology: 296513821
- Author: QQ: 562866602
- My ID: mchina_tang
- Write to me: mchina_tang@qq.com
- My address: Suzhou, Jiangsu Province
We always believe that sharing is a virtue |We Believe, Great People Share Knowledge...