RAID (Redundant Array of Independent Disks) combines multiple disks into a disk array in order to improve data read and write performance and reliability. Meanwhile, the operating system will use the disk array as a single hard disk. RAID has multiple levels at present. The following will introduce RAID0, RAID1, RAID01 and RAID10. Depending on the level of RAID, the disk array offers improvement benefits in data integration, fault tolerance, and throughput or capacity compared with a large hard disk with considerable capacity.
Note:
- please renew your elastic cloud disk that is about expire to avoid impact on your RAID array due to forced isolation of the disk.
- We recommend you use partitions of the same size when creating RAID 1, RAID 01, and RAID 10 for minimal waste of disk capacity.
The following is a comparison of different RAID levels:
RAID Level | Description | Pros and Cons | Scenarios (Recommended) |
---|---|---|---|
RAID 0 | Storage mode: Data are striped and stored in different disks. Virtual disk size: the combined capacity of all disks in the array. |
Require a higher level of I/O performance, and have backed up data through other means or there is no need for data backup. | |
RAID 1 | Storage mode: Data are stored through image memory into disks. Virtual disk size: depends on the capacity of the disk with the smallest one in the array. |
Require high read performance and backups of written data. | |
RAID 01 | First deal with data through RAID0, then RAID1. |
|
- |
RAID 10 | Build RAID 1 with multiple disks, and then build RAID 0 with more than one RAID 1. |
|
The following describes how to build RAID 0 on CentOS by using 4 Tencent Cloud elastic cloud disks. The operation may vary for different operating systems (OS) and RAID levels. Since this document is for reference only, for detailed instructions and differences, please see the product documentation for a specific OS or relevant RAID documents.
Linux kernel provides a MD module that manages RAID devices, so you may create RAID 0 by directly calling this module using the mdadm tool.
yum install mdadm -y
success result is as shown below:mdadm --create /dev/md0 --level=0 --raid-devices=4 /dev/vd[cdef]1
success result is as shown below:mkfs.ext3 /dev/md0
success result is as shown below:mkdir md0/
mount /dev/md0 md0/
tree md0
success result is as shown below:c5d8a204:c28853ba:3882e9f8:62d078de
as an example) as shown below:mdadm --detail --scan
vi /etc/mdadm.conf
DEVICE /dev/disk/by-id/virtio-ID of elastic cloud disk 1-part1
DEVICE /dev/disk/by-id/virtio-ID of elastic cloud disk 2-part1
DEVICE /dev/disk/by-id/virtio-ID of elastic cloud disk 3-part1
DEVICE /dev/disk/by-id/virtio-ID of elastic cloud disk 4-part1
ARRAY logical device path metadata= UUID=
Assume the logical device path is /dev/md0 and metadata is 1.2, and you should enter:DEVICE /dev/disk/by-id/virtio-ID of elastic cloud disk 1-part1
DEVICE /dev/disk/by-id/virtio-ID of elastic cloud disk 2-part1
DEVICE /dev/disk/by-id/virtio-ID of elastic cloud disk 3-part1
DEVICE /dev/disk/by-id/virtio-ID of elastic cloud disk 4-part1
ARRAY /dev/md0 metadata=1.2 UUID=3c2adec2:14cf1fa7:999c29c5:7d739349
:wq
to save and exit.
Was this page helpful?