In this lesson, you will learn how to identify and resolve common software RAID assembly failures caused by duplicated UUIDs or missing physical disks.
When you reboot your system, mdadm attempts to assemble your arrays by scanning disks for RAID superblocks. Sometimes, this process fails. Two common culprits are missing drives (due to hardware failure or loose cables) and UUID collisions (often caused by cloning a drive or restoring a raw image).
Handling Missing Disks
If a disk is missing, the array might enter a "degraded" state or fail to assemble entirely if too many members are absent. First, verify the status of your arrays:
cat /proc/mdstat
If you know the drive has failed or was disconnected, you can force the assembly of a degraded array using the --run flag:
sudo mdadm --assemble --run /dev/md0 /dev/sdb1
Note: Only use --run if you are certain the remaining members contain valid data.
Resolving Duplicated UUIDs
RAID arrays are identified by their UUID. If you have two arrays with the same UUID—perhaps because you copied a system partition—mdadm will get confused and refuse to start one or both. You can check the UUID of an array member with:
sudo mdadm --examine /dev/sdc1
If you identify a conflict, you must reassign a unique identity to one of the arrays. You can create a new UUID for an existing array using the --update flag during assembly:
sudo mdadm --assemble --update=uuid /dev/md1 /dev/sde1
After updating the UUID, you must update your /etc/mdadm/mdadm.conf file to reflect the change, or your system will attempt to assemble the array using the old, conflicting identifier on the next boot. Use sudo mdadm --detail --scan >> /etc/mdadm/mdadm.conf to append the correct, current configuration.
Troubleshooting Workflow
- Check
/proc/mdstatto see which devices are recognized. - Use
mdadm --examineon suspicious drives to verify the metadata is readable. - If disks are present but assembly fails, inspect
dmesg | grep mdfor specific kernel-level error messages regarding superblock version mismatches or configuration conflicts.
Key Takeaway: When arrays fail to assemble, use mdadm --assemble --run for missing members or --update=uuid to resolve identity conflicts, then always update your mdadm.conf file to persist the changes.