I upgraded a couple of machines to Ubuntu 11.04, and after the reboot, they just booted up to a grub prompt. Like this (except an older version of grub reported):
My reading seems to indicate that this happens if you upgrade from Ubuntu 10.10 which itself had been upgraded from Ubuntu 10.04, and grub was never reinstalled.
I think it is completely ridiculous that this bug made it all the way to the Ubuntu 11.04 final release — leaving the system unbootable after an upgrade is a disaster.
The easiest way to fix it is to boot from the Ubuntu 11.04 alternate install CD. Choose the option to “Repair a broken system.” Go through the prompts and choose which disk has your root file system.
After this, you may have the option to just reinstall grub — if so, do it, and reboot, and your system should be fine.
If that’s not an option, choose to start a recovery shell using your root filesystem and then run the commands
(possibly adjusting for where your root disk is). Then reboot and the machine should boot.
If it still doesn’t, go back to the recovery shell and see if your /boot directory is empty (aside from the “grub” directory). This happened to me on a machine that was set up with LVM. The /boot folder is actually stored on a different partition and you have to mount it before grub can set itself up right. Here’s the commands…
rm -Rf /boot/*
mount /dev/sda1 /boot
Of course, these may need to be adjusted depending on which disk needs grub and which partition contains /boot. You can use the GUI partition editor on the Live CD to check.
Now, hopefully your machine can boot up. What a mess. :-\
Update: May 12, 2011
dzsi posts another way to recover from this situation in the comments below. This method does not require booting from a CD.
Note that in the commands that follow, “X”, “Y”, and “Z” should be replaced with numbers/letters that represent your boot disk.
At the grub prompt, issue these commands:
linux /vmlinuz root=/dev/sdZ ro
Your machine should boot up. Start a terminal and issue these commands:
sudo grub-install /dev/sdZ
This should fix grub so that you do not have any boot trouble anymore