Ubuntu 11.04 Upgrade…won’t boot – GRUB prompt


Aftert upgrading to Ubuntu 11.04 my server would not boot. It looks like there is a bug in the update such that if you upgrade from Ubuntu 10.10 which itself had been upgraded from Ubuntu 10.04, and grub was never reinstalled then you just get a GRUB prompt after bootup.

To fix this you need to manually boot the system using grub commands. Then reinstall grub. For me the following worked

set root=(hd0,1)
linux /boot/vmlinux-2.6.38-8-generic root=/dev/sda1 ro
initrd /boot/initrd.img-2.6.38-8-generic
boot

Once booted then run

sudo grub-install /dev/sda
sudo update-grub

And then it should all reboot nicely

,

17 responses to “Ubuntu 11.04 Upgrade…won’t boot – GRUB prompt”

  1. It’s not working for me. This a VMWare ubuntu updated from 10.10 to 11.04. Upgrade went perfect (no errors). After reboot, just got grub prompt.

    When issuing “linux /boot/vmlinux-2.6.38-8-generic root=/dev/sda1 ro” i get “file not found” error

    any ideas?

    ls command reports: (Linux-swap_1) (Linux-root) (hd0) (hd0,5) (hd0,1) (fd0)

    Disk type in VM is SCSI 0:0

    Thanks

  2. Figured something out…

    set root=(hd0,1)
    linux /mvlinuz-2.6.38-8-server root=/dev/sda1 ro
    initrd initrd.img-2.6.38-8-server
    boot

    It then starts booting but then starts throwing a lot of mounting errors.

    sda1 seems to be the boot partition and sda5 is the root, but the filesystem type is reported as LVM2.

    I tried putting sda5 in the linux command above, but still had same kind of errors.

    Using a 10.10 live cd, I tried “grub-install /dev/sda”, but got a permission error. Tried “sudo grub-install /dev/sda” and got “cannot find a device for /boot/grub (is /dev mounted?).

    I cannot mount sda5. It gives me “unknown filesystem type ‘LVM2_member’

    I’m at a complete loss. I guess I may have to do a full install and then import my mysql databases (i did make a backup). mysql is all this linux machine is used for.

  3. Awsome! Thanks for the reply.

    I searched as you suggested about ununtu grub lvm and after reading several pages, I figured out that my root is /dev/dm-0

    I plugged that into the original instructions and it booted perfectly. Then did the grub install and rebooted.. All is good.. THANK YOU THANK YOU.

  4. I having the same problem after upgrading from 10.10 to 11.04 grub> console prompt don’t know what to do next
    VMware Workstation 7.1.5. I am using but unable to figure out bug in it.. So kindly help with regards to this.. Thanks

  5. The above post almost worked for me.

    Before running:
    linux /boot/vmlinux-2.6.38-8-generic root=/dev/sda1 ro

    do this
    ls (hd0,1)/boot

    It will list the names of the files in /boot. My kernel was named differently than in the blog post (vmlinuz, not vmlinux, and had different dash numbers). Same with initrd.img.*. When I substituted the correct kernel and initrd file names, the instructions worked.

    I didn’t have a /dev/sda1, so I feared that might not be right, but I tried it and it worked anyway.

  6. I’m having the same issue. I got as far as what Jim posted. But now the initrd command won’t work. I run:

    set root=(hd0,1)
    linux /boot/vmlinuz-2.6.32-41-generic root=/dev/sda ro
    initrd initrd.img-2.6.32-41-generic

    And I get
    “Error: invalid file name `initrd.img-2.6.32-41-generic’.”
    Even though it’s listed when I run ls (hd0,1)/boot
    Any ideas? I’ve tried setting to “sda1” and using the other initrd and vmlinuz listed

    Thanks

  7. Oops forgot the /boot in front of initrd.img. However, when boot is pressed it’s followed by scrolling gibberish. Am I toast at this point? This is on a VM

  8. ok one of the kernels worked…just needed a little patience on one of the scrolling gibberish screens. 🙂

    However, it first booted to an initramfs prompt. I ran reboot and then it came back to the illustrious grub> prompt. Then I switched the path to disk to /dev/sda1 instead of sda and that worked like a charm. So the sda does matter. Just so you know.

    Have a nice day.

  9. Thankyou thankyou thankyou!
    Another day of my life wasted on Ubuntu is finally sorted.
    I need to learn “just say no” to upgrades in future for the sake of my sanity (and my wife!).
    I had the same problem with Linuz vs Linux but the ls command worked a treat.
    Thanks once again!

  10. You are amazing!

    Was running ubuntu in virtualbox, and OK’d some sort of “partial” upgrade of ubuntu without thinking.

    Then next time I started up, virtualbox wanted to upgrade too, so I OK’d that too, and started my virtual machine…

    And then all was broken and I got sad because of this unfamiliar “grub” prompt with no boot options 🙁 I had no clue and no idea even which upgrade might have caused the problem. Was getting ready to remove the ubuntu and make a new one, when I found your instructions.

    Which worked perfectly, hooray!

    For other people like me who have no idea how to use grub:

    tabbing gives lists of possible files (so linux /boot/tab will give you a list of good suspects for what you want here).

    Also, like Jim, I didn’t see an “sda1” listed, but typing it still worked.

    Time wasted looking for a solution at ubuntu and virtualbox – lots. Time saved because I don’t have to reinstall my programs and perl modules on a new virtual machine – lots.

    Thankyou!

  11. Thanks for this post, Rob. I am using Ubuntu version 12.04.1 as a virtual machine on VMware, host machine runnnig Windows 7. I had the same issues of vmlinuz instead of vmlinux and numbers, but also the first command root=(hd0,1) didn’t work for me, instead I pressed tab after “hd” and it showed (hd0,msdos1), which worked fine.

Leave a Reply

Your email address will not be published.