Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So I have upgraded Ubuntu with the latest Kernel. But after the upgrade and after I rebooted Ubuntu, all I get is GRUB. How do I load Ubuntu again when all I have is GRUB?

I installed Ubuntu using wubi.

Thanks heaps for the help

share|improve this question
    
Is this wubi installation or normal installation? –  karthick87 Jan 13 '11 at 13:29
    
This is outdated I believe. Can somebody tell me how to do this on grub2? –  user226541 Dec 18 '13 at 3:40

1 Answer 1

up vote 11 down vote accepted

Using Grub

If you get to a grub prompt and the system and kernel are still installed on the partition, you can "manually" boot the system - i.e. without the help of a working grub.cfg. This also works with a grub run from live media. To this end grub includes a rudimentary command ine, which you can use to find the partition and boot the system.

find /vmlinuz

This should give you the partition like (hd0,0). You can also use the ls command to poke around the partition and see which kernels are available. The search command works similarly. You can also use tab completion.

set root=(hd0,1)

Of course, replace the parition identifier with whatever find showed you.

linux /vmlinuz root=/dev/sda1
initrd /initrd.img

Select the kernel image and initrd image, a pair which always needs to be used together. Luckily Ubuntu creates a pair of symlinks in the root directory which point to a working image and initrd. Note that you need to replace /dev/sda1 with a representation of the partition in the scheme used by the Linux kernel. Roughly, (hd0,1) corresponds to /dev/sda1; (hd0,2) corresponds to/dev/sda2;(hd1,1) corresponds to /dev/sdb1.

boot

This boots the selected kernel from the selected partition. Once you've managed to boot your system, you can use that to restore grub, as is detailed e.g. here.

Grub with Wubi

The above was premised on the assumption that Ubuntu was installed regularly, i.e. in its own separate partition. As you write, you used Wubi, which means you installed it to a large file on a Windows (NTFS) partition using a technique called "Lupin". I see no reason why this couldn't work in principle, though the process is more complicated. Here's the content of a grub.cfg based on a Wubi install:

insmod part_msdos
insmod ntfs
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set be300f9c300f5ab3
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz root=/dev/sda1 loop=/ubuntu/disks/root.disk
initrd /boot/initrd.img

You'll need to adapt this to your particular case. In this snippet, taken from a 10.10 install, the search command finds the root partition using a filesystem UUID or identifier, which you presumably don't know; you can use --file --set /ubuntu/disks/root.disk instead (here's the official documentation). This grub configuration creates a virtual disk - a "loopback device" - called loop0 which represents the contents of the "partition file", /ubuntu/disks/root.disk on your NTFS partition. With a bit of trial and error, you should be able to make this work.

share|improve this answer

protected by Community Dec 28 '13 at 14:00

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.