Post-Install Issues

Ubuntu Doesn't Boot After Installing

Using the Same BIOS/UEFI Mode

If you're dual-booting, first make sure that Ubuntu and Windows are installed in the same mode, BIOS CSM Legacy or UEFI, and it's selected in the BIOS settings.

If you don't know which modes they're installed in, click here on Using the Same BIOS Mode and read the first part on dual-booting. If Windows is using UEFI, and Ubuntu is using CSM Legacy, then you should see a 1MB "bios boot partition".
In that case delete Ubuntu and reinstall it in UEFI mode.

If Ubuntu is using UEFI and Windows is using CSM Legacy, the partition table type will be "msdos" and there will be a FAT32 EFI partition for Ubuntu.
In that case delete Ubuntu and reinstall it in CSM Legacy mode.

Do not choose to "Reinstall Ubuntu" in the installer as it will remove Windows and Ubuntu and install Ubuntu by itself in the disk.

If you're single booting, and you know which mode you installed Ubuntu in, then enter the BIOS settings, and set the appropriate mode.

BIOS

If you're using BIOS (CSM Legacy), Ubuntu might not boot after the installation finishes.
Usually it's due to not having the disk which has Ubuntu installed in first in the boot order list.
Enter the BIOS settings when the PC first starts, if you don't know how click on How to Enter BIOS Settings and go to boot options and set the disk where Ubuntu is installed first in the boot order. Save and exit.

UEFI

If you're using UEFI, Ubuntu might not boot after the installation finishes.
Some laptops and motherboards are difficult when it comes to UEFI and operating systems other than Windows.

Try to enter the BIOS settings, if you don't know how, click on How to Enter BIOS Settings
There you might find a boot order list where you can set Ubuntu in the top.
You might also find a "Trust" option where you can trust an operating system and it will boot when the PC starts.
With some laptops, namely Acer, you have to set the Administrator password in the BIOS in order for the "Trust" option to appear.
You might need to disable Secure Boot as well.

More Difficult UEFI PC's

Some PC's have more difficult UEFI, sometimes you can boot the Ubuntu install temporarily by using the one-time boot options menu when the PC first starts.
In HP laptops, it's usually the F9 key. This page has some laptops and motherboards and their respective boot options keys https://kb.wisc.edu/page?id=58779
If you can't find your PC model or it didn't work, try to google your "<PC model here> bios options menu"

If you weren't able to boot the Ubuntu install using the one-time boot options menu, you can use the Live USB booted in UEFI mode.

Once it has loaded, open a terminal with ctrl+alt+T and you should get a command prompt such as ubuntu@ubuntu:~$

type sudo efibootmgr -v

You should get the list of UEFI entries and the boot order similar to below.

BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0002,3002,0000,2001,2002,2004
Boot0000* ubuntu	HD(1,GPT,472ed800-a2c2-4f94-bbb0-85207dba31f3,0x800,0x96000)/File(\EFI\ubuntu\shimx64.efi)
Boot0002* Windows Boot Manager	HD(1,GPT,472ed800-a2c2-4f94-bbb0-85207dba31f3,0x800,0x96000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot2001* EFI USB Device	RC
Boot2002* EFI DVD/CDROM	RC
Boot3002* Internal Hard Disk or Solid State Disk	RC
As you can see, Ubuntu is in the list, named Boot0000* where the "*" indicates it is active.
However the BootOrder starts with 0002, which is the Windows Boot Manager.

Windows doesn't have to be installed, the entry is part of the default configuration.

Disabling the Windows Entry

Some UEFI work when the Windows entry is disabled, others are more difficult but can still work.
To disable the Windows entry, type sudo efibootmgr -A -b <Boot number here>

According to the list above, it would be sudo efibootmgr -A -b 0002

If it was successful, then typing sudo efibootmgr -v should give the list similar to below

BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0002,3002,0000,2001,2002,2004
Boot0000* ubuntu	HD(1,GPT,472ed800-a2c2-4f94-bbb0-85207dba31f3,0x800,0x96000)/File(\EFI\ubuntu\shimx64.efi)
Boot0002  Windows Boot Manager	HD(1,GPT,472ed800-a2c2-4f94-bbb0-85207dba31f3,0x800,0x96000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot2001* EFI USB Device	RC
Boot2002* EFI DVD/CDROM	RC
Boot3002* Internal Hard Disk or Solid State Disk	RC
As you can see the "*" After Boot0002 is now gone, meaning it is inactive.
If you ever want to enable the Windows entry again, type sudo efibootmgr -a -b <Boot number here>

Tricking the UEFI by Switching the UEFI Files

Some PC's have more difficult UEFI. If changing the settings in the UEFI, and also disabling the Windows entry did not help, then we can try to trick the UEFI into booting Ubuntu instead of Windows by switching the EFI files.
You can do this from a Live USB or the actual Ubuntu install, the latter being the easier.
Sometimes you can boot the Ubuntu install temporarily by using the one-time boot options menu when the PC first starts.
In HP laptops, it's usually the F9 key. This page has some laptops and motherboards and their respective boot options keys https://kb.wisc.edu/page?id=58779
If you can't find your PC model or it didn't work, try to google your "<PC model here> bios options menu"

If you weren't able to boot the Ubuntu install using the one-time boot options menu, you can use the Live USB booted in UEFI mode. You'll need to make a chroot first, click here on How to Setup a Chroot.

Once the desktop has loaded, open a terminal with ctrl+alt+T and you should get a command prompt such as ubuntu@ubuntu:~$
If you're using the Live USB then type these commands after you've setup the chroot.

First, back up any existing Windows EFI files by typing

sudo cp /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi.backup

sudo cp /boot/efi/EFI/Boot/bootx64.efi /boot/efi/EFI/Boot/bootx64.efi.backup

Then, copy the Ubuntu EFI file over the Windows EFI files by typing

sudo cp /boot/efi/EFI/ubuntu/shimx64.efi /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi

sudo cp /boot/efi/EFI/ubuntu/shimx64.efi /boot/efi/EFI/Boot/bootx64.efi

Sometimes grubx64.efi needs to be used instead of shimx64.efi, if both files do not exist then use sudo grub-install in order to install them.

After replacing the files, we need to let grub (the bootloader) look for the new name of the Windows EFI file so it can load Windows properly.

type sudo sed -i 's/bootmgfw.efi/bootmgfw.efi.backup/' /usr/lib/os-probes/mounted/efi/20microsoft

After that, update grub's configuration by typing sudo update-grub

If you were doing this from a Live USB chroot then type exit to exit the chroot and then restart.

Mixing Different Modes UEFI and BIOS

Sometimes Windows is installed in UEFI mode, and Ubuntu gets installed in BIOS mode.
If Windows is installed in UEFI mode, then Ubuntu has to be installed in the same mode.
If you don't know which mode Windows is installed in If you're using BIOS or CSM Legacy, Ubuntu might not boot after the installation finishes.
Usually it's due to not having the disk Ubuntu is installed in first in the boot order list.
Enter the BIOS settings when the PC first starts, if you don't know how click on How to Enter BIOS Settings and go to boot options and set the disk where Ubuntu is installed first in the boot order. Save and exit.

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