Installed Ubuntu 15.1 on USB (full install) but it won't boot

I'm still a newbie with Linux but I'm trying to learn. I have two USBs, one is 4GB and has the ISO install of Ubuntu (I think it's called live, the one with maximum of 4GB of permanent storage) and got a 64gb usb to make a permanent full install on it. I installed it following this tutorial and everything looks fine (I had to create the EFI partition with the Terminal though) but it just won't boot, the live install boots without problems.

I'm using the school's computers which have the UEFI menu password protected so I can't access that and I won't have a laptop for like 3 weeks (main reason why I'm doing this). I tested it with a friend's laptop disabling the Secure boot but it still wouldn't boot. I also saw that some tutorials don't add the EFI partition so I tried without that one and still won't work. And I know it's not the 64GB usb not booting because I had a live install on it too before and it booted fine.

Please, I have been trying to make it work for two days now, any ideas? I can barely understand this stuff so if you could explain step by step that would be awesome.


Solution 1:

Under EFI, the boot loader is stored as an ordinary file on an EFI System Partition (ESP). Which boot loader is launched is stored in NVRAM. In EFI mode, a standard Linux install places its boot loader as EFI/ubuntu/shimx64.efi (which in turn calls EFI/ubuntu/grubx64.efi) on the ESP, and stores a reference to this in NVRAM. This works fine when the disk is an internal disk. With an external disk, though, the NVRAM variable may be erased when the disk is unplugged from the computer; and even if it's not, the disk will be bootable only on the computer on which the OS is installed.

Because OS installers and emergency utilities must be prepared on computers other than those on which they're run, EFI provides a special filename for such boot loaders. On x86-64 systems, that name is EFI/BOOT/bootx64.efi. The Ubuntu installer therefore uses this name. You can do the same yourself after installing to a USB flash drive:

  1. Mount the ESP that's on the USB flash drive. Suppose it's in /mnt.
  2. Copy the original boot loader files by typing cp -r /mnt/EFI/ubuntu /mnt/EFI/BOOT.
  3. Rename the copy of shim by typing mv /mnt/efi/BOOT/shimx64.efi /mnt/efi/BOOT/bootx64.efi.

The disk should now be bootable on any 64-bit EFI-based computer. Of course, you may need to use the computer's built-in boot manager, much as you would on a BIOS-based computer, to boot from the USB flash drive.