mdadm

Manage Linux software RAID arrays.

high risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
cat /proc/mdstat && mdadm --detail /dev/md0Check the array state before any change.
What it does

mdadm creates and manages Linux software RAID (md) arrays — RAID 0, 1, 5, 6, and 10. Used on servers without hardware RAID controllers. Key operations: creating arrays, checking sync status, replacing failed drives, and monitoring array health.

Examples
mdadm --detail /dev/md0Show RAID array status and member disks · explain & risk-check →
cat /proc/mdstatQuick RAID sync status and health overview · explain & risk-check →
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdcCreate RAID 1 mirror · explain & risk-check →
mdadm --manage /dev/md0 --fail /dev/sdb && mdadm --manage /dev/md0 --remove /dev/sdbRemove a failed disk from array · explain & risk-check →
mdadm --manage /dev/md0 --add /dev/sddAdd a replacement disk (triggers rebuild) · explain & risk-check →
Pro tip

Monitor RAID health with `mdadm --monitor [email protected] --daemonise /dev/md0` — sends email on array events. Also check `/proc/mdstat` daily in your monitoring stack.

Related
lvm lsblk dmesg
Open the full explainer →More in Disks & Filesystems

Reference text is hand-written and may be incomplete — check man mdadm for your version. Test destructive commands on a non-production system first.