0

Good evening, I wanted to install (k)Ubuntu to an external Samsung T5 SSD, in order to be able to use it on different PCs. On my primary laptop, I booted from a Kubuntu 20.04 live USB stick, inserted the T5 and installed on the T5 (/dev/sdc), telling it to install the bootloader there, too (I checked 3 or 5 times). It completed the process fine, but it's not working (very much):

  • the main laptop doesn't start if I don't have the T5 SSD plugged in;
  • if I plug it in, it starts a GRUB screen that allows me to boot either from the T5 or from the laptop's internal drive. Both work fine, but of course I have to keep the T5 in
  • The T5 doesn't boot in any other PC, even where the Kubuntu Live USB drive boots perfectly fine

So, for you kind guys, my two questions:

  • how can I restore my laptop to boot without the T5? It's an Ubuntu 20.04 BTW.
  • It's possible to install Kubuntu on the T5, and what is the proper procedure to ensure that it boots on any (well, on more than one) system?

Thanks a lot!

-- G.

  • 2
    try booting Ubuntu from the laptop's internal drive and running sudo update-grub and then sudo grub-install /dev/sdX, making sure that /dev/sdX is indeed the laptop's internal drive. that should fix the laptop's boot. – ashvatthama Jul 26 '20 at 19:39
  • 1
    Thanks a lot, it worked!! It was /dev/nvme0n1, I don't know if it's related to the problem. How can I upvote your answer? – Germano Rizzo Jul 26 '20 at 19:45
  • Also see this answer for how to work around the bug. Finally if you find the answer below to be correct, please consider accepting the answer by clicking on the gray check mark ✔and turn it green ✅. This will help others with the same problem. – user68186 Jul 27 '20 at 19:27

1 Answers1

2

Basically, for UEFI installs, the installer puts grub on the first EFI it sees, on the internal disk, but the grub files are on the SDD, so boot fails without the SDD. See launchpad bugs 1173457,1396379, and add yourself to the "Does this affect me" list.
https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1396379
https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1173457
If you have an EFI partition on the SDD, simply copy everything from the internal disk's EFI to the SDD's EFI. Then it should boot on other machines by selecting the device as the boot device. To fix the internal disk, just reorder the first boot choice to be the original Windows selection (so grub does not even run). The internal device default bootloader, /EFI/Boot/bootx64.efi was probably replaced by a copy of grub, but the original was renamed to bkp.... You may change it back, but the device bootloader normally would not even be used if you are booting off an nvram selection. You can successfully run grub directly and put it where you want it, grub works, it's just the installer that ignores your choice and puts it on the first EFI it sees.


Removing the internal hdd, either physically or via BIOS settings is the easiest way to get the installer to do the right thing. You should be able to temporarily remove the EFI flag on the internal disk, and restore it after the instal -- that might work, as might running the install from the "Try" desktop, and in a terminal, unmount the unwanted hdd EFI, and remount the sdd's EFI (if you made the SDD's EFI in advance). The EFI partition just has a FAT filesystem, and the bootloaders are just files, so no special tools needed to slip binary blobs between partitions like under a legacy install.

ubfan1
  • 17,838
  • Thanks for the lengthy explanation. On the SSD there's no EFI partition, but it's just installed so it's not a problem to install again. How can I install correctly this time, or at least how can I create a EFI partition so that I can copy there the main hdd files? Last time I created the partitions manually, maybe letting the installer do the automatic stuff will work? – Germano Rizzo Jul 26 '20 at 20:00
  • From the bug page: "Easiest workaround is to use gparted or similar to remove the EFI/boot flag on existing EFI partitions before the install." But doing so wouldn't make my internal device unbootable? Can I restore it later? What if I disable the hdd in BIOS, I used to do it in the 2000s but I don't know if it's still allowed. Or I could physically remove the HDD. – Germano Rizzo Jul 26 '20 at 20:06
  • The main issue is that the Ubiquity installer only uses the first ESP - efi system partition it sees. I have not had sucess with changing boot flag, but before exiting installer, turn boot flag back on the ESP on internal drive. You do want to partition in advance to have ESP on external drive. Worst case you can always reinstall grub to external drive's ESP with Boot-Repair or manually. Most find disconnecting drive either physically or logically works best. Also another work around in bug report posts #23 & #26. – oldfred Jul 27 '20 at 03:45