0

I recently decided to take the plunge with Linux, by installing what I understand is the most user friendly of the distributions, Ubuntu. I had a spare HDD going, after switching to an SSD for my Windows 7 installation. So, I felt it would be relatively safe to experiment with Linux on the empty drive.

I installed Ubuntu using the recommended settings (after fumbling about with partitions and swap space and, I think, managing to install Ubuntu without a boot loader, and everything seemed to be fine, and I was pleased to discover a menu that offered multiple boot options, including the newly installed Ubuntu and Windows 7 on the other disk.

When I select Ubuntu, it loads and operates perfectly. When I select Win 7, it gives me the invalid EFI error. When I change the boot order to use the SSD first, Win 7 loads as it had always done. No problem with my installs, I'm guessing the problem is with the boot manager.

After looking at similar questions and threads about the EFI issue, I install and run boot-repair, choosing the recommended/default option. It mentioned an issue to do with GPT (which I can't quite remember at the minute) and suggested enabling the separate EFI partition option, which I did and re-ran it to no avail. I have not yet tried the other advice in the error message, which was to create the partition with something like GParted.

I tried to install rEFInd from the debian package, but it errored and did not complete.

Any advice on how to either fix my issue, or correctly install rEFInd (if that would help) would be appreciated.

I'd prefer not to have to change the boot order every time I want to change OS, especially since I'm using a wireless keyboard that isn't detected during start-up.

It's a 64-bit machine.

http://paste.ubuntu.com/5758960/ - My boot-repair output.

EDIT: Tried reinstalling rEFInd, apparently it worked this time, though the Windows 7 option only sent me into what I think is GRUB, where it's Windows 7 option still gave the invalid EFI error.

I read in this thread, Invalid EFI file path, how the windows loader may have been renamed. Renaming the file as per the instructions only yielded an error when launched from rEFInd. Is the grubx64.efi file relevant?

EDIT 2: There is a bootmgfw.efi in the Windows folder on the SSD, is it worth trying to point the grub.cfg chainloader parameter at that?

1
  • is uefi in bios-settings enabled/disabled resp. efi enabled/disabled ?! - I would enable efi instead of uefi. Jun 12, 2013 at 21:28

3 Answers 3

1

Your Windows installation seems to be on an MBR disk. Given that Microsoft ties the partition table type (MBR vs. GPT) to the boot mode (BIOS/CSM/legacy vs. EFI/UEFI), this means that Windows was almost certainly installed in BIOS mode. The fact that you've got Windows boot loaders on /dev/sdb and /dev/sdc further supports this analysis. Mixing a BIOS-mode Windows with an EFI-mode Linux is tricky, and GRUB can't handle it.

The easiest solution, but one that's not guaranteed to work, is to edit the /boot/efi/EFI/refind/refind.conf file (or wherever you've installed rEFInd). Uncomment the scanfor line and ensure that hdbios is listed among the options. If you're lucky, that will create a new icon in rEFInd that will enable it to redirect the boot process to a BIOS-mode boot loader. This won't work if your firmware lacks a CSM, though; and it also won't work if your CSM is set to boot only from /dev/sda. Still, it's an easy enough thing to try, and if it works it should get things running just fine. Note that if you go this route, you'll probably want to remove the /boot/efi/EFI/Microsoft directory (from Linux), since it clearly doesn't contain a real Windows boot loader, just a copy of GRUB created by Boot Repair. (That's why selecting Windows from rEFInd launches GRUB.)

Another solution is to install the BIOS-mode version of GRUB (from the grub-pc package; installing it should automatically uninstall the EFI-mode version of GRUB) and reconfigure your firmware to boot only in BIOS/CSM/legacy mode. The latter part of the task is impossible to describe in detail because how you do this varies from one computer to another.

If all of this fails, you may need to convert /dev/sda from GPT to MBR. You can do this with gdisk: Launch gdisk on the disk, type r to enter the recovery & transformation menu, type g to convert from GPT to MBR, type p to view the partition table to verify that all your partitions are included, and type w to save the changes. You'll then need to re-install a BIOS-mode version of GRUB. (This whole process is basically a last-ditch effort to get the computer booting in BIOS mode rather than in EFI mode.)

0

Your Windows is installed in Legacy mode, but Ubuntu is installed in UEFI mode. This cannot work.

You need to convert Ubuntu in Legacy mode.

To do so:

  1. via Gparted, delete your sda1 partition. In the freed space, create a BIOS-Boot partition (unformatted filesystem, bios_grub flag).
  2. then run Boot-Repair 's Recommended Repair
2
  • This sounds likely. I'll do this and mark answered if it works. Cheers. Jun 14, 2013 at 12:07
  • This was the root cause of my problem, however, following this advice caused Ubuntu to not be bootable under any configuration. I ended up reinstalling in Legacy mode, and now all the options work. Thank you. :) Jun 17, 2013 at 19:40
0

Definitely the "chainloader +1" is wrong for an EFI boot, but I thought boot-repair fixed those to be like "chainloader (${root})/EFI/Microsoft/Boot/bkpbootmgfw.efi" Note the "bkp" in the name (maybe at end), that's the original Windows bootloader. You should have a separate efi partition on the new ubuntu disk, but maybe the installer actually mounted the one on the ssd (If you ran the install from the "try" desktop, you could have a shell ready to unmount the wrong efi and mount the right one). If the EFI is empty on the new disk, just set it up manually -- copy the one on the SSD would work. Now, the grub.cfg file for 12.04.2 I think sits in the EFI partition, NOT in /boot/grub, so maybe that's how boot-repair missed the fix. Check the two files, the /boot/grub/grub.cfg and /boot/efi/EFI/ubuntu/grub.cfg, and fix up the one in the EFI path (should just be able to copy the other one if that's the one boot-repair fixed for you). 13.04 changed things, so the EFI path grub.cfg pulls in the other one.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .