1

Due to a problem during the installation (due, it seems, to the Ubuntu installer) in a Win 10/Ubuntu 18.04 multiboot system on separate drives, the bootloader was installed in the ESP partition of the Windows 10 drive. This is done by Ubuntu 18.04 so after boot the ESP partition of Windows 10 is mounted in /boot/efi.

The system still boots correctly but I would like to correct this situation by installing the bootloader in the ESP partition of the Ubuntu 18.04 drive by mounting the correct ESP partition in /boot/efi. In my case this is the to-do-list:

remove Ubuntu entry in UEFI:

sudo efibootmgr -b 0001 -B

remove Ubuntu folder in the ESP partition in the Windows 10 drive:

sudo rm -rv /boot/efi/EFI/ubuntu

sudo mount the Ubuntu drive ESP partition:

sudo mount -v /dev/sda1 /boot/efi

grub install:

sudo grub-install  
sudo update-grub

Edit /etc/fstab file, inserting the correct Ubuntu drive ESP partition UUID

Reboot

To avoid making a mess, do I have to "unmount" that partition before proceeding to mount the new ESP partition in /boot/efi or does mounting the correct partition replace the current one?

Andrew-63
  • 141
  • Copy files from one ESP to other ESP. Change mount of ESP in fstab to sdb's ESP. Reboot. And then delete ubuntu entry in UEFI and create new ubuntu entry in UEFI using sdb's ESP with efibootmgr. Then delete /EFI/ubuntu in sda's ESP. You can do a total reinstall of grub also, selecting correct ESP. See man efibootmgr Examples: https://askubuntu.com/questions/486752/dual-boot-win-8-ubuntu-loads-only-win/486789#486789 – oldfred Apr 03 '20 at 14:20
  • Thanks for the reply and adding a possible solution to the problem. I updated the question to explain how I intend to solve the problem and my doubts about monting Ubuntu drive ESP partition – Andrew-63 Apr 03 '20 at 18:42
  • If you have not updated fstab first, the grub install may not use your mount, but use the fstab? I would change fstab & issue sudo mount -a to remount it. If you try to create new mount, I would expect an error. You may also have to change parameters on mount in fstab. If 0077 change to defaults like this: https://askubuntu.com/questions/794725/can-i-remove-windows-boot-manager-from-dedicated-ubuntu-computer?noredirect=1#comment1197619_794725 – oldfred Apr 03 '20 at 18:52
  • if I understand correctly, after removing the "ubuntu" folder in the Windows 10 ESP partition, I should edit the /etc/fstab file inserting the Ubuntu drive ESP partition UUID (the fs default options in fstab are according https://wiki.ubuntu.com/FSTAB) then run sudo mount -a, install/update grub and finally reboot. A new entry in UEFI firmware will be created automatically after reboot? – Andrew-63 Apr 03 '20 at 20:55
  • A full reinstall of grub will create a new UEFI entry. You can see that with sudo efibootmgr -v before & after grub reinstall. If you just run sudo update-grub that just updates menu. If grub otherwise ok, you can just use efibootmgr to create new UEFI entry. Grub install uses efibootmgr as part of install process. – oldfred Apr 03 '20 at 21:02

1 Answers1

0

I think technically you may not have to unmount /boot/efi before mounting the new efi partition there (I believe the new mounting may be used, with the old still being there if the new is unmounted, but I'm not at all certain), but, when dealing with the same problem as you, I did unmount before mounting and all was well.

As an aside, I wouldn't remove the efi Ubuntu folder on the Windows drive until having confirmed the new efi Ubuntu folder on the Ubuntu drive is successfully being used after a reboot with sudo lsblk.