- Documentation
Elastic Compute Service
Elastic Compute Service
Best Practices
Volume
Setting up RAID (Linux)
Volume
Setting up RAID (Linux)
Setting up RAID (Linux)
This topic explains how to set up RAID arrays on your Linux instance, using RAID 10 as an example.
RAID stands for Redundant Array of Independent Disks. It is a technology that combines multiple disks into an array. RAID allows systems to deliver higher performance, greater data reliability, and improved availability. RAID operates at different levels, each with a distinct data distribution and redundancy strategy. Common RAID levels include RAID 0, which improves read/write performance; RAID 1, which uses mirroring; RAID 5, which balances performance and data redundancy; and RAID 10, which combines the advantages of RAID 1 and RAID 0.
- Before you begin, back up your data. Creating a RAID array may initialize your volumes, which could result in data loss.
- A system volume stores the operating system and critical system files, which are essential for startup and operation of the system. Therefore, it is not recommended to set up RAID with system volumes.
- To ensure optimal performance and compatibility, we recommend using data volumes of the same capacity and specifications to create a RAID array.
- Image: CentOS Stream 9 64-bit.
- Storage: Four 20-GiB ESSD data volumes attached to the instance.
- Network: An Elastic IP Address (EIP) associated with the instance.
- Get information about block devices.
- The example output shows that the instance has four data volumes attached with the following device names: "dev/vdb", "dev/vdc", "dev/vdd", and "dev/vde".
-
- Create a RAID array with mdadm.
tip
mdadm stands for "multiple devices admin". It is a Linux utility used to manage software RAID devices. This simple yet powerful application is compatible with almost any RAID level.
-
- Create a RAID array. To create an array called "/dev/md0", for example, run the following command:
tip
Creating the array takes a long time. The exact time depends on the size of the volumes. Although the entire process requires no manual intervention, you must not shut down or restart the instance during this time. Recovering an array is much more complex than creating it for the first time.
- --create /dev/md0: The device name of the RAID array. This example uses "/dev/md0".
- --level=10: The RAID level. This example creates a RAID 10 array.
- --raid-devices=4: The number of volumes in the RAID array. This example uses four volumes.
- /dev/vd[bcde]: The names of the devices that participate in the array, which are separated by spaces.
- --chunk=512: The chunk size of the RAID array. This example uses 512 KB. Based on the workload type, the following chunk sizes are recommended:
- For general-purpose workloads, a chunk size of 64 KB or 128 KB provides balanced read/write performance.
- For sequential read workloads, such as video editing or large file transfers, a larger chunk size (256 KB or 512 KB) may offer better performance.
- For random read workloads, such as database applications, a smaller chunk size (e.g., 32 KB) may be preferable.
- The example output indicates that the RAID 10 array has been successfully started.
-
- You will see output similar to the following:
-
- Create a file system on the RAID array. This example creates an ext4 file system. You can create other types of file systems based on your needs.
-
- Create a mount directory. To create a mount directory called "/mnt/raid10", for example, run the following command:
- Mount the RAID array on /mnt/raid10.
- Verify the mount result.
-
- If successful, the command returns output similar to the above.
Last updated: 2026.10.19 19:41:53