Mac – How to permanently fix a GRUB partition off by one error

grubmacbook promulti-bootrefit

I have a MacBook Pro set up to triple boot with rEFIt and GRUB. (I had to go through GRUB to get Windows 7 to boot, but that's tolerable.) I upgraded to Lion which added a new partition for the recovery feature. This also causes GRUB to boot to a rescue prompt. Running set shows:

prefix=(hd0,gpt5)/boot/grub
root=hd0,gpt5

If I run the following commands:

set prefix=(hd0,gpt6)/boot/grub
set root=(hd0,gpt6)
insmod normal
normal

the usual GRUB menu shows up and I can boot into whichever OS I want. I got into the Ubuntu partition and checked out the grub.cfg file and it was setting the root to gpt5. I ran the sudo update-grub command. This changed the value in the cfg file to gpt6. However GRUB still boots into the rescue prompt and set still shows the initial root and prefix values. How do I make this permanent?

Best Answer

Grub is probably dropping to the console because the partition layout has changed since grub was first installed. Now that you have updated grub.cfg, re-installing grub should fix it. Boot into your ubuntu system the same way you did in order to run update-grub. From there, do a grub-install:

grub-install /dev/sdX

(Replacing X with your device, in your case it looks like it is probably /dev/sda.)

Related Question