Question
Reply
 
Tutor
Posts: 7
Member Since: ‎03-11-2013
Message 1 of 28 (31,483 Views)

Changing Boot Order on Dual Boot Windows 8 and Ubuntu

Hi there,

Recently got a HP Pavilion g6 2213sa which came with Windows 8 (spit!) and this disgusting UEFI BIOS replacement (double spit!).

Anyway, I need to dual boot Ubuntu on my system, so I installed Ubuntu. Normally, on a non UEFI system, a "Grub" bootloader installed by Linux would take over the startup process, and allow you to choose between either Windows 8 or Ubuntu on startup.

 

However, on this computer, startup is just booting straight to Windows 8 despite the fact that Ubuntu and Grub IS installed.

Now, upon startup, if I press F9, then I get to change the boot-device on a one-time basis. I can either select "OS Boot Manager", which loads Windows 8, or "Ubuntu" which loads the Grub bootloader which allows me to select Windows 8 or Ubuntu.

However, when I press F10 to enter the Bios Setup with the intention of changing the boot order permanently, the Ubuntu option isn't there. Instead it has OS Manager, USB Disk, CD Rom, USB CD Rom and Network Card.

Thanks, HP for, the crappily designed BIOS.

Anyway, can anyone PLEASE provide me a way of changing the boot order so that GRUB is loaded first and NOT this crap Windows 8 rubbish (that I would happily bin if I didn't need it for work). 

Tutor
Posts: 7
Member Since: ‎03-11-2013
Message 2 of 28 (31,461 Views)

Re: Changing Boot Order on Dual Boot Windows 8 and Ubuntu

Looks like HP forums are just as useful as HP customer service and HP computers - i.e., not very useful at all.

Problem solved though. Took the piece of crap back for a full refund and won't be buying HP again.

Happy days.

Bye.

Honor Student
Posts: 2
Member Since: ‎07-30-2013
Message 3 of 28 (30,993 Views)

Re: Changing Boot Order on Dual Boot Windows 8 and Ubuntu

[ Edited ]

Hi,

 

i have the same Problem Smiley Sad

 

try

# efibootmgr -v

look for \EFI\Microsoft\Boot\bootmgfw.efi

then replace this file:

# cd /boot/efi/EFI/Microsoft/Boot/

# mv bootmgfw.efi bootmgfwB.efi

# cp ../../ubuntu/grubx64.efi bootmgfw.efi

u can still boot to windows, if u select the efi-File bootmgfwB.efi

u may need to disable secure boot

Honor Student
Posts: 2
Member Since: ‎07-30-2013
Message 4 of 28 (30,991 Views)

Re: Changing Boot Order on Dual Boot Windows 8 and Ubuntu

u may need to disable secure boot

Top Student
Posts: 3
Member Since: ‎12-26-2013
Message 5 of 28 (30,184 Views)

Re: Changing Boot Order on Dual Boot Windows 8 and Ubuntu

Hi!

 

I've this problem too!

 

I tried to do as you told but, althought giving the command efibootmgr -v  "EFI\Microsoft\Boo\bootmgfw.efi" is displayed, I've no Microsoft folder in /boot/efi/EFI !!!

 

Any suggestion?

Tutor
Posts: 9
Member Since: ‎01-18-2014
Message 6 of 28 (28,236 Views)

Re: Changing Boot Order on Dual Boot Windows 8 and Ubuntu

[ Edited ]

There is the same problem in HP 2000 laptops (in my case specifically, HP 2000-2D22DX). I did some investigation using trial and error, and this is what I found out:

 

There is some sort of a "recovery feature" or so that on every boot sets the very first UEFI load option to point to one of the two locations, in this order:

  1. \EFI\Microsoft\Boot\bootmgfw.efi
  2. \EFI\Boot\bootx64.efi

This option is displayed as "OS boot Manager" (for the first path) and something akin to "UEFI partition" for the second path, completely ignoring the actual name given to it (when you look at the EFI variables through efibootmgr, you can see that what is displayed as "OS boot Manager" actually is set to the name "Windows Boot Manager"; why anyone would do such renaming is beyond me).

 

By default, both of the paths above contain the same Microsoft bootloader (if you check the md5sum of both, you'll see they match).

 

Attempting to change the BootOrder variable so that "OS boot Manager" isn't booted first has no effect, because the UEFI is also broken and doesn't respect the variable to begin with. It will always boot entries in the order that they were entered, from 0000 to 0001 to 0002 etc. and "OS boot Manager" is always 0000.

 

So, until HP releases an updated UEFI that fixes the broken BootOrder handling (which goes againt the UEFI spec, by the way) or allows rearranging boot options through the F10 UEFI setup, this is what you can do to get dual boot with the least amount of hackiness:

  1. Install Linux and note how the bootloader's EFI file is named. In my case it was EFI/opensuse/grubx64.efi.
  2. In Windows, mount the UEFI partition (mountvol S: /S mounts it as the S: drive) and copy the file \EFI\Microsoft\Boot\bootmgfw.efi to use some other name (for example, I did copy S:\EFI\Microsoft\Boot\bootmgfw.efi S:\EFI\Microsoft\Boot\windows.efi but you can change the name to anything you want).
  3. In the Windows command prompt, update the Windows UEFI entry to point to the new name: bcdedit /set {bootmgr} path \EFI\Microsoft\Boot\windows.efi (adapt to your set name accordingly).
  4. Optionally, change the name of the Windows boot loader so that you would be certain that it points to the new file location: bcdedit /set {bootmgr} description "Windows 10"
  5. Delete the two files, \EFI\Microsoft\Boot\bootmgfw.efi and \EFI\Boot\bootx64.efi. This can be done from either Windows or Linux. Reboot and verify that they're no longer there. Delete several times if the files come back.
  6. In Linux, open a terminal and use the efibootmgr program to delete the "OS boot Manager" entry: sudo efibootmgr -b 0000 -B
  7. Run efibootmgr -v to verify that the Linux bootloader is in slot Boot0001 and the Windows bootloader is in slot Boot0002.  If it's the other way round, then you need to delete and create entries in a way so that the Linux entry is before the Windows entry. One way to do it, if there is nothing in Boot0000, is to run efibootmgr -c -l \\EFI\\opensuse\\grubx64.efi (adjust to the location of your bootloader), which will create said entry (named "Linux" by default) in the Boot0000 slot. Another way to do it is to delete the Windows entry altogether and let GRUB handle everything (see step 6, change the number to the one corresponding to Windows).
  8. Update GRUB to point the Windows entry to your renamed file by copying from /boot/grub2/grub.cfg the section titled /etc/grub.d/30_os-prober to the end of /etc/grub.d/40_custom, changing the chainloader line to point to the new bootloader name.

And that's it, now the UEFI will boot GRUB by default (it won't regenerate the "OS boot Manager" entry since it won't be able to find either of the two hardcoded paths and will go read the actual boot entries), and the F9 menu will still allow choosing to boot Windows directly, provided you didn't have to delete that option.

 

Top Student
Posts: 3
Member Since: ‎12-26-2013
Message 7 of 28 (28,107 Views)

Re: Changing Boot Order on Dual Boot Windows 8 and Ubuntu

[ Edited ]

HI, I mounted the S: Voulme but when I try to open it i get: "you don't currently have permission to access this folder. Click Contnue to permanently get access to this folder."
If I Click "Contunue" I get: "You have been denied permission to access this folder. To gain access to this folder you will need to use the security tab". Unfortunately the security tab is not shown!! I tried to right click on S: and then on "Properties" but there are only "General" "Tools" "Hardware" "Sharing" and "Customise" tabs!

How can I access to S: ?

Tutor
Posts: 9
Member Since: ‎01-18-2014
Message 8 of 28 (28,083 Views)

Re: Changing Boot Order on Dual Boot Windows 8 and Ubuntu

[ Edited ]

You don't need access to the S: volume through Windows Explorer, you need to do everything from the command line (with administrator privileges, of course):

C: > S:

S: > cd \EFI\Microsoft\Boot\

S:\EFI\Microsoft\Boot\ > copy bootmgfw.efi windowsefifilename.efi

Student
Posts: 1
Member Since: ‎03-18-2014
Message 9 of 28 (23,213 Views)

Re: Changing Boot Order on Dual Boot Windows 8 and Ubuntu

@GreatEmerald thank you! After struggling with this issue all day on my HP Envy, your instructions were the solution. I'll be researching the next laptop I buy more carefully, and will avoid ones with this "feature".

Student
Posts: 1
Member Since: ‎08-14-2014
Message 10 of 28 (18,415 Views)

Re: Changing Boot Order on Dual Boot Windows 8 and Ubuntu

Thanks for the help!

 

couple points I dont get since I dont usually do this stuff....

 

firstly how do i delete \EFI\Microsoft\Boot\bootmgfw.efi and \EFI\Boot\bootx64.efi

 

second how do i do number 8...That one I'm at a complete loss on due to my lack of knowledge with Linux, hence why I am installing it...

† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation