Ubuntu Booting Issues

This guide will help you troubleshoot booting issues. It assumes you've already installed Ubuntu successfully and it later isn't booting.
If you just installed Ubuntu then click on Post-Install Booting Issues.
If you've just updated Windows and Ubuntu has stopped booting click on Reinstalling Grub.

Getting the Grub Screen

Holding shift when the PC starts, or sometimes Esc, should bring up grub.
If it's not appearing, then try to enter the BIOS Settings, and set the disk that has Ubuntu as the first disk in the boot order if using CSM Legacy.
If you're using UEFI then see if Ubuntu is first in the UEFI list.
If these do not help, then grub might be removed from the disk and needs to be reinstalled. Click on Reinstalling Grub.

Using a Live USB

If you have a Live USB, it's easy to boot it and chroot to reinstall grub.
If you don't have a Live USB click on Making and Booting a Live USB
Then click on Reinstalling Grub

If you're unable to make a Live USB you still might be able to boot and fix the install following the guide below.

Booting from Grub

If you get a "grub>" prompt then you can boot the Ubuntu install from there.
If you don't get a grub> prompt, pressing C should give you one.

type ls

It should show the list of devices and partitions similar to the picture below
Try listing the files in the various partitions by typing ls (hdX,Y)/ replacing X and Y with the disk and partition such as ls (hd0,msdos1)/

You're looking for the root filesystem that contains /bin /sbin ... similar to the picture below
When you find the root partition, type set root=(hdX,Y) replacing X and Y with your partition.

You also need to find the kernel and initrd images found in the /boot directory.
Often the /boot directory is part of the root filesystem.
Try ls /boot to see if the vmlinuz- initrd- images are there. If they are, you should see something similar to below.

If you don't find them skip this part and continue below. If you find them, type ls (hdX,Y) replacing X and Y with that of the root partition to get the UUID. You'll need it in the next step.

type linux /boot/vmlinuz and press TAB to complete the filename, you want the newest kernel and continue typing root=UUID=<UUID from above here>

such as linux /boot/vmlinuz-4.4.0-116-generic root=UUID557c9df7-7f08-4da3-9576-12ad285b469c

type initrd /boot/initrd and also use TAB completion to select the initrd file that matches the vmlinuz file such as initrd /boot/initrd.img-4.4.0-116-generic

type boot to boot

If the /boot dir was empty you probably have a separate /boot partition.
Try listing the files of different partitions as earlier to find the partition that has grub, vmlinuz, and initrd images such as ls (hd0,msdos2)/
When you find the boot partition, type ls (hdX,Y) of the root partition you found earlier to get the UUID. You'll need it in the next step.

type linux (hdX,Y)/vmlinuz replacing hdX,Y with your boot partition and press TAB to complete the filename, you want the newest kernel and continue typing root=UUID=<UUID from above here>

such as linux (hd0,msdos2)/vmlinuz-4.4.0-116-generic root=UUID557c9df7-7f08-4da3-9576-12ad285b469c

type initrd (hdX,Y)/initrd replacing X and Y with your boot partition and also use TAB completion to select the initrd file that matches the vmlinuz file such as initrd (hd0,msdos2)/initrd.img-4.4.0-116-generic

type boot to boot.

Booting from Grub Rescue

If you get a "grub rescue>" prompt that means that grub couldn't find the /boot/grub directory that has the modules and configuration file.

Try first typing insmod normal then typing normal

If you get an error, try ls to list the devices and partitions similar to the picture below.

Try listing the files in the various partitions by typing ls (hdX,Y)/ replacing X and Y with the disk and partition such as ls (hd0,msdos1)/

You're looking for the root filesystem that contains /bin /sbin ... similar to the picture below
When you find it, type set root=(hdX,Y)

You also need to find the kernel and initrd images found in the /boot directory.
Often the /boot directory is part of the root filesystem.
Try ls /boot to see if the vmlinuz- initrd- images are there. If they are, you should see something similar to below.

If you find the grub directory, then type set prefix=($root)'/boot/grub'

type insmod normal

type normal

type configfile $prefix/grub.cfg to load the menu.
If you didn't find the grub directory earlier, when you tried ls /boot, you likely have a separate /boot partition.
Try listing the files of different partitions as earlier to find the partition that has grub, vmlinuz, and initrd images such as ls (hd0,msdos2)/

When you find the boot partition, type set prefix=(hdX,Y)'/boot/grub' such as set prefix=(hd0,msdos2)'/boot/grub'

type insmod normal

type normal

type configfile $prefix/grub.cfg to load the menu.

If no menu loads, then the grub configuration file might have a problem.
You'll need to manually load the kernel and initrd.

Refer to the section above on what to do if you have a grub> prompt.

RELATED TOPICS
Live USB, Ubuntu, Booting, Partition table, Partitions, BIOS, UEFI