RAID is an abbreviation for the English Redundant array of independent disks, which is known as a redundant array of independent disks. RAID is a redundant array of multiple hard disks. Although RAID contains multiple hard disks, it appears as a separate, large storage device under the operating system. There are three main benefits of using RAID technology for storage systems:
1. Provide disk spanning function by organizing multiple disks together as a logical volume;
2. Write/Read multiple disks in parallel by dividing the data into multiple chunks (blocks) to improve the speed of accessing the disk;
3. Provides fault tolerance through mirroring or validation operations.
Features of RAID
RAID-0:
RAID 0: Combine multiple disks into a single large disk, with no redundancy, parallel I/O, and the fastest. RAID 0 is also known as a stripe set. It is to put multiple disks together and become a large hard disk. When the data is stored, it segments the data by the number of disks, and then writes the data into the disk.
So, at all levels, the speed of RAID 0 is the fastest. However, RAID 0 does not have redundant functionality, and if one disk (physical) is damaged, all data is not available.
RAID-1:
RAID1 the disks in the disk array into the same two groups, mirroring each other, when any disk media failure, can take advantage of the data recovery on its mirror, thereby improving the system's fault tolerance. The operation of the data still uses the block after the parallel transmission mode. All RAID 1 not only improves read and write speeds, but also enhances system reliability. However, the disadvantage is that the hard disk utilization is low, and the redundancy degree is 50%.
RAID-2
..
RAID-5:
RAID 5: Write data to disks in the array, parity data is stored on individual disks in the array, allowing a single disk error. RAID 5 is also a data check bit to ensure the security of data, but it is not a separate hard disk to hold the data check bit, but the data segment of the check bit interaction on each hard disk. If any of these drives are damaged, the corrupted data can be rebuilt according to the check digit on the other hard drive. The utilization of the hard disk is n-1.
RAID-6
Improved read and write performance
Free space: (N-2) *min (s1,s2,...)
Fault Tolerance: 2 disks
Minimum number of disks: 4, 4+
RAID10
Improved read and write performance
Free space: n*min (S1,s2,...) /2
Fault tolerance: Each group of images can only be broken one piece;
Minimum number of disks: 4, 4+
RAID01
Common levels: RAID-0, RAID-1, RAID-5, RAID-10, RAID-50, JBOD
Here we use CENTOS6 and this is implemented in two ways,
How to implement Hardware
How to implement Software
Implementation of software RAID on CentOS 6:
Combined with MD (multi devices) in the kernel
Mdadm: a modular tool
Syntax format for commands: mdadm [mode] <raiddevice> [options] <component-devices>
Supported RAID levels: LINEAR, RAID0, RAID1, RAID4, RAID5, RAID6, RAID10;
Mode:
Create:-C
Assembly:-A
monitoring:-F
Management:-F,-R,-a
<raiddevice>:/dev/md#
<component-devices>: any block device
-C: Create pattern
-N #: Create this raid with # blocks of devices;
-L #: Indicates the level of RAID to be created;
-A {Yes|no}: Automatically create device files for target RAID devices;
-C Chunk_size: Indicates the block size;
-X #: Indicates the number of free disks;
For example: Create a RAID5 of 10G free space;
-D: Displays details of the raid;
Mdadm-d/dev/md#
Management mode:
-F: flag specifies that the disk is damaged;
-A: Adding disks
-R: Remove disk
Observe the status of MD:
Cat/proc/mdstat
To stop the MD device:
Mdadm-s/dev/md#
Watch's command:
Syntax use: watch-n# ' COMMAND '
Options used:-N #; Refresh interval, time unit "seconds"
This article comes from "There is only one place we know" blog, please be sure to keep this source http://10442897.blog.51cto.com/10432897/1699723
RAID-level features