Create, monitor and recover software RAID arrays quickly with a single, powerful tool. 09.04.2026 | reading time: 2 min Software RAID on Linux lives in the md subsystem and mdadm is the Swiss Army knife to build, inspect and repair those arrays, so learn how to run it and recover from failures before a disk surprises you. Quick RAID1 example Create two loopback devices, build a mirrored array and inspect its status with these commands: ``` sudo fallocate -l 100M /tmp/disk1.img sudo fallocate -l 100M /tmp/disk2.img sudo losetup --find --show /tmp/disk1.img # e.g. /dev/loop0 sudo losetup --find --show /tmp/disk2.img # e.g. /dev/loop1 sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/loop0 /dev/loop1 cat /proc/mdstat sudo mdadm --detail /dev/md0 ``` Simulate failure and recover Force a device out, remove it and then re-add a replacement to rehearse recovery: ``` sudo mdadm /dev/md0 --fail /dev/loop1 sudo mdadm /dev/md0 --remove /dev/loop1 # attach a fresh device or reuse the same loop image sudo losetup --find --show /tmp/disk2.img # new /dev/loop2 sudo mdadm /dev/md0 --add /dev/loop2 cat /proc/mdstat sudo mdadm --detail /dev/md0 ``` Manage, monitor and persist configuration Keep the array known to the system and get alerts: scan and append to mdadm config, run the monitor daemon, and use grow/reshape when needed: ``` sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf sudo systemctl enable --now mdadm-monitor sudo mdadm --monitor --scan --mail=root@localhost # resize example: sudo mdadm --grow /dev/md0 --raid-devices=3 ``` When software RAID is the right choice Choose mdadm when you want flexible RAID levels, easy recovery on generic hardware and transparent integration with LVM and filesystems; do not treat RAID as a backup, and test rebuilds and boot-time assembly in a safe lab first. Next steps Practice building arrays, simulate disk loss, and automate monitoring so mdadm becomes second nature; for structured study consider advancing Linux skills and certification preparation at bitsandbytes.academy to solidify system administration knowledge. Join Bits & Bytes Academy First class LINUX exam preparation. storage filesystem utilities setup troubleshooting