Dual Boot Windows 8.1 with Linux Grub (Boot Order) HP Laptop

Windows 8.1 and Linux Boot Order on HP Laptop

I installed Linux Mint on a New HP 17-117DX Pavilion with Windows 8.1 and UEFI. I covered the installation in a previous Blog Post so won’t cover the installation here. I wanted Linux Mint as the default and Grub 2 as the boot manager.

What follows is my experience and what worked for me. I tried many different suggestions from Forums and Others. I am now able to boot with Linux Mint 17 as my default OS and Grub 2 as my boot manager. Boot up Brings up Grub 2, and boots the Default, Linux Mint after 10 second, Without having to press a key..

ASSUMPTIONS

It is assumed that you have a working knowledge of Windows 8 or 8.1 and The basics of Linux commands, and that you have one of the newer HP Laptops with UEFI and Windows 8 or 8.1 Pre installed.

Also a linux UEFI Aware distro (Mint, Ubuntu, Fedora, Suse) that is already installed

Most of the newer HP Laptops have some sort of a “recovery feature” that is hard coded into the system and on every boot sets Windows 8.1 back as the default OS to boot. Until HP releases an updated UEFI that allows turning this “feature” off or allowing the change of boot order, without reverting back to windows as the default. We will have to use a work around to solve the problem.

Thanks to GreatEmerald in the HP Forums, I was able to Solve my problem by making a few changes to his excellent tutorial to meet my needs.

1. In Linux copy the file /boot/efi//EFI/Microsoft/Boot/bootmgfw.efi to use some other name (for example, I copied it to “/boot/efi/EFI/Microsoft/Boot/bootmgfwM.efi, but you can change the name to anything else).

2. Restart your computer in Windows. At the Windows Admin Command Prompt, update the Windows UEFI entry to point to the new name: (type it exactly as shown)

bcdedit /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfwM.efi (adapt to your set name accordingly).

3. Optionally, change the name of the Windows boot loader so that you would be certain that it points to the new file location: (type Exactly as shown)

bcdedit /set {bootmgr} description “Fixed Windows path”

3a “Fixed Windows Path” is what will be shown in Grub or the boot order F9 when you boot up.

4. I assume that Linux was already installed, but if not Install it. In my case the bootloader was installed into /boot/efi/EFI/ubuntu/grubx64.efi.

5. Delete the two files, /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi and /boot/efi/EFI/Boot/bootx64.efi.

6. Use efibootmgr to delete the “OS boot Manager” entry: sudo efibootmgr -b 0000 -B

7.Set the new OS bootloader to be the default bootloader by using efibootmgr with the -o option. In my case, I had an entry called “Ubuntu” in slot Boot0001 and the updated path Windows entry in slot Boot0002, so I had to do sudo efibootmgr -o 0001,0002 I then made one more change. I edited

/etc/grub.d/40_custom and inserted the following.

menuentry “Windows (UEFI)” {

search –set=root –file /EFI/Microsoft/Boot/bootmgfwM.efi

chainloader /EFI/Microsoft/Boot/bootmgfwM.efi

}

Now when I boot up I get the grub menu and can choose windows 8.1, Linux Mint, or Ubuntu. I have room to add a few more distro’s that are UEFI Aware.

Advertisements

About Mel

Retired PC Consultant, Education Certificate Novel Networking installation and configuration. PC Repair Configuration and Networking. Commercial Pilot, Avid RVer. Enjoy Traveling with my Wife in our Travel Trailer. South in the winter Az, Texas, and summers in Utah
This entry was posted in Computers, Uncategorized and tagged , , , , . Bookmark the permalink.

9 Responses to Dual Boot Windows 8.1 with Linux Grub (Boot Order) HP Laptop

  1. Ernesto Castillo says:

    Hi, i have an HP-pavilion touchsmart 14-b175la with windows 8.1 and ubuntu 14.04, i followed your instructions and now when i restart my pc i get the grub2 showing ubuntu and windows, but for some reason that i was unable to found if i select windows the screen displays me this error:

    error: unspecified search type.
    error: file ‘/EFI/Microsoft/Boot/bootmgfwM.efi’ not found

    Press any key to continue…
    My first thought was that i accidentally removed the bootmgfwM.efi file instead of bootmgfw.efi, but i went to the file address and there it was bootmgfW.efi.
    After that i run an update-grub but it didn’t worked.
    I hope you could help me
    Thanks for this great tutorial and sorry for my bad english.

    • Mel says:

      Did you do this? It has to be copied exactly.

      2. Restart your computer in Windows. At the Windows Admin Command Prompt, update the Windows UEFI entry to point to the new name: (type it exactly as shown)

      bcdedit /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfwM.efi (adapt to your set name accordingly).

      • eon30 says:

        Hello, had the same problem as Ernesto, yes, I did the Windows steps just as the tutorial said and despite Windows replying “executed successfully” apparently those commands did nothing (also I opened the cmd.exe as an admin) What could’ve happened? Now I can’t get into Windows… Sorry for my bad english.

  2. shivam nema says:

    I’ve done all same as u did. However when i enter into the windows by grub. It shows “search type failed”. Then i changed
    the path as I found it waa /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi2 . This is my case.
    I still do not able to boot windows.

  3. eon30 says:

    This configuration worked:
    menuentry “Windows (UEFI)” {
    search –set=root –file /EFI/Microsoft/Boot/bootmgfwM.efi
    chainloader /EFI/Microsoft/Boot/bootmgfwM.efi
    }

    Careful with the double dash before “set” and “file”. In this post they’re shown with single dashs.

  4. Mark says:

    I had to run “sudo update-grub” after the last step to rebuild the grub.cfg file. Took me a little bit to figure this out after poking around. Might also want to back up the orig grub.cfg just in case with “sudo cp /boot/grub/grub.cfg /boot/grub/grub_bak.cfg”. Otherwise, this worked great on my HP! Thanks for everyones comments!!!

  5. Pingback: Install Linux Mint Stand Alone on HP Pavilion Laptop with UEFI | PC Tech

  6. Matt says:

    I can’t find the efi file at the first step. I have mint live running, but if I mount my newly installed at / I find /boot/efi to be a completely empty folder

    • Mel says:

      Be sure you follow steps 1. and 2. I no longer have MS Windows on any of my computers so am unable to help you further. Be advised everytime you get a Kernel change or update, you will have to redo your configuration over because it will change.
      Mel
      1. In Linux copy the file /boot/efi//EFI/Microsoft/Boot/bootmgfw.efi to use some other name (for example, I copied it to “/boot/efi/EFI/Microsoft/Boot/bootmgfwM.efi, but you can change the name to anything else).
      Here ia an example
      cp /boot/efi//EFI/Microsoft/Boot/bootmgefw.efi /boot/efi/EFI/Microsoft/Boot/bootmgfwM.efi

      2. Restart your computer in Windows. At the Windows Admin Command Prompt, update the Windows UEFI entry to point to the new name: (type it exactly as shown)

      bcdedit /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfwM.efi (adapt to your set name accordingly).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s