Score:0

Fix Multiple Ubuntu Instances in UEFI Boot Manager

in flag

I recently installed Ubuntu on to its own drive (Sandisk). I ran in to the issue where grub was giving me this error when trying to boot in to Windows

error: file '/efi/Microsoft/bootmgfw.efi' not found

Upon taking a look in the BIOS I see multiple entries for Ubuntu even though I had selected the specific Sandisk drive during install. How can I go about cleaning this all up ?

I can safely boot in to Windows when I select the windows boot manager as the primary.

Boot info - https://paste.ubuntu.com/p/PHnfqhB34x/

enter image description here

oldfred avatar
cn flag
UEFI or BIOS installs, newer systems should be UEFI. Ubuntu normally installs both shimx64.efi & bootx64.efi, so you may have two entries. And It looks like you have Ubuntu installed to two different drives? Which do you boot from? Remove UEFI entries: https://askubuntu.com/questions/1198221/cloning-ssd-also-cloned-boot-options To see details: Please copy & paste the pastebin link to the Boot-info summary report ( do not post report), use ppa version with your USB installer (2nd option) or any working install, not Boot-Repair ISO (unless 21.10) https://help.ubuntu.com/community/Boot-Repair
ubuntububuntu avatar
in flag
I installed Ubuntu only once and had set the install disk to be the Sandisk. Based on the space available on my Windows drive, nothing has changed, so Im guessing its some sort of error. Ive updated the post with my boot info
cc flag
See launchpad bug 1396379. Look at the Sandisk's EFI partition, and see if anything at all got copied into /EFI... -- probably not as the bug has not been fixed. The first disk's EFI probably now contains an ubuntu directory with the grubx64 and shimx64 bootloaders, and the Boot directory got a copy of grub or shim in bootx64.efi as the default device bootloader (which does not get an "ubuntu" entry), so no idea where the second one came from, but careful deleting the one on "Toshiba" as that one may be the only one with a proper setup.
ubuntububuntu avatar
in flag
oh boy, so per that bug even though I asked the Ubuntu installer to use Sandisk for all things Ubuntu, it went ahead and used the Toshiba NVME ( where Windows is installed ) ??
cc flag
Just the bootloaders went to the first disk (regardless of what you specified as the location), the actual install did go to the Sandisk. If the Sandisk is not a removable disk, there's probably no problem, but if it's removable, then with grub running on the first disk, and needing some files on the second disk, your system wont boot when the Sandisk is not present. And do add yourself to the "Does this affect me" list on the bug -- it so old because not enough people did that.
ubuntububuntu avatar
in flag
The Sandisk is a removable disk, one that I got specifically for Ubuntu. I was wanting to wipe the Sandisk and install either PopOS or Fedora. I was also wanting to move the Windows disk to a bigger drive. So if I wipe everything will it clean things up a bit ? Ill add myself to the Does this affect me list
Score:2
cc flag

Not sure what your intentions are for other OSes on the Sandisk, but I'd suggest installing grub onto the Sandisk (you did make an EFI partition on it, right?) or just copy everything on the internal disk's EFI to the Sandisk's EFI works too, no edits needed. The grub-install does work, check the options needed like --removable and --uefi-secure-boot and --efi-directory. (there was an old bug on the --uefi-secure-boot that didn't use shim the way it should, but might have been fixed by now). Then try booting the sandisk directly, the device default bootloader should be grub and work.

Now to clean up the internal disk, all you need to do is remove the ubuntu directory with the grub EFI entries with efibootmgr, and put the Sandisk first in the boot order. Also, look in the internal disk's EFI/Boot directory, and replace the bootx64.efi (which is a copy of grubx64.efi or ahimx64.efi) with the backed up Windows bootmgfw.efi, named with a bkp in the name so the file should be obvious (or just copy the bootmgfw.efi from the EFI/Microsoft... directory and rename it bootx64.efi.

This should leave your Sandisk as a bootable device on any system (well maybe with hardware issues) and your host system booting Windows when the Sandisk is not attached.


I don't know what a new windows install will do, but if you start from scratch, I'd assume a new EFI partition with just the Windows bootloaders would be made. So if you had set up the Sandisk with a working grub, then you should be able to attach it as needed, and install whatever you want on it.

ubuntububuntu avatar
in flag
just one clarification -> I was planning to upgrade the internal nvme ( where Windows is installed ) and just do everything from scratch. If I went that route then a brand new Windows Boot Loader etc would be installed on to the internal drive? Once that is done then I go install any other Linux OS on the Sandisk as planned ?
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.