How to dual boot Windows 10, and Ubuntu on a HP Pavilion G6?

I've been trying to set up a dual boot with Ubuntu on my Windows 10 HP Pavilion G6 Laptop for a couple of days now. I've followed countless tutorials, on here, and on Google.

I manage to install ubuntu onto my laptop using a USB stick, but after installation when the computer is restarted, it loads straight back to Windows (with no sign of a grub menu). I've gone through the boot options, trying all options, and loading multiple efi files direct, but with no luck of loading back onto ubuntu.

Here is my process -

1 - Shrink the Windows part of my computer to allow room for Ubuntu. Here is what my disk management looks like after making space for Ubuntu.

2 - I put Ubuntu onto a USB stick using the software from Pen Drive Linux.

3 - I restart my computer, and boot from the USB. When the computer boots, in the list of boot options the USB is shown twice. One has a UEFI in the name, and the other doesn't. I have tried both these options.

4 - When the Ubuntu installer loads, I press install.

5 - I go through a couple of screens. On one of the screens, the tutorials all say there is an option to install alongside Windows 10, but i've never seem to have this. So I Choose the 'Something else' option.

6 - On the something else page, i find the free space part that i removed from windows, and make some partitions. 6.1 - I make a swap area of 4000mb 6.2 - A root ( / ) one of 30000mb 6.3 - A /home one of 30000mb

7 - I press continue, and finish the installation.

8 - It now says that i have to restart the computer. I do so and it boots back to Windows.

Other things that I have tried - Changing the power options so that quick start is turned off, turned off safe mode in the BIOS.

Is there anything that I am missing?

Any help would be really appreciated.

Thanks :)


Before doing anything else, this answer might already help you.

1. EFI-Boot

You need to make sure the USB-drive boots in EFI-mode. If you can, disable legacy boot / legacy BIOS in your "BIOS".

Now boot from your USB-key and run the live-system. Inside the live-system open a terminal (ctrl+alt+t) and run efibootmgr. This should show you all EFI bootmanagers in your nvram and which one is the default. On my Mac it looks like this:

BootCurrent: 0001
BootOrder: 0001,0000,0080
Boot0000* ubuntu
Boot0001* rEFInd Boot Manager
Boot0080* Mac OS X
BootFFFF* 

If you don't see a line for ubuntu or anything at all, your USB-key wasn't created to be EFI bootable and/or Ubuntu was not installed in EFI mode.

If you do see Ubuntu but it isn't the first in the bootorder, first try to boot it temporarily to try if grub works:

sudo efibootmgr --bootnext 0000

This tells the EFI to boot Ubuntu next and then revert to the default. The HEX-number might be different in your case. Refer to the output of efibootmgr.

To make the changes permanent, use efibootmgr to change the default boot order.

sudo efibootmgr --bootorder 0000,0001,0080

Adjust this to your needs as well.

2. Creating the USB-key the right way

If your USB-key didn't boot in EFI mode, you need to create it that way. First, lets figure out what kind of partitioning you use.

In your Disk Management tool in Windows, right-click on Disk 0, select Properties and go to the Volumes tab. The partition style entry will tell you whether you have an MBR or a GPT boot record. Make a note of this.

Download the Ubuntu ISO and create your USB-Stick using Rufus. In Rufus you can select the target partition and system type. Select GPT and EFI there (or MBR if that was your partitioning scheme).

3. Install

When installing, boot into the live-system first, run gparted to create at least 3 partitions: root (~20G), swap (~the size of your ram) and home (the rest). Use the "Something different" install option and pick our previously created partitions.