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?
man efibootmgr
Examples: https://askubuntu.com/questions/486752/dual-boot-win-8-ubuntu-loads-only-win/486789#486789 – oldfred Apr 03 '20 at 14:20sudo 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:52sudo 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