First, the concept
disk array (redundant Arrays of independent Disks,raid), with the meaning of "redundant array of independent disks". is designed to improve the read and write speed of files on disk.
The data that is stored in the disk is divided into one stripe, which is then saved in parallel to the disk array, or the data is taken in parallel in the form of a stripe in the disk array. Such as:
Second, the level of RAID:
0: Stripe technology (simply stripe the data and store it on disk)
Improved data read and write performance
No redundant performance (no data backup)
Number of drive characters: >=2
1: Mirroring (Backup)
Performance, write performance degradation, read performance improvement (can be read alternately)
Redundancy capability: Available
Space utilization: 50%
Mirror Technology Mirror
Number of drive characters: >=2
2,
3,
4
5: Add calibration mechanism, several disks rotate as check disk
Performance: Read and write promotion
Redundancy capability: Available
Space utilization: (n-1)/n
Number of drive characters: >=3
1 0: First back and then strip
Performance: Read and write promotion
Redundancy capability: Available
Number of drive characters: >=4
Space Utilization 1/2
0 1: First strip back up (often, because 1 0 ways can cause the stripe to be stored differently in each backup)
Performance: Read and write promotion
Redundancy capability: Available
Space utilization: 50%
Number of drive characters: >=4
5 1:
Performance: Read and write promotion
Redundancy capability: Available
Space utilization: (n-2)/n
Number of drive characters: >=6
Iii. Types of RAID
Hardware RAID:
An external disk array
or an internal raid control chip.
Software raid
MD (Multi Disks) combines the specified disk devices to form a raid
RAID device is created under/dev/md#
If one day the kernel is broken, for the disk after the raid can be used, to identify the type of disk as the kernel can recognize the Linux RAID auto type.
Command for Mdadm: Make any device raid
Modal Commands:
Create a pattern
Management mode
Monitoring mode
Growth model
Assembly mode
-A
Create a pattern
-C
Dedicated options
-C Chunk (stripe) size, default is 64k,
-L Level
-a {Yes|no} automatically creates a device file for it
-N: Number of devices, several disks to do raid
-X: Specify the number of free disks, and then as the raid disk is broken, the disk that goes directly to the top
Management mode
--add--del
Monitoring mode
-F
Growth model
-G
Assembly mode
-A
-D--detail/dev/md# View raid information
Deactivate array: Madm--stop/dev/md#
Enable array: Mdadm-a/DEV/MD1/DEV/SDA6/DEV/SDA7
Save the current RAID information to a configuration file for later assembly,
mdadm-d--scan >/etc/mdadm.conf
Soft RAID New Process
New partition/dev/sda5,/dev/sda6, specifying SDA5,SDA6 as the Linux RAID auto type in the process
Let the kernel identify the newly created partition PARTPROBE/DEB/SDA
Cat/proc/partitions
Madm-c/dev/md0-a yes-l 0-n 2/dev/sda{5,6}
Cat/proc/mdstat
Next
Mke2fs-j/dev/md0
Next Mount
Mount/dev/md0/mnt
MADAM-D|--DETAIL/DEV/MD0 View RAID Array details
In management mode, simulate damage to a disk mdadm/dev/md#--fail/dev/sda7 simulate damage to the SDA7 disk under md# (for RAID)
Remove the hard drive mdadm/dev/md#-R/DEV/SDA7
Mdadm mdadm/dev/md#-A/DEV/SDA7
File system, you can specify how many blocks are in the stripe size, and then avoid calculating the number of disks that a stripe contains each time a soft raid is generated. Mke2fs-j-E stride=16-b (block size) 4096/dev/md0
Linux RAID Technology