Score:-2

Dual boot woes - how to have one boot loader for each drive?

fj flag

I'm struggling to get a simple dual-boot setup where I have two independent drives without having to disconnect one of them when installing the second OS. In other words, I'd like each drive to have its own EFI partition and bootloader.

I thought I could do it by creating an EFI partition on my Ubuntu drive and selecting that partition as the bootloader location, but apparently that made no difference. Here's my situation, and whoever manages to help me fix this with the least amount of pain gets a cookie and my eternal gratitude:

HD 1: A Nvme drive with a Win11 installation - and of course an EFI partition with the windows boot loader.

HD 2: An empty SSD drive onto which I wanted to install Ubuntu using this image: ubuntu-22.04.2-desktop-amd64.iso.

Expected behavior:

HD1 and Win11 installation are untouched, including the EFI partition.

HD2 has its own boot partition, along with the Ubuntu root

The system boots by default into Windows. If I want Ubuntu, I have to go to the BIOS and select it.

If I select the Ubuntu drive in the BIOS, I boot straight into Ubuntu (no possibility of selecting Windows after that)

What I did to try to achieve it:

Booted into the Ubuntu installer, created 2 partitions in HD2: a small EFI partition (formatted as FAT32) and a primary partition for root (formatted as ext4).

Selected the HD2 as the location of the boot loader.

Actual result:

Expectation #3 is fulfilled, but #1 and #2 are not. In fact, for god knows what reason Ubuntu's boot is in HD1, which means HD1's EFI partition has been modified, and I have a feeling that if I just format HD2 again I won't be able to boot into Windows again.

What now? How can I fix this mess in the simplest way possible? How can I move Ubuntu's boot stuff onto Ubuntu's drive? And how can I safely erase all trace of Ubuntu on the Windows drive?

And if you are feeling especially charitable/patient, could you care to explain how the behavior described makes sense? In what parallel dimension would one want two drives that have nothing to do with other so tightly coupled that one stops working without the other?

Thank you in advance!

guiverc avatar
cn flag
Please be specific with details; you mention Ubuntu and *Ubuntu installer*, but as Ubuntu has many products (with those providing *five* installers selected by the user via the ISO downloaded), we cannot currently know what Ubuntu, nor which installer you are using. Are we to guess? What Ubuntu product? what release? even what ISO did you use? (we can then know if you're asking about `subiquity`, `ubiquity`, `calamares`, *ubuntu-desktop-installer* etc).
ar flag
I don't know how to "fix" it, but I can tell you what you could have done to avoid this "problem".
Nmath avatar
ng flag
What you've tried to do goes against how UEFI is designed to work which is why you're having problems. You're supposed to have one EFI partition for the entire system no matter how many drives or operating systems you have. Yes, it is possible to finagle this in different ways to have multiple EFI partitions, but it goes against the specifications. EFI is fundamentally an extension of your motherboard firmware. You have only one motherboard so it's only supposed to have one EFI.
oldfred avatar
cn flag
You can have an ESP on every drive. And then UEFI boot entries using each ESP. UEFI uses GUID to find ESP. See old bug report. https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1396379 Major issue with external drives has never been resolved. Multiple work arounds in bug report. See post #55 for what I do. But this is probably easier for most: Remove esp flag from Windows before install to second or external drive - Tim Richardson https://askubuntu.com/questions/16988/how-do-i-install-ubuntu-to-a-usb-key-without-using-startup-disk-creator If you have ESP, you can just reinstall grub.
btonasse avatar
fj flag
@guiverc while I'm usually all for educating new contributors to try to increase the quality of the posts, I think the exact Ubuntu version and installer is irrelevant here, no?
btonasse avatar
fj flag
Thank you @Nmath, that partially answers my last question, but it is still unclear why it was designed this way. It makes no sense to me. But I guess this is not the forum to discuss that...
btonasse avatar
fj flag
Thanks @oldfred, I ended up doing something like that to solve it. Will answer my own question
guiverc avatar
cn flag
I've found some installers much easier to get exactly what you want compared to others... thus the installer be it *di*, `ubiquity`, `calamares`, `subiquity` or *ubuntu-desktop-installer* makes a difference in my opinion. Some let you easily create multiple ESPs (*versions matter here too!*), doing whatever you ask for where as others follow standards closer & thus won't (*at least one for example doesn't indicate you've breached a standard/rule & self-adjusts your choice to be standards-compliant*) so yes I believe it matters. Your product/release/ISO dictate which installer you use.
btonasse avatar
fj flag
@guiverc fair enough. I'll add that info to the post, even though it's solved now.
Score:0
fj flag

Thank you for all the comments! Here's how I solved it:

  1. Boot into Ubuntu
  2. Get the UUID of the already-existing ESP partition on my Ubuntu drive (/dev/sda1): blkid /dev/sda1
  3. Edit /etc/fstab, replacing whatever UUID is on the line that defines/boot/efi with the id you got from #2.
  4. Save the file, and now run sudo umount /boot/efi, then mount it again with sudo mount -a (it will use whatever it finds in the fstab file.
  5. Install grub: sudo grub-install
  6. Remove grub from the Windows disk by mounting that EFI partition (mine was /dev/nvme0n1p2) somewhere and deleting the EFI/ubuntu folder.

And voila, now you have a sane dual-boot setup. I would still love to know what is the logic behind the "single EFI partition" design though, because it makes zero sense to me.

mook765 avatar
cn flag
The logic behind a single ESP is the fact, that bootloaders can happily coexist in a single ESP, each bootloader stored in it's own directory. It might be preferable though to install bootloaders in different ESPs, that's up t you. AFAIK the UEFI specification doesn't restrict numbers of ESPs on a dirve or on a system. I'd recommend that you remove `the annoyed overtones` from your question to avoid further downvotes, only technical details are relevant here.
btonasse avatar
fj flag
@mook765 you're right. Will edit the post
karel avatar
sa flag
The logic behind the "single EFI partition" design is derived from the huge variations in UEFI firmware which created the necessity for one design policy that works on almost all devices at the expense of added difficulties in customizing the boot process for any given device. Please don't forget to click the gray check mark beside your answer to mark it as accepted after 2 days.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.