Tag Archives: mdadm

mdadm layout

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:

mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1

dracut --force --mdadmconf /boot/initramfs-`uname -r`.img `uname -r`

Replace failing RAID disk

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.