CompTIA Linux+ (XK0-006)TroubleshootingHard

An administrator runs `mdadm --detail /dev/md0` on a RAID 5 array and sees: State : clean, degraded Active Devices : 2 Working Devices : 2 Failed Devices : 1 ... 2 8 33 - removed A new replacement disk has been partitioned as /dev/sdc1. Which command correctly adds this disk back into the array to begin rebuilding?

  1. Amdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdc1
  2. Bmdadm --grow /dev/md0 --raid-devices=4
  3. Cmdadm --manage /dev/md0 --add /dev/sdc1
  4. Dmdadm --assemble /dev/md0 /dev/sdc1
Show answer & explanation

Correct answer: C. mdadm --manage /dev/md0 --add /dev/sdc1

mdadm --manage --add hot-adds a spare disk to an existing degraded array, triggering an automatic rebuild/resync using parity data from the remaining active devices. --create would destroy the existing array metadata, --assemble is for reconstructing an array from its member devices after a reboot, and --grow changes the number of active devices in size/configuration rather than replacing a failed member.

Why the other options are wrong

  • A. --create would wipe superblocks and initialize a brand-new array, destroying existing data.
  • B. --grow changes array size/device count parameters; it isn't used to replace a failed disk.
  • D. --assemble is used to reactivate an array from existing member disks, not to add a new replacement disk.

RAID Rebuild with mdadm

When a RAID member fails, mdadm --manage --add hot-adds a replacement disk, and the array automatically rebuilds redundancy using parity or mirror data from surviving members.

  • Check status: mdadm --detail /dev/mdX or cat /proc/mdstat
  • Add replacement: mdadm --manage /dev/mdX --add /dev/sdXN
  • Monitor rebuild progress via /proc/mdstat percentage

Memory trick: Add the new puzzle piece back in — mdadm rebuilds the picture from parity.

More Troubleshooting questions