My boot partition was so small that I couldn’t do any initramfs-updates any more, so I backed it up, deleted /dev/md0 (boot) and /dev/md1 (swap) to recreate both with new sizes, restored my backup, and after a reboot grub couldn’t find anything due to the new UUIDs of the partitions.
Before I rebooted, I should have merged the output of `mdadm -Es` into /etc/mdadm/mdadm.conf, followed by
# update-grub
# grub-install /dev/sda
# grub-install /dev/sdb
Instead, I had to go through this:
At grub rescue prompt:
> ls (md/md0)/
> set root=(md/md0)/
> set prefix=(md/md0)/grub
> insmod linux
> linux (md/md0)/vmlinuz-3.11.0-13-generic
> initrd (md/md0)/initrd.img-3.11.0-13-generic
> boot
... bringing me to a BusyBox/initramfs emergency prompt:
# ls /tmp
# cd /tmp
# mkdir disk
# mount /dev/md2 disk # root directory
# chroot disk
... bringing me to a simple bash prompt in my system:
# mount /boot
... as well as:
# mount /proc
# mount /sys
# mount /dev
... to be able to run:
# update-grub
# grub-install /dev/sda
# grub-install /dev/sdb
You wouldn’t learn much if you weren’t forced to fix things once in a while. — myself