To run a “sync” check:
echo check > /sys/block/mdX/md/sync_action
To run a “repair” check:
echo repair > /sys/block/mdX/md/sync_action
So you’ve grown, shrunk, or reshaped your array and after rebooting, it just won’t continue booting correctly? You likely forgot to update the cached mdadm.conf in the initramfs image. Luckly this is easy.
First, we have to fix your boot issue. Reboot and when you see the grub menu, hit a key. This will take you to an interactive mode. Go ahead and edit the kernel line and change the end of it from ‘rhgb quiet’ to ‘rdshell’. Go ahead and boot that configuration. It will still fail, but rather then stopping forever, it will give you a shell. You now have to manually assemble the array by hand. Example:
dracut --force --mdadmconf
mdadm –examine /dev/sd* | grep -E “(^\/dev|UUID)”
mdadm –create /dev/md1–metadata=0.9 –level=1 –raid-disks=2 missing /dev/sdb2
If your /dev/sda disk are failing, you should replace it with new one. You server should support hot swapping:
mdadm –manage /dev/md0 –fail /dev/sda1
mdadm –manage /dev/md0 –remove /dev/sda1
this will copy partition table:
sfdisk -d /dev/sdb |sfdisk --force /dev/sda
mdadm -a /dev/md0 /dev/sda1
if you have more partitions, you should repeat that steps with sda2, sda3 and etc.