Redundant disk array of RAID5 configuration

Published in 1988 by the University of California, Berkeley, first mentioned in the article and defines RAID , today's CPU performance improvement of 30% to 50% per year, but only a hard disk upgrade 7%, gradually it has become a bottleneck in the overall performance of the computer, and in order to avoid any hard sudden damage cause data loss has also joined the redundancy backup mechanism.

Earlier design concept of RAID is " Redundant Array of  Inexpensive  Disks " That is not your hard disk group, and now is defined as " Redundant Array of work of the Independent  Disks " that is separate hard drive group, the role is to prevent physical damage to the hard disk and increase storage throughput amount . There are common combination RAID 0 , 1 , 5 and 10 :

RAID0: at least two (inclusive) hard drive, the hard disk can effectively improve performance and throughput, but there is no redundancy and error recovery capability data.

 

The multiple disks in series by way of hardware or software together into a large volume set, the data is sequentially written into each of the hard disk, this will greatly enhance the performance, but if any one disk fails, the entire system of the data will be damage.

RAID1: At least two (including) hard disk, can effectively improve the safety and repairability data, but the cost has increased.

 

To achieve the original image file will be generated on another piece of empty hard when data is written to disk, without compromising performance to ensure maximum reliability of the data, as well as a long as a pair of mirrored hard disk can use, the data will not be lost, it has a good hard disk redundancy, although the absolute security of data is concerned, but the cost is significantly increased disk utilization rate is only 50%.

RAID5: at least three (with) a hard disk, both storage performance, data security and storage costs.

 

As shown in FIG. "Parity" is stored in the parity block information from other data hard disk (hard disk not other data), parity information to data to ensure data security, RAID5 not a separate hard disk to store data parity information, but stored on each disk.

So that when a hard drive is damaged any data can be attempts to rebuild corrupted according to parity information on the other hard drive, performance is also very high, taking into account the storage performance, data security and storage costs, it can be seen as a compromise between RAID0 and RAID1 Program.

RAID10: at least four (including) a hard disk, both speed and safety, but the cost is high.

 

He inherited the fast RAID0 and RAID1 security, and here RAID1 array provides redundancy, and RAID0 array is responsible for reading and writing data.

Because of the high cost of such a structure, the general requirements for storing data and speed error control.

 

The following is a RAID5 configuration process (5 disk 3 do raid, 2 chunks are backup) :

 

The first step: add five hard disk in a virtual machine:

 

 

 Click when you close the virtual machine Edit virtual machine settings, and then add the disk

 

 

 

 

 

 

 

 

 

 

 

 

 

 

All the way to the default, you can see after the completion of adding a new hard drive of a 20G. The same way we add five hard drives

 

 

 

 

After opening the virtual machine can use fdisk -l to view the hard disk information to add!

 

 

 

 

 

 

 

 

 Step 2: Create a RAID5 using the mdadm command, the name " / dev / md0."

 

Represents -C creation, -v show creation process, -a yes checking RAID name, -n is the number of hard disks used, -l is defined RAID levels and write on the back of the hard drive to add the name of the array. -x backup disk

 

 

Step 3: Format and mount using

The ext4 formatted as a RAID format:

 

 

 

 

创建挂载目录:注意挂载目录前必须有/ 否则不能挂载

 

 

 

进行文件系统的挂载:

 

 

 

查看磁盘挂载信息:

 

 

 

最后,将此磁盘阵列挂载信息设置为重启后也依然生效:(可以用这条命令,也可以直接vi编辑fstab也可以)

[root@linuxprobe ~]# echo "/dev/md0 /RAID ext4 defaults 0 0" >> /etc/fstab

 

 

 

第4步:查看/dev/md0设备信息

mdadm -D /dev/md0

 

 

 

第5步:模拟有1块硬盘损坏的情况
使用mdadm的-f参数将/dev/sdb移出阵列:

 

 

第6步:损坏后依然正常使用

因为RAID5级别能够允许一组RAID硬盘中存在一个故障盘而不影响使用,所以依然可以正常的创建或删除文件~

可以把新的硬盘添加进去,也可以让硬盘sdb恢复使用:重启后执行“ mdadm /dev/md0 -a /dev/sdb”。

再来看下阵列的详细信息(此时硬盘sde直接顶替上去了):表示备份起到了作用

 

Guess you like

Origin www.cnblogs.com/hzk001/p/11709030.html