1

I needed a linux-based system for my work, and because I rely on windows and have no other devices, I wanted to dual boot windows and ubuntu. In my case, I had an external SSD, so I decided to install ubuntu on the external ssd, leaving everything as is.

In my setup, I have 3 drives:

  1. Internal SSD: has Windows 10 installed, and an EFI partition (I will come to that later)
  2. An HDD: with my data, should be completely irrelevant.
  3. External (USB) SSD: has Ubuntu 20.04 installed and configured, two partitions: root and swap (in that order, in case it matters), swap is 7GB, root is the rest.

My boot menu has two elements, regardless of whether the external SSD is connected or not. The two elements are (in order): ubuntu, and Windows Boot Manager both with the same drive id, so I believe both are likely installed in the EFI partition.

If the external SSD is connected, GRUB loads and asks me whether I want to load Ubuntu or load Windows 10. Perfectly okay, later on I would love for it to just load ubuntu automatically, but that's not my (current) issue.

However, if the external SSD is disconnected, GRUB still loads, but freaks out and gives me a CLI which I dunno what to do with. Typing exit just "crashes?".

Switching the boot order completely ignores Ubuntu; always loads Windows.

Ideally, I would want to move GRUB to the external SSD, and make it so it loads Ubuntu by default (or shows me the window) if it is connected, loads Windows if it is not.

Trying to follow this, I attempted to run sudo grub-install /dev/sdc, but it finishes almost instantly and nothing seems to be changed. I know I can probably remove the ubuntu loader using something like this, but I don't want to do that without first installing grub in case it needs to be done from ubuntu.

EDIT: I also ran a grub-update. In my external ssd, I currently have a boot folder (I dunno if it's been always there, or if it was added after I grub-installed). But it doesn't seem to show up in my boot menu.

I think my issue is quite similar to this one, but unfortunately it is not answered, and the comments suggest reinstalling ubuntu (which I really don't want to do)

TLDR; Both GRUB and Windows Boot Manager reside currently in the same drive, I want to move just GRUB to the external drive.

  • The Ubuntu installer always installs Grub to the first drive's EFI, irrespective of an eventual different choice during installation. Now, that "bug" aside, considering that in either case you'd need to change the boot order in UEFI, I see no point in having an EFI partition in the external drive unless you want some "portability" (other UEFI systems only and may not work reliably with certain proprietary drivers installed). If intended only for that computer just keep it that way. – ChanganAuto May 05 '21 at 20:04
  • portability could be nice.. but if the external drive is disconnected grub loads and doesn't allow me to boot into windows... is there a fix for that.? – Megadardery May 05 '21 at 21:45
  • 1
    If you want the portability, you have to have an ESP on external drive & copy /EFI/Boot & /EFI/ubuntu to external drive's ESP. External drives only boot from /EFI/Boot/bootx64.efi like live installer. Full install has full version of grub & needs both /EFI/Boot & /EFI/ubuntu. Then you can set external drive as first in boot order & internal drive as second. Removing /EFI/ubuntu from internal drive once you know it works. Set external drive as first in UEFI boot order & Windows as second. If external drive not found it then should auto switch to boot Windows. Or from UEFI or grub choose. – oldfred May 05 '21 at 22:57
  • 1
    That works, nice. The devil is in the details though but it's not too hard. Thanks, you should write your comment as an answer so I can mark it as the accepted answer. – Megadardery May 06 '21 at 01:13
  • To make things easy install Ubuntu from image file to USB as shown here: https://askubuntu.com/questions/1300454/easy-full-install-usb-that-boots-both-bios-and-uefi boot the USB and run sudo update-grub to add the internal drives to the USB boot menu, then continue as oldfred says. – C.S.Cameron May 06 '21 at 01:44

0 Answers0