Once in while you gotta upgrade your system which indicates a new run of update-grub plus installing it fresh in case of dpkg-reconfigure call. Once in a while you will recognize that this leads into interesting fuckups. In my case, accidently tried to install grub2 onto a mapped raid1 volume next to the 2 pyhsical devices. I would have expected an error, but no, nothing happened. Instead, on reboot, grub-rescue was telling me that the UUID provided is not valid. Guess what, that error unveils a lot of google entries. Speaking of the most – boot your live cd and fix grub. But fix what?

First off, the “set root=” is not only done for the linux entry, but as well for the search. Setting GRUB_DISABLE_LINUX_UUID=true in /etc/default/grub won’t help here, because grub-mkconfig ignores that entry while generating grub.cfg – editing those entries by hand, exporting to a custom config, being loaded within 40_* – well also possible. Most likely there’s more bug hell in there – as partman does not like md’s in current 3.2 kernels and hangs on partitioning during install – but still the best way out there is – purge and reinstall.

Luckily this is rather simple, once you got a live cd to boot. After startup, open a terminal, and get root. Mount the volume into /mnt/temp

$ sudo su -
# mkdir /mnt/temp
# mount /dev/mapper/ /mnt/temp

Mount all needed stuff

# for i in /dev /dev/pts /proc /sys; do mount -B $1 /mnt/temp$i; done

Get into the chroot.

# chroot /mnt/temp

Now verify that internet connection is working, plus all the mounts set (in case you got /var etc on different partitions).

# mkdir /run/resolvconf/
# vim /run/resolvconf/

# mount -a

Then try an apt-get update.

# apt-get update

Now completely wipe grub2 from your chroot, when asked to delete configs, as well.

# apt-get purge grub grub-pc grub-common

Reinstall the grub packages. When asked only install to physical decides, not volumes nor partitions!

# apt-get install grub-pc grub-common

Update grub files – should have happened automatically, but anyways.

# update-grub

Exit the chroot and unmount stuff.

# exit

# for i in /dev/pts /dev /sys /proc; do umount /mnt/temp$1 ; done

Reboot your system and verify everything loaded ok.

An alternate method instead of purge and reinstall will be calling dpkg-reconfigure grub-pc which will allow to (re)set the grub config.

%d bloggers like this: