Linux on external drive / UEFI

bootdebianhard drivelinuxuefi

I'm stuck on a problem : I want to make my external USB3 HDD self bootable.
For now I must go through UEFI boot option.

Explaination of my setup:

  • I have a Win8 Asus Laptop with UEFI.
  • I have installed Debian on an external HDD on an encrypted partition.
  • I want to keep Win8 on the laptop HDD and boot on the external HDD when I want (so don't touche to UEFI)

Now in UEFI setup I have two options :

  • Debian
  • Windows

For now, everything is ok.
But, I can't boot on Debian directly from the USB, it seems like I must use a 'loader' from /dev/sda and this is annoying for a nomad HDD. I must go with UEFI boot which go on /sdb/boot where the grub is set.

On Debian, I can see a /dev/boot/efi directory and this is mounted and located on /dev/sda1.

I tried to make an MBR for the external HDD with install-mbr : no success.

Did someone have a clue for making my HDD self bootable ? How can I get rid of the UEFI boot option and boot from an other computer ?
Did I miss something during the install ?

Thank you in advance for your responses.

Cheers

Best Answer

If you want the drive to boot on arbitrary computers, you have two choices:

  • Do a BIOS-mode installation, placing a BIOS-mode boot loader in the MBR of the disk. This will work most reliably if you partition the disk using the MBR partitioning system, too. The trouble is that you'll almost certainly have to use the target computer's built-in boot manager to boot from that disk, and to do so in BIOS mode. You may need to set firmware options to enable BIOS mode (aka CSM mode or legacy mode) booting, and you may need to disable Secure Boot.
  • Install an EFI-mode boot loader to the external disk's EFI System Partition (ESP), but change it from whatever name the OS gives it to EFI/BOOT/bootx64.efi. This is the fallback filename, and most EFIs will give you an option to boot from this file if it's found; however, you'll probably still have to enter the firmware's own boot manager to boot from the disk. Also, if the target computer uses Secure Boot, you'll need to either disable that or install the shim or PreLoader program on the external disk as EFI/BOOT/bootx64.efi (changing the name of GRUB or whatever other bootloader you use to grubx64.efi or loader.efi, depending on whether you use shim or PreLoader). Using shim or PreLoader is good for users, but it can be a pain to set up, particularly if your distribution doesn't support it.

There's a lot of information you might find helpful in understanding the issues. I recommend you read the following pages I've written:

You probably don't need to read all the sub-pages on the second page, but the first couple, and perhaps the section on Secure Boot, should be informative.

Related Question