Master RAID 10: Step‑by‑Step Setup, Management, and Recovery on Linux
This guide explains RAID fundamentals, compares RAID levels, and provides a complete Linux‑based RAID10 tutorial—including installation of mdadm, array creation, mounting, data operations, disk failure handling, rebuilding, and removal—so administrators can confidently manage redundant storage.
What is RAID (Redundant Array of Independent Disks)
It is a large-capacity disk group formed by combining multiple independent disks (usually hard drives).
Large‑talk explanation:
RAID is many hard drives combined into one unit; different RAID levels provide different functions such as speeding up I/O or providing data backup.Functions of RAID technology
- Improves I/O capability through parallel read/write
- Increases durability via redundancy algorithms
- Provides redundancy, reducing costRAID levels and their differences
- raid0
Minimum disks: 2
Advantages: performance boost (read/write speed); data striped across disks
Disadvantages: no redundancy, data loss if a disk fails
Use cases: live streaming, IPTV, VOD edge servers
- raid1
Minimum disks: 2
Advantages: fault tolerance, simple recovery, improved read performance, data backup
Disadvantages: low usable capacity, slower writes
Use cases: standard application servers where data safety is critical
- raid5
Minimum disks: 3
Advantages: fault tolerance and I/O performance (lower than RAID0)
Disadvantages: parity overhead reduces write performance
Ideal for: file storage and application servers
- raid6
Minimum disks: 4
Advantages: higher redundancy than RAID5, better read performance
Disadvantages: parity overhead further reduces write performance
Ideal for: large file storage and application servers
- raid10 (raid1+raid0)
Minimum disks: 4
Advantages: very high performance and fault tolerance
Disadvantages: lower usable capacity/costly, limited scalability
Ideal for: heavily used database servers or workloads with intensive writes
- The main differences among RAID levels are read/write speed, fault‑tolerance, and cost.RAID0
At least two disks required.
Data is striped across disks, giving high read/write performance and 100% storage utilization.
No redundancy; a single disk failure makes data unrecoverable.
Typical scenario: high‑performance storage where data safety is not critical (e.g., audio/video).RAID1
At least two disks required.
Data is mirrored (written to both disks), providing high reliability (50% usable capacity).
Read performance is good; write performance is slower due to synchronization.
If one disk fails, the other continues to serve data.
Typical scenario: systems where data safety is paramount (e.g., mail or transaction servers).RAID10
RAID10 combines RAID1 and RAID0.
Minimum disks: 4.
Two disks form a mirrored pair (RAID1); the two pairs are striped (RAID0).
Provides both redundancy and high read/write performance.
Usable capacity is 50%; cost is higher.
If a disk fails, the array continues operating as long as the failed disk is not in the same mirrored pair.
Considered the most practical solution for many workloads.Summary of RAID levels
Hardware RAID vs. Software RAID
Hardware RAID uses a dedicated RAID controller card; it is more stable and independent of the OS.
Software RAID is implemented by the OS via software; it depends on the OS and is generally less stable.Practical RAID10 implementation (software RAID)
(1) Environment preparation
Add four disks and plan to build a RAID10 array.
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─centos-root 253:0 0 18G 0 lvm /
└─centos-swap 253:1 0 1G 0 lvm [SWAP]
sdd 8:48 0 10G 0 disk
sde 8:64 0 10G 0 disk
sdf 8:80 0 10G 0 disk
sdg 8:96 0 10G 0 disk(2) Install mdadm
# yum install mdadm -y(3) Create RAID10 array
# mdadm -Cv /dev/md0 -a yes -n 4 -l 10 /dev/sdd /dev/sde /dev/sdf /dev/sdg
mdadm: layout defaults to n2
mdadm: chunk size defaults to 512K
mdadm: size set to 10476544K
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.(4) View RAID10 information
# fdisk -l /dev/md0
Disk /dev/md0: 21.5 GB, 21455962112 bytes, 41906176 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes
# 4 disks of 10G each give ~40G raw; RAID10 uses 50% capacity, so usable space is ~21.5GB.(5) Create filesystem
# mkfs.xfs /dev/md0(6) Mount and write data
# mount /dev/md0 /md0_disk/
# df -h
# touch /yuchao-linux/超哥带你学linux.txt(7) Verify RAID10
# mdadm -D /dev/md0
Version : 1.2
Creation Time : Thu Mar 3 20:20:2022
Raid Level : raid10
Array Size : 41908224 (39.97 GiB, 42.91 GB)
Used Dev Size : 20954112 (19.98 GiB, 21.46 GB)
Raid Devices : 4
Total Devices : 4
State : clean
Active Devices : 4
Working Devices : 4(8) Remove a disk
# mdadm /dev/md0 -f /dev/sdd
mdadm: set /dev/sdd faulty in /dev/md0(9) Check degraded array
# mdadm -D /dev/md0
... State : clean, degraded
Active Devices : 3
Failed Devices : 1(10) Re‑add the failed disk
# umount /dev/md0
# reboot
# mdadm -a /dev/md0 /dev/sdd
mdadm: added /dev/sdd
# mdadm -D /dev/md0
... State : clean, degraded, recovering
Rebuild Status : 6% complete(11) Final recovery
# mdadm -D /dev/md0
... State : clean
Active Devices : 4
Working Devices : 4(12) Delete software RAID
# umount /dev/md0
# mdadm -S /dev/md0
mdadm: stopped /dev/md0
# mdadm --misc --zero-superblock /dev/sdb
# mdadm --misc --zero-superblock /dev/sdc
# mdadm --misc --zero-superblock /dev/sdd
# mdadm --misc --zero-superblock /dev/sde
# rm -f /etc/mdadm.conf
# edit /etc/fstab to remove the md0 entrySigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Raymond Ops
Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
