I installed Ubuntu 14.04 first time with a fresh usb in uefi mode. When I needed to reinstall the system I tried again, but this time it wouldn't boot from usb unless it was in legacy mode. After installing Ubuntu now requires legacy mode to boot too.
So, can Ubuntu be convinced to setup uefi once it's installed?
Yes you can, even with MBR partitioning. In principle, you "just" need to install an EFI boot loader for Linux. I put "just" in quotation marks because there are a lot of pesky details in this process that can turn it into a nightmare, particularly if you're unaware of the details or if something goes wrong when dealing with one of them:
gdisk
(see its documentation on the subject. Sometimes, though, as detailed in that documentation, you might need to slightly shrink the final partition on the disk.parted
, GParted, or anything else based on libparted; you'll need to usefdisk
to give it the right type code (0xEF).grub-install
(for GRUB) or rEFInd'sinstall.sh
help automate this process. Some other boot loaders (such as ELILO and gummiboot) are just one or two files, so copying them by hand is quite easy, although setting up their configuration files may take more manual effort.efibootmgr
utility in Ubuntu, but this utility works only when the computer is already booted in EFI mode. As a workaround (which might especially be needed on an MBR disk), you can give the boot loader the filenameEFI/BOOT/bootx64.efi
on the ESP. (The ESP is normally mounted at/boot/efi
, so the full path would be/boot/efi/EFI/BOOT/bootx64.efi
under Ubuntu, if the ESP is mounted at the conventional location.)If you know what you're doing, setting all this up is easy. If you don't, you won't know where to begin. With any luck, this answer will at least help you begin. For more information, I recommend you read:
One further point: You can probably boot your computer into EFI mode right now with no changes to your on-disk configuration. The trick is to use a USB flash drive or CD-R with my rEFInd boot manager on it. If you boot rEFInd, it will scan your system for EFI boot loaders. The key is that the Linux kernel itself is an EFI boot loader (or has been since version 3.3.0, assuming the option has been compiled into the binary, which is the case for Ubuntu's kernels). Thus, rEFInd booted from a USB flash drive or CD-R should give you an option to boot Ubuntu. There are a number of caveats, though, such as the need for the kernel to be on a filesystem that rEFInd can read and the fact that you'll need to enter extra kernel options if you use a separate
/boot
partition. If this method works for you, though, you can boot into EFI mode now. The main advantage of this for your situation is that you'll be able to useefibootmgr
to install whatever boot manager you like to your hard disk. Down the road, rEFInd can also be helpful for emergency recovery; if your GRUB 2 installation goes south, rEFInd may enable you to boot and fix the problem.Of course, jumping through all these hoops will take time and effort. If the Ubuntu installation is fresh, it's likely to be easier to re-install. The key here, given what you've written, is likely to be to re-create your Ubuntu installation disk, but do it properly. If the disk you've got now refuses to boot in EFI mode, chances are it lacks an EFI boot loader. You didn't say what tool you used to create the disk, but switching to another tool may help. Some tools also offer options (such as partition table type) that may affect the ability to boot in EFI mode. Personally, I generally use
dd
to copy the.iso
file to a USB drive, as in:This example copies
imagefile.iso
to the USB drive at/dev/sdc
. Be aware, though, thatdd
can be dangerous! Pay particular attention to theof=
option, which specifies where the image will be written. If you type the wrong value here, you could wipe out your hard disk!Also, disabling the Compatibility Support Module (CSM) in your firmware may help. The CSM is what provides BIOS compatibility, so if you disable the CSM, the computer can't boot in BIOS mode (aka "legacy mode" -- and firmware options sometimes refer to the CSM using that term). Details of how to disable the CSM vary from one computer to another, though. See this page of mine for more on this subject.