0

I am new to Linux. I have installed Linux on a partition on my external HD. The partition is at number 2 and format of the partition is ext4. I also have a linux-swap partition on the same HD at number 5. Ubuntu appears in the UEFI boot menu on the PC which I had used to install Ubuntu in the HDD, however when I try to boot other PC using the HDD the Ubuntu partition is not shown in the UEFI boot menu. It is also not shown in the Legacy setup inside the BIOS settings. the sudo efibootmgr command in CLI lists boot preferences including the name of the HDD

Please help

apu
  • 1
  • You need to use BIOS in other computer and set it to boot USB hard drive first. You don't say model/make of PCs, but can also google them and find which way to choose which drive to use during booting up. Usually need to hit key when PC makers icon shows up screen. – crip659 Dec 08 '19 at 19:11
  • If crip659's suggestion does not fix the problem I would look at your external drive and check if the installation process you followed has left an efi partition on the external drive or if all the boot information is left behind on the internal drive of the machine you did the install on. – PonJar Dec 08 '19 at 22:51
  • @crip659 Thanks for your reply. I have already tried to do go to BIOS setup and set the boot preference, the issue is even in BIOS setup the partition on which Linux is installed is not shown. I had done the Linux installation on a Lenovo machine and I am trying to boot from the HDD on a HP Pavallion 15 series laptop. – apu Dec 09 '19 at 02:59
  • @PonJar Thanks for you reply.Yes I have checked the HDD on the windows disk mgmt, there is no efi partition in the drive, what should I do now? – apu Dec 09 '19 at 03:01
  • I’ve not done what you are attempting myself but I’d suggest you take your disk back to the machine you installed from and try to install grub to the external drive. – PonJar Dec 09 '19 at 03:52
  • @PonJar, any idea as to how that is done? – apu Dec 09 '19 at 05:42
  • Might be worth confirming what you want to achieve here. I assume you want to be able to boot the external drive from more than one PC in UEFI mode, correct? I think UEFI complicates this somewhat and that the install process should have created an EFI partition on the external drive. It may be that you missed a step that would have ensured that and ended up adding boot information for the external drive to the EFI partition of the internal drive of the Lenovo machine. I’ll do some research to see if there is a guide out there for this particular use case. Probably easier to reinstall – PonJar Dec 09 '19 at 11:39
  • BIOS will usually just set the boot order of drives. If you set your ubuntu drive as first, does it boot/load up on the HP? – crip659 Dec 09 '19 at 12:54
  • @crip659 actually the BIOS is not showing the UBUNTU drive,as pointed out, the problem I guess is the missing efi partition on the HDD – apu Dec 09 '19 at 15:46
  • @PonJar Yes you are right in underlining the problem. I followed the steps in https://www.youtube.com/watch?v=glFCEauwGgw and https://www.youtube.com/watch?v=glFCEauwGgw. If I have to reinstall again I dont want to make the same mistake – apu Dec 09 '19 at 15:49
  • That’s the same video link twice. He does not start the process in UEFI mode so if you copied that I don’t think you will get the outcome you are looking for – PonJar Dec 09 '19 at 22:56
  • @PonJar sorry about the link, but the procedure I followed was the same so yeah the problem seems to be the absence of EFI on HDD – apu Dec 10 '19 at 05:08

1 Answers1

1

UEFI only boots external drives from the ESP - efi system partition on that drive and using /EFI/Boot/bootx64.efi.

You must have an ESP on the external drive. And Ubiquity installer does not give that option with auto installs & will not use ESP on external drive. Ubiquity only installs grub to first ESP usually sda or NVMe drive that has Windows' ESP. These instructions still apply, but now you do not need swap partition. Ubuntu creates a swap file.

http://askubuntu.com/questions/743095/how-to-prepare-a-disk-on-an-efi-based-pc-for-ubuntu

How to use manual partitioning during installation?

Then you can either reinstall grub specifying the external drive's ESP. Often easier with Boot-Repair, but you can just to a full reinstall if you are booted into your install. Or you can copy all files from internal drive's ESP to external drive's ESP. You need both /EFI/Boot & /EFI/ubuntu as Ubuntu's grub for a full install expects more boot files in /EFI/ubuntu folder. Or you can do a work around when installing to unmount internal ESP & mount external ESP.

https://help.ubuntu.com/community/Boot-Info

sudo dpkg-reconfigure grub-efi-amd64
sudo grub-install --efi-directory=/boot/efi

Work around in this bug report, see post #23 & later (I just installed 20.04 to sdb with this procedure), I double check mounts in terminal and ESP mount does not show until about when you add user name & password. My ESP was on sdb1:

https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1396379

mount
sudo umount /target/boot/efi
sudo mount /dev/sdb1 /target/boot/efi
oldfred
  • 12,100
  • thanks, let me try this out – apu Dec 10 '19 at 05:08
  • I prefer UEFI, but you can install in BIOS mode to external drive. You then can use either gpt or MBR partitioning, but gpt requires a bios_grub partition for the BIOS version of grub to install correctly. But then you have to select BIOS boot when booting it. If using on an old system that is BIOS only, then you have to use BIOS. You can keep gpt partitioning as that has some advantages of its own, but if BIOS need a bios_grub partition for grub-pc to install correctly. I used to have both ESP & bios_grub on all my full installs to flash drives so I could convert if needed. – oldfred Dec 10 '19 at 14:24