I am trying to install Ubuntu from past 3 days and constantly getting the above mentioned error. I have windows 10 with UEFI and want to dual boot it with windows using Ubuntu image in USB. For the first time it installed properly but efibootmgr was not able to detect Ubuntu so I was not able to change boot preference. So I deleted the partition and again created the partition and booted into Ubuntu. Since then I'm getting that error. Please help me.
You have to install grub into /dev/sda2 as it is the ESP where bootloder belong in UEFI boot.
Why? on preinstalled windows 10 there is following partion created befor installing linux for the firtst time:
- 300 MiB restore
- 100 MiB ESP (needs the mount point /boot/EFI in the system later)
- most of the disk windows C
- optional windows D for data, videos programs, document stiff like that
so to install grub rigt you have to install it on sda2.
sudo grub-install [options] /dev/sda2
grub-install --help for details for options. Also
man 8 grub for more details on grub or the grub Manual online here.