1

I know tons of people have issues dual booting Linux with Windows 8 machines because of all the UEFI garbage. In fact, I had a similar issue last year.

After installing Windows 8 next to Ubuntu, I can only boot 8

That link says how I fixed my issue then. Here's my problem now. I messed up my OS and decided to load everything again from scratch. I re-installed Windows 8 and then grabbed a copy of Ubuntu 14.04 (previously I was using 12.04). I'm having the same issue where Windows 8 is forcing itself to boot but what solved my issue before no longer works. From a live cd I ran these commands:

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && (boot-repair &)

I get all sorts of errors about boot-repair not being a valid command. I was finally able to run boot-repair using this:

sudo add-apt-repository -y ppa:yannubuntu/boot-repair
sudo sed 's/trusty/saucy/g' -i /etc/apt/sources.list.d/yannubuntu-boot-repair-trusty.list
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

I get a warning about UEFI being turned on (after I've done everything I know how to make sure it's disabled) and then the boot repair errors out. Here's the message it generates:

http://paste.ubuntu.com/7852448/

I noticed I can boot to Ubuntu if I stop the normal boot process and select ubuntu from the boot menu but that's the best I have.

I also tried running this command from Windows:

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

I'm dying here. Any help you guys can provide would be superb. Thanks!

TheIronCheek
  • 153
  • 4
  • 1
    Do you Ubuntu option in OS select menu? Which version of Ubuntu you are using? 32 bit or 64 bit? If you can boot into windows 8 install EasyBCD software and add Ubuntu to your boot menu. – Karthik Jul 25 '14 at 06:09
  • It doesn't boot to an OS select menu. It boots directly to Windows. I'm using 64-bit Ubuntu. – TheIronCheek Jul 26 '14 at 19:02
  • Can you post output when you run this command from windows 8? bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi – Karthik Jul 27 '14 at 07:27

4 Answers4

1

Try with Boot Repair you can get it from here - http://sourceforge.net/projects/boot-repair-cd/files/ install it on CD/DVD/USB boot from it and when it ask you for 32/64-bit session chose 32-bit if your PC is 32-bit if it is 64-bit chose 64-bit, then if it ask you for updates click No, then when it finish with scanning click Recommended repair

radibg2
  • 186
1

Based on your Boot Repair output, and in particular the efibootmgr output it shows, it should be working now. (One caveat: There's no evidence of any EFI boot loaders on your ESP; but the fact that Windows is booting means that this must be a Boot Repair omission, so I'm discounting that evidence.) The fact that it's not working strongly suggests you've got a badly broken firmware. Your earlier question states that you've got an HP laptop, and many HPs are known to have such badly-broken EFIs. My first suggestion is therefore to check with HP to see if there's a firmware update. If there is, apply it and try again with the bcdedit command in Windows; that's the most likely to work.

Also, note that specifying grubx64.efi with bcdedit is appropriate if you've disabled Secure Boot. If Secure Boot is active, you must specify shimx64.efi, not grubx64.efi. Specifying shimx64.efi will work if Secure Boot is inactive, too, provided the file is installed, as it normally is even on non-Secure-Boot systems.

One more point: If you haven't already done so, you must disable the Windows Fast Startup feature, as described here (among other places). If that feature is left enabled, it can result in file corruption on shared partitions, including the ESP where your boot loaders reside. This may be why Boot Repair didn't detect any boot loaders on the ESP, and it's conceivable that it's contributing to your problems.

If following this advice doesn't work, then you have two choices:

  • Sell your laptop to somebody who wants to run nothing but Windows and use the money to buy something that's not broken. At this point in time, this is my first recommendation; manufacturers have had more than enough time to fix their broken EFIs, and the fact that many haven't is a sign of disrespect to you, their customer. Some, like ASUS and Lenovo, have EFIs that are more likely to work. Newer models are also more likely to work than older ones.
  • Rename your Ubuntu boot loader (EFI\ubuntu\grubx64.efi or EFI\ubuntu\shimx64.efi on the ESP; or you can rename another EFI boot loader appropriately) to take the place of Microsoft's boot loader (EFI\Microsoft\Boot\bootmgfw.efi) and adjust your boot loader configuration. This is tricky to do by hand with GRUB, but there is an option in Boot Repair to do the job. It's among the Advanced options and it's called something like "back up and replace EFI boot loader files." (I don't recall the precise wording.) This was the default a year or two ago, but it's overkill in most cases and can cause a host of new problems on computers with non-broken EFIs, so it's no longer the default. You may need to use it and live with the consequences, or install some other boot loader in this way.
Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • When I loaded Windows and was on HP's website getting drivers, I vaguely remember there being a firmware upgrade or two. I'll give that a shot. – TheIronCheek Jul 26 '14 at 19:04
  • Ugh... Okay I didn't find anything on HP's website. The 2 firmware upgrades I was remembering were for the hard drive and optical drive. I installed them anyway but they obviously didn't solve anything.

    Even though I had Secure Boot disabled, I tried using bcdedit to switch from grubx64.efi to shimx64.efi with no luck.

    – TheIronCheek Jul 26 '14 at 21:50
1

Okay, believe it or not I fixed it. I re-ran boot-repair several times until it actually worked... There's a few lines that boot-repair has you copy and paste and one of those lines was failing. I separated the commands into individual lines rather than strung together and it errored out less... and then Grub loaded just fine...

Thanks for all the help!

TheIronCheek
  • 153
  • 4
1

Here are the key steps and information bits to get an HP laptop to dual boot between Windows 8/8.1 and Ubuntu 14.04.02. This laptop is a pretty modern Pavilion g7-2215dx.

  1. The BIOS of this laptop (and probably most modern HP laptops) has a UEFI boot menu that you can access by pressing ESC and then F9 when that menu shows up. This menu DOES PROPERLY WORK if the stanzas are properly setup in the EFI partition and the disk is properly laid out. (ie: if you have allowed Ubuntu to load the correct changes to the EFI partition, or if you have run boot-repair, and if the partition is in the right place) Unfortunately, the Ubuntu installer ASSUMES that if UEFI is present that the system has a single Windows partition and no boot menu. The reality is that these HP machines have a hidden recovery partition that is listed in the UEFI boot store and the reason the Windows boot menu does not appear is that HP factory-set the timeout on the boot menu to 0. (cheap trick) The Ubuntu installer doesn't appear to understand multi-boot configs that already exist so it does not properly create the entries.

  2. This BIOS shortcuts to {bootmgr} on boot instead of {fwbootmgr}. However, the F9 command DOES properly go to {fwbootmgr} This is why the common hack of modifying {bootmgr} works.

  3. HP did put the keys that allow the secure grub bootloader to work into the BIOS so it is possible to leave secure boot turned on and install Ubuntu. Unfortunately, due to a bug in grub you cannot leave secure boot on and dual boot, because in secure boot mode when grub transfers control to the Windows boot loader, that loader's keys don't appear to match. You can leave secure boot on and install only Ubuntu. OR you can leave secure boot on and use the F9 key to manually select grub or Windows and forget about getting it to boot directly into grub.

  4. You must NOT allow Ubuntu's default installer to install grub to /dev/sda. It must install the bootloader to /dev/sda2 (or whatever the EFI partition is) It is also probably a good idea to create logical partitions not primary partitions for the Ubuntu install.

  5. Another key is that if you change the boot priority of anything, it will interfere with the booting. Meaning if before installation you change the BIOS to boot off a USB key or off a CDROM then install, when Ubuntu is creating the UEFI entries it will do so based on that boot order. If you finish installation then change BIOS to boot off the hard disk, it messes things up. When you make changes in the BIOS boot order, the BIOS makes changes in the UEFI boot store on the EFI partition. These changes are generally incorrect.

  6. After you finish installing Ubuntu and the laptop reboots into Windows, go into an admin command prompt and run the commands:

    bcdedit /set {bootmgr} path \EFI\Ubuntu\shimx64.efi  
    bcdedit /set {bootmgr} displaybootmenu no  
    
  7. EasyBCD 2.2 is broken with the EFI partition on these machines - the author or EasyBCD apparently did not have one of these machines to test and his software makes some incorrect assumptions, and it cannot properly interpret the UEFI store on the EFI partition. I have completely scotched a dual boot disk multiple times with this utility, during testing. I DO NOT recommend using it under ANY circumstances!!! Also, note that the Windows Recovery DVDs will NOT fix dual boot UEFI systems if the EFI partition gets scotched - you will have to reformat - they DO NOT touch that partition!!!! I don't even think Windows Backup does. A block backup utility might like Macrium Reflect.

  8. The best tool so far to muck around with the EFI partition I have found is bcdedit under Windows. Run bcdedit /? and bcdedit /enum ALL /v and bcdedit /enum /? and so on - basically run /? off of all the options of bcdedit and you will learn a great deal about how booting works.

  9. If you load a Windows upgrade later (ie: going from Windows 8 to Windows 8.1) the newer Windows installer will muck around with EFI and disable dual-boot again. You may not be able to get dual boot back. One error I got after doing this was from boot-repair that said that grub was too far away from the beginning of the disk. Apparently the Windows 8.1 update moved the EFI partition. I was never able to get that machine to boot into grub until I reformatted it.

  10. These machines have "smart" BIOSes - how are they smart? They are smart because they read the EFI store, try to execute the boot menu, and if that fails they are hard coded to boot Windows. So the upshot is if you make a mistake in the EFI store you won't get a useful error message (like it can't find an incorrectly named file or something) it will just boot into Windows. They are designed to reduce support calls from users who screw up their PC. And, if they detect what they think is an incorrect entry in the EFI store they will sometimes just wipe it out and replace it with what they think is a correct entry during POST.

Incidentally, the factory recovery DVDs may NOT give you a chance to partition up your disk all nice and pretty for dual boot. They generally hard-code the partition locations.

In summary, the EFI partition is a huge advancement over prior booting schemes and it will be used going forward so you better get used to it, and learn about it. The HP machines all have HP recovery partitions and Windows recovery partitions that are accessed with various combinations of F keys and selections from Windows 8 and later, this is part of Microsoft's "Zero installation media" initiative where they are trying to get all PC manufacturers to NOT supply recovery CDs with their machines. (mainly as an anti-piracy measure) These bootable partitions are all properly setup in the EFI partition and the problem is that the BIOSs of machines are all taking different approaches to reading EFI, and many of the utility programs (like EasyBCD, and the Ubuntu installer itself, and the HP BIOS) do not properly interpret multi-boot setups in EFI and when they make changes they muck things up. You can, however, usually fix things with bcdedit under Windows, but you must understand EFI so do the reading needed.