Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have two disks, one Win 8 and one Ubuntu.

When manually partitioning the 2nd disk during the Ubuntu install, I installed the bootloader to the MBR instead of creating an EFI boot partition. So now I can't use my 2nd disk as the primary boot drive - it just goes straight to Windows.

How can I create an EFI partition on my Ubuntu drive and get grub on there? Is this something Boot-repair can do? Which options would I use?

Thanks in advance.

share|improve this question
    
depends. first check your bios and see if you have a hot key for a boot menu, F2 or some such. Sometimes you have to enable it and it varies by bios. Sometimes it is in boot order. Try changing the boot order so that Ubuntu boots first, you will then get the grub menu. here is one image - img827.imageshack.us/img827/8751/20121207140026232.jpg notice the "uefi boot order" menu. –  bodhi.zazen Feb 27 at 23:32
    
Thanks. When I make Ubuntu primary in the UEFI boot order, the grub option to boot to Windows doesn't work, I get an error. I've seen advice to run boot-repair, but I really don't want to touch the Windows disk at all, and I'm not sure what boot-repair is doing under the hood. –  Bud Feb 27 at 23:35
    
what error ? with uefi you might have to use the boot option in your bios. On my box it is f2, and I then select Fedora or windows –  bodhi.zazen Feb 27 at 23:39
    
The error is "unknown command 'drivemap'. invalid EFI file path." –  Bud Feb 27 at 23:45

1 Answer 1

up vote 1 down vote accepted

You've got a mixed-mode install, with Windows in EFI/UEFI mode and Linux in BIOS/CSM/legacy mode. This type of setup is difficult to get (much less keep) running. You have several options for how to proceed:

  • Install a Linux EFI boot loader/manager to the existing EFI System Partition (ESP) on the Windows disk. It should then be able to boot your existing Linux installation in EFI mode from the MBR disk. In principle, this is likely to be the easiest solution, but it requires either something easy to install or enough knowledge to not make a mistake when installing it. It also doesn't meet your criterion of not modifying any partition on the Windows disk; although it would not modify Windows itself, it would necessarily modify the ESP. The Boot Repair tool might set this up correctly if it's booted in EFI mode. rEFInd is also relatively easy to set up (I'd do it from Windows, but you'll need to add an EFI filesystem driver for whatever filesystem holds your Linux kernel -- probably ext4fs).
  • Free about 550MiB on the MBR disk, create an ESP on it, and install a Linux boot loader to it. The trouble is that some EFIs won't boot from an MBR disk, although many will. Some boot loader installation tools might also bypass an MBR disk (I have no idea if Boot Repair would work, for instance; and the Windows rEFInd installation instructions will probably end up putting rEFInd on the GPT disk.) This could also create problems if/when you upgrade or re-install Ubuntu, since the Ubuntu installer requires GPT for an EFI-mode installation.
  • Do as in the previous option, but convert the disk from MBR to GPT format by using GPT fdisk (gdisk, sgdisk, or cgdisk), which is part of the gdisk package in Ubuntu. This makes it more likely to work and be less likely to cause problems in the future, but it's an extra step and it's not 100% risk-free.
  • Re-install Ubuntu in EFI mode. Getting the installer to boot in EFI mode can be a challenge, because the boot mode is determined by the firmware and there's little standardization in how it's controlled. In general, though, an option to boot a CD/DVD or USB flash drive that includes the string "EFI" or "UEFI" will get the job done. Also, some ways of creating USB flash drives from installation images don't copy over the EFI boot files. You're best off just copying the image with dd, in my experience. Note also that you may have to be very careful with the installer to tell it to use the ESP on the Linux disk to hold the Linux boot loader; it might try to use the ESP on the Windows disk.

A fair amount more could be written about any of these options, so if you want to pursue one of them and have questions, ask. Please read my page on EFI-mode installations and/or the Ubuntu community wiki on the subject first, though.

share|improve this answer
    
Is there danger in leaving the set up as-is? Right now I can switch between Win 8/Ubuntu by modifying the UEFI boot order in the BIOS during startup. Grub doesn't get me into Windows, but it does get me into Ubuntu. To get into Windows I just set the Windows Boot Manager to be primary in the UEFI boot order. Because my mental model of this whole situation is very tenuous and incomplete, at this point I am done meddling unless there is some danger in leaving things the way they are. Thank you very much for your detailed response. –  Bud Feb 28 at 13:41
    
There's very little real danger to leaving it as-is; it's just inconvenient. The biggest risk is that some utility will come along and do something wonky because it assumes a more conventional setup. That's always a risk with dual-booting, though. I'm not sure it's any more of a risk with what you've got now. –  Rod Smith Feb 28 at 13:44
    
Great. Thanks again for your response and all of your resources Rod. I appreciate the time you put into these things - very helpful. I may just wind up doing a fresh install following your EFI-mode installation guide, but for now I'm okay with the inconvenience. –  Bud Feb 28 at 13:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.