Linux software RAID keeps running when a disk fails, but without redundancy. Replace the disk soon, before a second one fails.
Check the state
cat /proc/mdstat mdadm --detail /dev/md0
[UU] is healthy; [U_] means one member is missing. mdadm --detail shows which.
Replace a failed disk
- Find the serial number of the failed disk (
smartctl -i /dev/sdborls -l /dev/disk/by-id/), so the datacenter swaps the right one. - Mark it failed and remove it from every array it's in:
mdadm /dev/md0 --fail /dev/sdb1 --remove /dev/sdb1
- Have the disk replaced. See Requesting remote hands: what to include.
- Copy the partition table from the healthy disk to the new one (GPT):
sgdisk -R /dev/sdb /dev/sda && sgdisk -G /dev/sdb
- Add the new partitions back:
mdadm /dev/md0 --add /dev/sdb1
- Watch the rebuild in
/proc/mdstat. - If the system boots from this RAID, reinstall the bootloader on the new disk (
grub2-installorgrub-install, or recreate the EFI partition).
Double-check device names before every command. Removing the wrong disk from a degraded array loses data. If you're not sure, stop and call us.