Linux mdadm replace disk
h1. Mdadm add new disk
Remove fail drive
mdadm --manage /dev/md0 --fail /dev/sda1 mdadm --manage /dev/md0 --remove /dev/sda1
Rescan new disks attached for i in {0..3}; do echo “- - -“ > /sys/class/scsi_host/host${i}/scan; done
Add new drive
parted /dev/sdc mklabel msdos parted /dev/sdc mkpart primary 2048s 100% parted /dev/sdc set 1 raid on parted /dev/sdc unit s p mdadm --manage /dev/md0 --add /dev/sdc1
To avoid this run mkdevicemap “/usr/sbin/grub-probe: warning: Couldn’t find physical volume `(null)’. Some modules may be missing from core image…”
grub-mkdevicemap -n
Install grub
grub-install --recheck /dev/sda update-grub
Debug with
mdadm -D /dev/md0 cat /proc/mdstat