Linux commands: Raid learning RAID 0 RAID 1 RAID 5 raid 01

Source: Internet
Author: User

raid Introduction:       

RAID (Redundant array of inexpensive Disks) is called a redundant array of inexpensive disks. The basic principle of RAID is to put multiple inexpensive small disks


RAID level description;
generally used RAID class, Are RAID 0, RAID1, RAID 2, RAID 3, RAID 4, and RAID 5, plus two-in-one raid 0+1 or RAID 1+0﹝ or RAID 10﹞. Let's compare the advantages and disadvantages of these RAID levels first:

Relative disadvantage of RAID level relative advantages
RAID 0 Access speed is the fastest without fault tolerance (stripe)
RAID 1 full fault-tolerant cost (mirrored)
RAID 2 with sea-check, data redundancy, slow
RAID 3 Write performance is best without multi-tasking capabilities
RAID 4 features multi-tasking and fault tolerance Parity disk drives cause performance bottlenecks
RAID 5 with multi-tasking and fault-tolerant features when writing overhead
RAID 0+1/raid 10 is fast and full fault-tolerant cost is high


1, RAID 0 features, principles and applications; is also known as stripe mode (striped), which means that continuous data is distributed across multiple disks for access. When a system has data requests it 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. Because reads and writes are done in parallel on the device, read and write performance increases, which is typically the main reason for running RAID 0. but raid 0 has no number

    .


2, Features, principles and applications of RAID 1
RAID 1 is also known as mirroring (mirroring), a mode with full redundancy. RAID 1 can be used on two or 2xN disks and uses 0 or more spare disks, which are written to the mirror disk each time the data is written. This array is highly reliable, but its effective capacity is reduced to half of the total capacity, and the disks should be equal in size, otherwise the total capacity will only have the smallest disk size.

Its disk utilization is only 50%, the lowest of all RAID levels.

2. Features, principles and applications of RAID 1

RAID 5 uses at least three hard drives to achieve the array, it can realize RAID 0 acceleration function can also realize RAID 1 backup data function, when there are three hard disks in the array, it will be required to store the data according to the user-defined segmentation size into a file fragment stored in two hard drives, at this time, The third hard disk in the array does not receive file fragments, it is used to verify the data stored in the other two hard drives in the part of the data, this part of the verification data is generated through a certain algorithm, you can use this data to recover the data stored on the other two hard disks. In addition, the task of the three hard disk is not immutable, that is, in this storage may be 1th hard disk and 2 good hard disk to store the fragmented file fragments, then the next time the storage may be the 2nd hard disk and the 3rd hard disk to complete this task. It can be said that in each storage operation, the task of each disk is randomly allocated, however, it must be two hard disks used to store the fragmented file fragments of another hard disk to store the checksum information.

This verification information is generally calculated by the RAID controller, which typically requires a single chip on a RAID controller to compute and decide which hard disk storage to send this information to.

RAID 5 also enables high-speed storage reads for RAID 0 and data recovery for RAID 1, which means that RAID 5 can utilize three hard disks to achieve RAID 0 speed doubling capability and RAID 1 data backup functionality, and when raid 5 a piece of hard disk damage, adding a new hard disk can also be used to restore data.

The following is an analysis of how RAID 5 can restore data, for example, using 3 hard disks to form a RAID 5 array with a user-defined split file size of 64k, at which time the file size required to be stored is 128k. First, when the RAID controller received this part of the data after the use of a certain algorithm to obtain the verification information, and then split the 128k file into two size 64k size of the file fragments, and then the two pieces of the files are placed on the 1th hard disk and 2nd hard disk, the final check information is sent to the 3rd hard drive. If one of the hard drives in the array is damaged, the original data can be restored: if the 3rd hard drive used to store the checksum information is damaged, the verification information can be re-generated through the 1th and 2nd hard drives, and if the damaged number is 1th or 2nd, You can regenerate the original file fragments using the checksum information stored on drive 3rd.

RAID 5 mode is not a good thing, if the information on a hard disk in the array has changed, then need to recalculate the fragmentation of the file, and the verification information needs to be recalculated, then, three hard disks need to be recalled.

Similarly, if you want to do a RAID 5 array, it is best to use the same capacity of the same speed of the hard disk, the effective capacity of the RAID 5 mode is the smallest capacity in the array of hard disk capacity in the number of hard drives minus one, the number of hard drives here to subtract one because one of the hard disk to hold the verification information.

RAID 5 Doubles the speed and ensures the security of the data, so this raid pattern is used in many high-end systems.


3, RAID 0+1﹝raid 10﹞ features, Principle and application;
RAID 0+1/RAID 10, combined with the advantages of RAID 0 and RAID 1, suitable for use in high speed demand, but also full fault tolerance, of course, a lot of funding applications. The principle of RAID 0 and RAID 1 is very simple, it is easy to combine, we do not intend to detail, but to talk about, the raid 0+1 should be RAID 0 over RAID 1, or RAID 1 over RAID 0, that is, multiple RAID 1 into the RAI D 0, or RAID 1 for multiple RAID 0?

RAID 0 over RAID 1

Let's say we have four disk drives, each of which is first RAID 1, and two RAID 1 as RAID 0, which is RAID 0 over RAID 1:

(RAID 1) A = Drive A1 + drive A2 (mirrored)
(RAID 1) B = Drive B1 + drive B2 (mirrored)
RAID 0 = (RAID 1) A + (RAID 1) B (striped)

RAID 1 over RAID 0

Let's say we have four disk drives, each of which is first raid 0, and two RAID 0 as RAID 1, which is RAID 1 over RAID 0:

(RAID 0) A = Drive A1 + drive A2 (striped)
(RAID 0) B = Drive B1 + drive B2 (striped)
RAID 1 = (RAID 1) A + (RAID 1) B (mirrored)

Under this architecture, if (RAID 0) A has a disk drive failure, (RAID 0) A is destroyed, of course, RAID 1 will still work, and if (RAID 0) b also has a disk drive failure, (RAID 0) b is destroyed, at this time the two disk drives of RAID 1 is a failure, the entire RAID 1 data is destroyed.

Therefore, RAID 0 over RAID 1 should have higher reliability than RAID 1 over RAID 0. Therefore, we recommend that when using the RAID 0+1/raid 10 architecture, RAID 1 is first done, and then RAID 1 is made into RAID 0.


This article is from the "Learn Linux history" blog, please be sure to keep this source http://woyaoxuelinux.blog.51cto.com/5663865/1869317

Linux commands: Raid learning RAID 0 RAID 1 RAID 5 raid 01

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.