Software RAID on Linux with mdadm

mdadm is Linux’s software RAID tool — genuinely capable, and a solid option when hardware RAID controllers aren’t available or you want more portable, controller-independent redundancy.

sudo apt install mdadm

# Create a RAID 1 (mirror) array from two disks
sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc

# Check array status
cat /proc/mdstat
sudo mdadm --detail /dev/md0

# Format and mount it like any normal device
sudo mkfs.ext4 /dev/md0
sudo mount /dev/md0 /mnt/raid

# Save the config so the array reassembles correctly on reboot
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
sudo update-initramfs -u

Replacing a Failed Disk

sudo mdadm /dev/md0 --fail /dev/sdc --remove /dev/sdc
# physically replace the disk, then:
sudo mdadm /dev/md0 --add /dev/sdc
# array automatically begins rebuilding onto the new disk

Software RAID via mdadm has genuinely matured to the point of being production-viable for many workloads, though for the absolute highest I/O performance under heavy load, a dedicated hardware RAID controller with its own cache and battery backup still has a real edge.