RAID Concepts – How Enterprise Level RAID-0-1-5-10 Works

RAID (Redundant Arrays of Independent Disks


An array of capabilities (if one of the disks fails, no data will be lost). Disk arrays are made up of many cheaper disks to hardware (RAID)


Card or software (MDADM) form a combination of a large capacity disk group, using multiple disks combined together, lift


Overall disk system performance. Using this technique, data is cut into segments and stored on individual hard drives. Disk arrays can also benefit from Parity checking


Check), the data can still be read out if any hard disk in the array fails, and when data is reconstructed,


The data is calculated and then put into a new hard disk (that is, a bad disk, unplug, insert a new disk, the data can also be restored to the new disk, using parity) Note: RAID


It can prevent data loss, but it is not a complete guarantee that your data will not be lost, so you use RAID at the same time or pay attention to backup important data RAID


There are two ways to create RAID: soft RAID (implemented through operating system software) and hard RAID (using a hardware array card). The most commonly used in the enterprise are: RAID1, RAID5, and


Raid10. However, with the rapid development of cloud, ali cloud, Tencent cloud and other suppliers can generally solve the hardware problems. (When you use the cloud, do you pay attention to what RAID type the vendor is using at the bottom?)

1.1 Several common types of RAID

Level don’t — — — — — — — — — — — — — said Ming — — — — — — — — the lowest rate of the number of disk space — — — — — — — — — — — — — – — — the advantages and disadvantages of each Raid 0 — — — — — — — — — — — — strip roll — — — — — — — — — — — — — — 2 + — — — — — — — — — — — — — — — — — — — — — — — — — — — — 100%, speaking, reading and writing speed, Not fault-tolerant raid 1 — — — — — — — — — — — — the mirror volume — — — — — — — — — — — — — — 2 — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — 50% generally write speed, reading speed, Fault-tolerant RAID5, strip coil with parity – 3 + — — — — — — — — — — — — — — — — — — — — – (n – 1)/n — — — — — -, speaking, reading and writing speed, fault tolerance, permit a RAID5 bad – with parity stripe set, Double check – 4 + — — — — — — — — — — — – (n – 2)/n — — — — — — — — read and write fast, fault tolerance, allow bad two pieces of plate, etc…

RAID basic idea: several pieces of hard disk through a certain combination of the combination of it, into a new hard disk array group, so that

It can meet the requirements of high performance hard disk

RAID has three key technologies:

Mirroring: Provides data security;

The Chunk band (also known as the granularity of the chunk size) is there to improve I/O and provide data concurrency

Data verification: to ensure the reliability of the data

RAID advantages over a single disk:

1.2 How RAID-0 works

Strping, also our earliest form of RAID, requires two or more disks (preferably of the same size), and is the simplest form of disk array, requiring only two or more hard disks.

Features: Low cost, improved overall disk performance and throughput. RAID 0 offers no redundancy or error repair capabilities and is fast.

Corruption of any one disk corrupts all data; Disk utilization is 100%.



1.3 RAID 1

Mirroring requires more than two disks: it mirrors data from one disk to another, that is, when data is written to one disk, it creates a mirrored file on another unused disk. (Synchronize)

RAID 1 mirroring (mirroring volume) requires at least two hard disks, the RAID size is equal to the minimum capacity of the two RAID partitions (it is better to divide the partition size into the same size), the data is redundant, while the storage is written to two hard disks at the same time, to achieve data backup;

Disk utilization is 50%, that is, two 100GB disks make up RAID1 to provide only 100GB of free space. The following figure



1.4 RAID – 5

Need three or more hard disks, can provide hot standby disk to achieve failure recovery; Just one piece, no problem. But if you damage both of them

Block disk, the data will be corrupted. Space utilization: (n-1)/n 2/3

As shown in the figure below



The function of parity information:

When a disk in RAID5 is corrupted, use the remaining data and the corresponding parity information to recover the corrupted number

According to.

Exposure: XOR operation

Is to use relatively simple XOR logic operations (same = 0, different = 1).

A value ——-B value Xor result

0 — — — — — — — — — — — — 0 — — — — — — — — — — — — — – 0

1 — — — — — — — — — — — — 0 — — — — — — — — — — — — — – 1

0 — — — — — — — — — — — — 1 — — — — — — — — — — — — — – 0

1 — — — — — — — — — — — — 1 — — — — — — — — — — — — — – 1

1.5 Nesting RAID levels

RAID-10 mirror + stripe

RAID 10 is a RAID level that combines mirroring and striping at two levels, the first being a RAID1 mirror pair and the second being a RAID

0. For example, if we have eight disks, it first mirrors two to form a new four disks, and then we do a RAID0 for these four disks; when

RAID10 has one damaged hard disk and the rest will continue to work. At this point, only two hard disks will be affected



Comparing several solutions, RAID5 is the most suitable, as shown in the figure below:

1.6RAID hard disk failure processing

There are two general processing methods: HotSpare and hot plug and pull HotSpare: HotSpare

Definition: When a hard disk fails in a redundant RAID group, it is automatically replaced by another normal spare hard disk in the RAID system without interfering with the normal use of the current RAID system, so as to ensure the redundancy of the RAID system in time (just like the spare tire on a car).

Global: The spare hard disk is shared by all redundant RAID groups in the system (one spare tire for multiple cars)

Dedicated: The spare hard disk is dedicated to a redundant RAID group in the system (one car, one spare tire).

This is an example of a global hot standby that is shared between two RAID groups in the system and can automatically replace either

A dead hard disk in a RAID



HotSwap: HotSwap

Definition: To replace a failed hard disk in a RAID system with a normal physical hard disk without affecting the normal operation of the system. (the lights turn red

If a hard disk fails, unplug it directly and plug in a new one. The server must support HotSwap.

Good today to share this, want to know more about the public number “God comes to learn”