Interview Prep/Linux/Storage, disks and filesystems

You need software RAID 1 across two disks on a bare-metal server. How do you build and monitor it?

IntermediateScenarioStorage, disks and filesystems
Answer

Situation read → mdadm mirror.

What I'd do →

sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc
cat /proc/mdstat
sudo mkfs.xfs /dev/md0
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm.conf   # /etc/mdadm/mdadm.conf on Debian
sudo dracut -f      # or update-initramfs -u

Enable alerts: set MAILADDR [email protected] in mdadm.conf and run mdmonitor.

Why → Saving the array config and rebuilding initramfs makes the array assemble at boot with the same name.

Interview tip → "RAID is not a backup" is the line interviewers want to hear.

All Linux questions Roadmap: Linux

More on Storage, disks and filesystems