Ubuntu: Boot Ubuntu from external disk in UEFI mode



Question:

I have Ubuntu 14.10 32bit installed in an external USB hard disk.

I am trying to boot it in a UEFI netbook (Asus X205TA)

It seems the UEFI mode is preventing me from booting it.

How can I boot it without having to reinstall it and without having to install Ubuntu in the internal hard disk?

I also boot this Linux in non-UEFI computers, then I would not like to change its configuration too "deeply".

Is there any way to change some settings or to install boot loaders (even in the netbook internal hard disk) in order to fix this?

Note: if I install a UEFI boot loader, then the boot loader is UEFI, and the booting is "officially" started, then at that point if the boot loader is powerful enough it may connect to the non-UEFI operating system in the external hard disk and continue loading the booting data, is this right?

Note: I also accept solutions where a boot loader (like GRUB) installed in a virtual machine (like VMWare) which is capable to access to the external hard disk for booting.

Thanks everyone!


Solution:1

if I install a UEFI boot loader, then the boot loader is UEFI, and the booting is "officially" started, then at that point if the boot loader is powerful enough it may connect to the non-UEFI operating system in the external hard disk and continue loading the booting data, is this right?

No. You're missing something that's both fundamental and critical -- namely, the boot mode (BIOS/CSM/legacy or EFI/UEFI) is determined by the firmware. The firmware looks for a boot loader of a particular type (BIOS vs. EFI) based on its own capabilities, settings, and algorithms. If it finds an appropriate boot loader, it runs it. If not, it may fall back and look for a boot loader of another type, or the boot process may fail.

Boot loaders are written for a particular firmware type (BIOS vs. EFI vs. more exotic things), so you can't use a BIOS-mode boot loader in an EFI-mode boot or vice-versa. By the time the boot loader is launched, the boot mode is determined. (rEFIt and rEFInd are partial exceptions; they're EFI-mode boot managers that can redirect to BIOS-mode boot. They still rely on BIOS-mode boot loaders to do this, though.)

Also, BIOS and EFI boot loaders are installed in entirely different ways, which makes it possible for a boot medium (CD, USB flash drive, or internal hard disk) to support both types of boot loader. Configured in this way, a disk may be booted on either a BIOS-mode computer or an EFI-mode computer. That's how Ubuntu installation media are designed (at least, for 64-bit versions of Ubuntu).

Beyond the boot loader, there's nothing in Ubuntu that's so boot-mode-specific that it won't work in the other boot mode. Thus, you can install Ubuntu in BIOS mode and then use an EFI-mode boot loader to boot that installation, or vice-versa. (There are a few EFI-specific tools, like efibootmgr, but they aren't required to boot the computer in EFI mode, and they don't prevent a BIOS-mode boot if they're installed.)

Thus, as a practical matter, what you want to do is to install in one mode and then install a boot loader for the other mode in addition to the original boot loader. You can do this in either order. A few complications include:

  • MBR vs. GPT -- Ubuntu uses the MBR partition table by default for BIOS-mode installs and GPT by default for EFI-mode installs. It's usually possible to cross partition table types and boot modes (MBR/EFI and GPT/BIOS), but there are subtle complications possible. Personally, I'd go with GPT, but this will necessitate creating a ~1MiB BIOS Boot Partition on the disk, and you must be aware of this need.
  • EFI boot loader filename -- If you install Ubuntu in EFI mode or use automated scripts to install a boot loader after the fact, it will probably put the boot loader in EFI/ubuntu/grubx64.efi or something similar, and register that filename with the NVRAM. This works fine for a regular installation to a hard disk. To make a "generically" bootable external EFI medium, you must instead install the boot loader as EFI/BOOT/bootx64.efi, which is a "fallback" filename that the firmware will attempt if it can't find something else or if you explicitly tell it to boot from an external medium. Setting up in this way will require using special boot loader installation options or manual setup after the fact.
  • Boot loader selection -- Installing on an external disk to be moved from computer to computer is tricky enough for one boot mode. Adding a second creates a complication if you use GRUB: The GRUB configuration files must be slightly different for each boot mode. Thus, you must either "dive deep" into GRUB configuration or use two different boot loaders -- say, GRUB for BIOS and rEFInd for EFI; or LILO for BIOS and GRUB for EFI.
  • Secure Boot -- Some, but not all, EFIs support Secure Boot. Some, but not all, of these EFIs have Secure Boot enabled. Most, but not all, of these computers use Microsoft's Secure Boot keys. If Secure Boot is enabled, only boot loaders signed with an installed key will be bootable. Knowing the systems to which you want to deploy will help you decide how to set up the EFI side of the boot loader. For instance, if you want to be able to boot on any random Windows system with minimal fuss, you'll want a signed EFI boot loader, which normally means GRUB for EFI. If, OTOH, you know that most of your targets don't use Secure Boot, or if you don't mind jumping through some extra hoops the first time you boot one of these computers, you can use something else.

Personally, to do this I would prepare the external medium with GPT and all partitions (including both a BIOS Boot Partition and an EFI System Partition, or ESP) before installing, then install in BIOS mode and use Ubuntu's features to ensure that GRUB is installed. With that done, I'd manually install my own rEFInd to the ESP as EFI/BOOT/bootx64.efi (the fallback filename). The result will be a system that will boot in either BIOS mode or EFI mode. One complication of this approach is Secure Boot; the rEFInd binaries are not signed in such a way that they'll boot directly on most computers, so you'll need to add Shim or PreLoader to the mix, as described on rEFInd's Secure Boot page. This may be a big enough complication that it would be better to install in EFI mode, including lettering Ubuntu install GRUB. You'd then need to copy Shim and GRUB to work using the fallback filename and install some other BIOS-mode boot loader.

Some additional reading on EFI-mode booting may be helpful. I recommend:


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »