Home  >  Article  >  Operation and Maintenance  >  What does raid mean in linux?

What does raid mean in linux?

WBOY
WBOYOriginal
2022-07-11 16:29:221863browse

In Linux, RAID means "Redundant Array of Inexpensive Disks"; RAID is the abbreviation of "Redundant Array of InexpensiveDisks". The basic idea is to combine multiple cheap small disks together, called a Disk group, enabling performance equal to or exceeding that of a large, expensive disk.

What does raid mean in linux?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What does raid mean in Linux

RAID (Redundant Array of InexpensiveDisks) is called a redundant array of cheap disks. The basic idea of ​​RAID is to combine multiple cheap small disks together into a disk group, so that the performance can reach or exceed that of a large-capacity, expensive disk.

Currently RAID technology is roughly divided into two types:

Hardware-based RAID technology and software-based RAID technology.

The RAID function can be realized through the built-in software under Linux, which saves the need to purchase expensive hardware RAID controllers and accessories and greatly enhances the IO performance and reliability of the disk.

Because the RAID function is implemented using software, it is flexible in configuration and easy to manage. Using software RAID at the same time, you can also merge several physical disks into a larger virtual device to achieve performance improvement and data redundancy.

Of course, hardware-based RAID solutions are slightly better than software-based RAID technology in terms of usage performance and service performance, which are specifically reflected in the ability to detect and repair multi-bit errors, automatic detection of error disks, and array reconstruction. . This section will describe in detail how to create and maintain software RAID on the Red Flag Linux server.

Extended knowledge

Introduction to RAID levels

With the continuous development of RAID technology, there are now RAID 0 to There are seven basic RAID levels of RAID 6, as well as a combination of RAID 0 and RAID 1, called RAID 10. The level does not represent the level of technology, and RAID 2 and RAID 4 are basically no longer used, while RAID 3 is rarely used because it is too complicated to implement. Currently, these commonly used RAID levels are supported by the Linux kernel. This section takes the Linux 2.6 kernel as an example. The software RAID in the Linux 2.6 kernel can support the following levels: RAID 0, RAID 1, RAID 4, RAID 5 and RAID 6. wait. In addition to supporting the above RAID levels, the Linux 2.6 kernel can also support LINEAR (linear mode) soft RAID. Linear mode combines two or more disks into one physical device. The disks do not have to be the same size. When writing to the RAID device disk A is filled first, then disk B, and so on.

RAID 0

is also called striped mode (striped), which spreads continuous data to multiple disks for access, as shown in Figure 1. When the system has a data request, it can be executed by multiple disks in parallel, and each disk executes its own part of the data request. This kind of parallel operation on 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 will increase, which is often the main reason to run RAID 0. But RAID 0 has no data redundancy, so if a drive fails, no data can be recovered.

RAID 1

RAID 1 is also called mirroring (Mirroring), a mode with full redundancy, as shown in Figure 2. RAID 1 can be used for two or 2xN disks, and uses 0 or more spare disks. Every time data is written, it is written to the mirror disk at the same time. This type of array is highly reliable, but its effective capacity is reduced to half of the total capacity, and the disks should be of equal size, otherwise the total capacity is only the size of the smallest disk.

RAID 4

Three or more disks are required to create RAID 4, which stores parity information on one drive and writes the data in RAID 0 mode. Insert other disks, as shown in Figure 3. Because one disk is reserved for parity information, the size of the array is (N-l)*S, where S is the size of the smallest drive in the array. Just like in RAID 1, the disks should be equal in size.

If a drive fails, the checksum information can be used to rebuild all data. If both drives fail, all data will be lost. The reason this level is not often used is that the checksum information is stored on a drive. This information must be updated every time another disk is written. Therefore, when writing a large amount of data, it is easy to cause a bottleneck in the verification disk, so this level of RAID is rarely used at present.

RAID 5

RAID 5 is probably the most useful RAID mode when you want to combine a large number of physical disks and still retain some redundancy. RAID 5 can be used with three or more disks and uses zero or more spare disks. Just like RAID 4, the size of the resulting RAID5 device is (N-1)*S.

The biggest difference between RAID5 and RAID4 is that the parity information is evenly distributed on each drive, as shown in Figure 4, thus avoiding the bottleneck problem that occurs in RAID 4. If one of the disks fails, all data remains intact thanks to the parity information. If a spare disk is available, data synchronization will begin immediately after a device failure. If both disks fail at the same time, all data is lost. RAID5 can survive the failure of one disk, but not the failure of two or more disks.

RAID 6

RAID 6 is an extension of RAID 5. Like RAID 5, data and checksums are divided into data blocks and stored on each hard disk of the disk array. Only a check disk is added to RAID 6 to back up the check codes distributed on each disk, as shown in Figure 5. In this way, the RAID 6 disk array allows two disks to fail at the same time, so the RAID 6 disk array has the least Four hard drives are required.

Recommended learning: Linux video tutorial

The above is the detailed content of What does raid mean in linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn