Ubuntu – Ubuntu 12.04 upgrade: Grub update-grub fails after update

11.1012.04grub2

Thanks in advance for any help.

I'm running Ubuntu and Windows 7 on separate partitions with a large storage drive to share files between them.

fdisk -l shows:

Device Boot         Start         End      Blocks   Id  System
/dev/sda1   *        2048   209717247   104857600    7  HPFS/NTFS/exFAT
/dev/sda2       209717248   419432447   104857600   83  Linux
/dev/sda3       419432448  3907028991  1743798272    b  W95 FAT32

There's a second GPT backup disk, but it shouldn't be a problem.

Device Boot         Start         End      Blocks   Id  System
/dev/sdb1               1  4294967295  2147483647+  ee  GPT

I've just upgraded my 11.10 Ubuntu to 12.04, during the upgrade I got an error about grub being installed on a partition, which I recognised from installing 11.10 and ignored.

However, having completed the upgrade all the Ubuntu entries have disappeared from grub. There are a few linux 3 entries, which don't work and my Windows 7 entry, which I didn't try but I presume still works.

I've booted up the 11.10 live cd and i've tried following this:

http://opensource-sidh.blogspot.com/2011/06/recover-grub-live-ubuntu-cd.html

however when I get to the part where I run

update-grub

I get

/etc/grub.d/00_header: 28: .: Can't open /usr/share/grub/grub-mkconfig_lib

I had similar problems when I installed 11.10 but I can't remember how I fixed them >_<

Any advice on what to try next?

Best Answer

This is apparently a bug in Ubuntu. Package grub-common contains the missing file but in another place. I added a symbolic link to allow the file to be found.

I ran this command:

ln -s /usr/lib/grub/grub-mkconfig_lib /usr/share/grub/grub-mkconfig_lib

Afterwards update-grub succeeded.