Complete mdadm (RAID) keyboard shortcuts and commands reference — 13 shortcuts across 1 category. Quick reference cheat sheet for Windows & Mac.
mdadm manages Linux software RAID, and this page lists the commands for creating an array, replacing a failed disk and keeping the configuration so the array assembles at boot. The notes follow the replacement sequence — fail, remove, add — which is the operation people do under stress, and the persistence step that is forgotten until a reboot.
| Shortcut | Action | Description |
|---|---|---|
| mdadm --detail /dev/md0 | RAID detail | Show RAID array details. |
| cat /proc/mdstat | RAID status | Check RAID status. |
| mdadm --create /dev/md0 --level=1 --raid-devices=2 | Create RAID | Create RAID1 array. |
| mdadm --add /dev/md0 /dev/sdc | Add disk | Add disk to array. |
| mdadm --fail /dev/md0 /dev/sdb | Fail disk | Mark disk as failed. |
| mdadm --stop /dev/md0 | Stop array | Stop a running RAID array. |
| mdadm --assemble --scan | Assemble arrays | Assemble all arrays found in the config or superblocks. |
| mdadm --remove /dev/md0 /dev/sdb | Remove disk | Remove a failed disk from the array. |
| mdadm --detail --scan >> /etc/mdadm/mdadm.conf | Save config | Persist array configuration for boot-time assembly. |
| mdadm --grow /dev/md0 --raid-devices=3 | Grow array | Change the number of active devices in the array. |
| mdadm --examine /dev/sdb | Examine disk | Show RAID superblock metadata on a member disk. |
| echo check > /sys/block/md0/md/sync_action | Start check | Trigger a consistency check of the array. |
| mdadm --monitor --daemonise /dev/md0 | Monitor array | Run background monitoring with email alerts. |
The most essential mdadm (RAID) shortcuts are: mdadm --detail /dev/md0 (RAID detail), cat /proc/mdstat (RAID status), mdadm --create /dev/md0 --level=1 --raid-devices=2 (Create RAID).
These are command-line commands — type them in your terminal or console. Combine them with shell history search (Ctrl + R) and aliases to work even faster.
The mdadm (RAID) shortcut for raid detail is mdadm --detail /dev/md0. Show RAID array details.
Print the mdadm (RAID) cheat sheet and keep it next to your keyboard for the first week, then switch to active recall: open Shortcut Speedrun and practice mdadm (RAID) shortcuts against the clock until they're automatic.
Yes — use My Stack to combine mdadm (RAID) shortcuts with any other platform on this site into one printable reference, which is useful if your daily workflow spans several tools.
cat /proc/mdstat is the quickest view: every array, its level, which devices are active and any rebuild in progress with a percentage. mdadm --detail /dev/md0 gives the full picture for one array — state, UUID, per-device role and the count of failed devices — and mdadm --examine /dev/sdb reads the RAID superblock on a single disk, which tells you what array a disk from a dead machine belonged to. echo check > /sys/block/md0/md/sync_action starts a consistency check; distributions schedule this monthly. mdadm --monitor --daemonise /dev/md0 watches for failures and sends mail.
When a disk fails, or before pulling one, mdadm --fail /dev/md0 /dev/sdb marks it faulty and mdadm --remove /dev/md0 /dev/sdb takes it out of the array. Install the new disk, partition it to match, and mdadm --add /dev/md0 /dev/sdc adds it; the rebuild starts immediately and /proc/mdstat shows progress. mdadm --grow /dev/md0 --raid-devices=3 changes the device count to reshape an array, which is slow and should be done with a backup.
mdadm --create /dev/md0 --level=1 --raid-devices=2 followed by the device names builds an array (level 1 mirror, 5, 6, 10). It will not survive a reboot reliably until mdadm --detail --scan >> /etc/mdadm/mdadm.conf records it (path varies by distribution) and the initramfs is updated; mdadm --assemble --scan assembles every array the config or superblocks describe, and mdadm --stop /dev/md0 stops one so its disks can be moved.
Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"