RAID brief introduction and how Linux builds a raid

Source: Internet
Author: User

Raid:redundant Arrays of Inexpensive Disks, with "Redundant Array of Inexpensive disks" means. Abbreviated disk array.

The disk array is made up of a lot less expensive Disk , combined into a large-capacity disk group, the use of individual disks to provide data generated by the bonus effect to improve the overall disk system performance. Using this technique, the data is cut into many sections, which are stored on each hard drive.

This concept was originally proposed by the University of California, Berkeley, the Cheap (inexpensive) disk is the focus of the main research, but later found that a large number of inexpensive disk combinations do not apply to the actual production environment, later inexpensive was changed to independent.

Redundant array of independent disks is the method of storing the same data in different places on multiple hard disks. By placing data on multiple hard drives, input and output operations can be overlapped in a balanced manner, improving performance. Because multiple drives increase the mean time between failures (MTBF), storing redundant data also increases fault tolerance.


Level classification for RAID:

RAID 0: The data is evenly distributed across the array's disks in strips, so that the system has data requests that can be executed in parallel by multiple disks, each of which performs its own portion of the data request. The parallel operation on this data can make full use of the bus bandwidth, and significantly improve the overall disk access performance.

Hardware requirements: Minimum of 2 disks

Performance advantages: Very high disk read and write efficiency, no verification, not to occupy too much CPU resources design, use and configuration is relatively simple.

Cons: No redundancy and cannot be used for environments with high data security requirements.

RAID 1 : The data that the user writes to the hard disk is automatically copied to the other hard disk completely. With a full backup of the stored data, RAID 1 provides the highest data security across all RAID levels. Similarly, with 100% of the data backed up, backup data accounts for half of the total storage space, thus mirror disk space utilization is low and storage costs are high.


Hardware requirements: 2N, n at least 1.

Performance advantages: With 100% data redundancy, providing the highest data security, theoretically can achieve twice times the reading efficiency, design and use is relatively simple.

Disadvantage: High cost, only 50% space utilization, no improvement in writing performance

RAID 5 : Instead of backing up the stored data, the data and the corresponding parity information are stored on each disk that makes up the RAID5, and the parity information and the corresponding data are stored on separate disks. When one of the RAID5 disk data is damaged, the remaining data and the corresponding parity information are used to recover the corrupted data. is a storage solution that combines storage performance, data security, and storage costs. RAID 5 can be understood as a compromise between RAID 0 and RAID 1, and RAID 5 can provide data security for the system, but with a lower level of protection than RAID 1 and higher disk space utilization than RAID 1. RAID 5 has a similar data read speed as RAID 0, with only one parity information, which is slower than writing to a single disk. And because multiple data corresponds to one parity message, RAID 5 has a higher disk space utilization than RAID 1 and a relatively low storage cost.


Hardware requirements: A minimum of 3 disks.

Performance Advantages: High read performance, medium write performance, check the distributed access of information, avoid the bottleneck of write operation.

Cons: The complexity of controller design, the process of disk reconstruction is more complicated.

raid0+1 : As its name, RAID 0+1 is a combination of RAID 0 and RAID 1, also known as RAID 10, mirroring first, then striped. RAID 0+1 is a solution for both storage performance and data security. It provides the same data security protection as RAID 1also provides storage performance similar to RAID 0. Because RAID 0+1 also provides data security through 100% backups of data, RAID 0+1 has the same disk space utilization as RAID 1 and high storage costs.

Hardware requirements: 2N disks with a minimum of 2 n

Performance Advantages: High reading performance, write performance is good, data security is good.

Cons: Space utilization is only 50%, high cost


There are three styles of disk arrays:

One, an external disk array enclosure.

Two, an internal disk array card.

Third, using software to simulate.


Using a third soft Raid method, a disk partition is used to simulate the process of building a raid


1. Use the FDISK command to view the disk partition status

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7D/65/wKioL1bnorSg8iH1AACQpyWVjqA699.png "title=" 1.png " alt= "Wkiol1bnorsg8ih1aacqpywvjqa699.png"/>


2. Create three partitions on the/DEV/SDB disk to build the raid, and then create a partition as an alternate disk in the raid. After you create the partitions, you need to designate their models as Linux RAID.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/7D/67/wKiom1bnpFKAegoAAAB4EUfgmEo301.png "style=" float: none; "title=" 2.png "alt=" Wkiom1bnpfkaegoaaab4eufgmeo301.png "/>

。。。。。。


650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7D/65/wKioL1bnpN-i33LdAABWgvm2GKw478.png "style=" float: none; "title=" 3.png "alt=" Wkiol1bnpn-i33ldaabwgvm2gkw478.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7D/65/wKioL1bnqiTi0ZfHAABv9Enm4N0159.png "title=" 4.png " alt= "Wkiol1bnqiti0zfhaabv9enm4n0159.png"/>650) this.width=650; src= http://s2.51cto.com/wyfs02/M00/7D/68/ Wkiom1bnqpisg3xxaaceq3nhvxu256.png "title=" 5.png "alt=" Wkiom1bnqpisg3xxaaceq3nhvxu256.png "/>650) this.width= 650; "Src=" Http://s2.51cto.com/wyfs02/M00/7D/65/wKioL1bnq5iSURfsAAAg9PcPCaw768.png "title=" 6.png "alt=" Wkiol1bnq5isurfsaaag9pcpcaw768.png "/>


3. Use the MDADM command to build the raid

RAID Management Command Mdadm

Use format: mdadm [mode] <raiddevice> [options] <component-devices>

Mode RAID device name option to build a RAID device

Mode:

Create-C

Assembly-A

Monitoring-F

View-D

Deactivate-S

Option:-N # Use # devices to create this raid

-L # Specifies the level of RAID to be created

-A (Yse|no) automatically creates device files for target raid

-C # Specifies the block size of the RAID device read and write files

-X # Specifies the number of free disks

-F Device Tag This unit in RAID is corrupted

-R device to remove this unit from raid

-A device adds this unit to raid


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7D/68/wKiom1bnrPfR42T6AABrBRSH5K0714.png "title=" 7.png " alt= "Wkiom1bnrpfr42t6aabrbrsh5k0714.png"/>


4. Format the raid file system and look at its properties

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7D/66/wKioL1bnrm6T9GptAABQZoe6AuA272.png "style=" float: none; "title=" 8.png "alt=" Wkiol1bnrm6t9gptaabqzoe6aua272.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7D/66/wKioL1bnrnCTSmO8AABUkBe59N4608.png "style=" float: none; "title=" 9.png "alt=" Wkiol1bnrnctsmo8aabukbe59n4608.png "/>


5. Use the Mount command to mount it on the current system

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7D/66/wKioL1bnsCXxXezmAAAqa7Z5lBQ580.png "title=" 10.png "alt=" Wkiol1bnscxxxezmaaaqa7z5lbq580.png "/>

It can be used normally.



RAID brief introduction and how Linux builds a raid

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.