0

I have a full Ubuntu install on a USB that I keep on my keyring so I can have a portable, personal computer. However I cant boot from it on UEFI machines, even if secure boot is turned off. Is there any way to make it UEFI compatible?

Harvs
  • 143

1 Answers1

0

I haven't tested this but it should work. First, you have to prepare the USB drive:

  1. Install and launch GParted on the running OS from the USB.
  2. Shrink a partition to make a 200 - 400 MB space at the end (or the beginning, but not in the middle of the drive). Make a new primary partition in that space and format it as FAT32.
  3. Put the esp flag on it using GParted.
  4. Mount it using terminal.

To make it EFI bootable:

  1. Install package grub-efi-amd64-bin.
  2. Run sudo grub-install --target=x86_64-efi /dev/sdaX where X is the number of the FAT32 ESP partition you created earlier.
  3. Run sudo update-grub. It should detect and add Ubuntu to the boot menu.
  4. Check the ESP partition. You should find a file at /efi/ubuntu/grubx64.efi. Copy and rename this file in a boot folder so that you get /efi/boot/bootx64.efi.
  5. Shut down, plug USB in UEFI computer and boot.

Disclaimer: it should work. I haven't tested it personally.

Cornelius
  • 9,653