introduction to common raid and implementation of soft raid
First, what is RAID?
disk array (redundant Arrays of independent Disks,RAID), with " an array of redundant capabilities consisting of a separate disk .
The disk array is made up of a lot more price the appropriate magnetic disk, form a fast, ultra-large capacity external memory system. Under the control and management of array controller, it realizes fast, parallel or cross-access, and has strong fault-tolerant energy .
Second, the advantages of RAID
1. Increase the transfer rate. RAID significantly increases the data throughput of the storage system by simultaneously storing and reading data on multiple disks.
2. Provide fault tolerance through data verification, provide higher security; "Virtualization" makes manageability much more scalable, flexible capacity expansion, redundancy technology and hot-standby, heat exchange for improved reliability, "disk chunking" technology improved performance.
Third, RAID technology
1. disk Mirroring technology
Mirror redundancy uses disk mirroring technology, disk mirroring is a simple device virtualization technology, each I/O operation is performed on two disks, and two disks look like a disk, Mirror Redundancy can improve the read performance and redundancy of the disk.
2. Redundancy algorithm
Based on the redundancy algorithm, the verification information of the data on the member disk in the array is computed, the officer information is saved on other disk resources, and the data reliability is compared with the mirror redundancy, and the cost of verifying redundancy is smaller.
XOR algorithm:
The same is false, the difference is true
The inverse operation of XOR is XOR
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/7D/BA/wKioL1bur77zsFHEAAAT41MpQWQ584.png "width=" 427 " height= "186" title= "image 1.png" alt= "Wkiol1bur77zsfheaaat41mpqwq584.png"/>
Iv. types and levels of RAID
how 1.RAID is implemented:
Hardware RAID: there is a special RAID Control processor and I/O processing chips to handle RAID tasks, do not need to occupy the host CPU Resources
External disk array: Adapter capability with expansion cards
On-chip raid: Motherboard integrated RAID Controller
Software RAID ( software raid): Features are dependent on host CPU completion , no third-party control processors and I/O chip
2.RAID level:
Different RAID levels differ in storage performance, data reliability, storage costs, and so on, in a variety of ways that comprise raid arrays.
1) RAID0 is a stripe that distributes data evenly across the array's disks, providing faster access, but not providing better protection for the data.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7D/BA/wKioL1busObBMB-jAAA6tDAbE_w345.png "title=" Raid0.png "width=" 452 "height=" 251 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:452px;height:251px;float:left; "alt = "Wkiol1busobbmb-jaaa6tdabe_w345.png"/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7D/BD/wKiom1busJXTymQfAAAyr2hDqW4101.png "title=" RAID0 2.png "alt=" Wkiom1busjxtymqfaaayr2hdqw4101.png "/>
2 ): RAID1 A redundant copy of the data on the virtual disk, on the member disk, to provide good fault tolerance.
650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/7D/BA/wKioL1buuQ7Tbl--AAAocvYb1WA724.png "title=" image 11111.png "alt=" Wkiol1buuq7tbl--aaaocvyb1wa724.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7D/BD/wKiom1busPjh0KtwAAAzZdUL_Sg049.png "title=" RAID1 2.png "width=" 550 "height=" 192 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:550px;height:192px; "alt=" Wkiom1buspjh0ktwaaazzdul_sg049.png "/>
3) in RAID3, the data blocks are divided into smaller chunks in parallel to the individual member disks, while the XOR checksum data is stored on a dedicated check disk, which is officer on a separate dedicated disk, thus providing better fault tolerance.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7D/BA/wKioL1buse_g6lT-AABan3jrr_Q012.png "title=" Raid3.png "alt=" Wkiol1buse_g6lt-aaban3jrr_q012.png "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7D/BD/wKiom1busfCCVV8eAABAsxesKt4631.png "title=" R image 40. PNG "width=" "height=" 244 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px;height:244px; "alt=" Wkiom1busfccvv8eaabasxeskt4631.png "/>
4) The RAID5 uses an array of independent access, verifying that the information is distributed evenly across the array's disks, which increases data read speed while also effectively improving data protection performance.
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7D/BA/wKioL1bussOgjW3aAABGYvEEhzg664.png "title=" RAID 5. PNG "alt=" Wkiol1bussogjw3aaabgyveehzg664.png "/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7D/BA/wKioL1busxKCZFRuAAAxp0JaC1A611.png "title=" RAID 5 2.png "alt=" Wkiol1busxkczfruaaaxp0jac1a611.png "/>
2. Combo raid
From RAID0 to RAID6, different levels of raid in performance, redundancy, price and other aspects of a different degree of compromise, the combination of different levels of RAID, the purpose is to avoid weaknesses, to produce a hybrid raid level with advantageous characteristics
focus on RAID 10, RAID
1) RAID10 combined with RAID1 and RAID0, first mirror, then strip.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7D/BD/wKiom1busu_TjvuNAABCLhqj6Us546.png "title=" RAID 1 0.png "alt=" Wkiom1busu_tjvunaabclhqj6us546.png "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7D/BA/wKioL1butKHQ7zT-AAAqTBtpNmo398.png "title=" RAID 5 23.png "alt=" Wkiol1butkhq7zt-aaaqtbtpnmo398.png "/>
2) RAID50 is the combination of RAID5 and RAID0, first realize RAID5, and then strip.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/7D/BA/wKioL1butNvAFY33AABtUF3_j0E752.png "title=" image 5 0. PNG "alt=" Wkiol1butnvafy33aabtuf3_j0e752.png "/>
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M00/7D/BE/wKiom1butFXTzc0aAABH8JIwQrM960.png "title=" image 5 02. PNG "width=" 650 "height=" 257 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:650PX;HEIGHT:257PX; "alt=" Wkiom1butfxtzc0aaabh8jiwqrm960.png "/>
Comparison of RAID levels
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7D/BA/wKioL1butSvSkCrBAABV0GSZhOc666.png "title=" Common raid.png "alt=" Wkiol1butsvskcrbaabv0gszhoc666.png "/>
3. Soft RAID is implemented by the Kernel software module MD (multi disks). The MD simulates a logical raid that is/dev/md# (#跟级别没关, only identifies the device).
Mdadm: Supports the raid of any block device.
Modal Commands:
Create Mode-C
Private mode:-L Specify level
-N Number of devices
-a automatically creates a device file for it
-C Specify chunk size
Management mode--add,--del
Monitor mode-F
Growth Mode-G
Assembly Mode-A
Example: Using two 1G hard drives, do RAID0
1. Create raid
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7D/BA/wKioL1buthPzORbqAAAQk0qwcYk071.png "title=" Mdadm.png "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px;height:60px; "alt=" Wkiol1buthpzorbqaaaqk0qwcyk071.png "/>
2. Formatting/dev/md0
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7D/BA/wKioL1butkOw-xjnAABk71is4sY811.png "title=" Mke2fs.png "width=" "height=" 355 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px;height:355px; "alt=" Wkiol1butkow-xjnaabk71is4sy811.png "/>
3. Mount/dev/md0
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7D/BE/wKiom1buteuiywi7AAAFR0eWAOg655.png "title=" Mount.png "alt=" Wkiom1buteuiywi7aaafr0ewaog655.png "/>
4. View RAID Status
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7D/BA/wKioL1butriy5DF-AABWZT60S5k320.png "title=" Mdadm- D.png "width=" "height=" 504 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px;height:504px; "alt=" Wkiol1butriy5df-aabwzt60s5k320.png "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7D/BA/wKioL1butwCBc4h0AAAUb0P0p34661.png "title=" state. png "Width=" "height=" 159 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:600PX;HEIGHT:159PX; "alt=" Wkiol1butwcbc4h0aaaub0p0p34661.png "/>
Introduction to common raid and implementation of soft raid