Additionally. This solution helped me. The key is the sda1(in my case) in which efi boot resides. Have to check it in /etc/fstab in your linux distro:
Identifying if an Ubuntu has been installed in UEFI mode
An Ubuntu installed in UEFI mode can be detected the following way: its /etc/fstab file contains an UEFI partition (mount point: /boot/efi) it uses the grub-efi bootloader (not grub-pc) from the installed Ubuntu, open a terminal (Ctrl+Alt+T) then type the following command:
[ -d /sys/firmware/efi ] && echo "Installed in UEFI mode" || echo "Installed in Legacy mode"
If it shows: "installed in uefi mode" then you're home. Just few another steps.
Boot repair install:
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
Note: Do not follow this procedure if your computer is already booting correctly. Use this procedure only if you believe you've accidentally installed Ubuntu in BIOS/CSM/legacy mode and you want it to boot in UEFI/UEFI mode.
Start Boot-Repair, click on "Advanced options", go to the "GRUB location" tab.
- If you do not see a "Separate /boot/efi partition" line, this means that your PC does not have any UEFI partition.
In this case, exit Boot-Repair, then create an UEFI partition (see the "Creating an UEFI partition" paragraph above).
- If you see a "Separate /boot/efi partition" line, tick it then click the "Apply" button.
Boot repair will ask to fire some commands during the installation. Fire them. Should go ok. If not perhaps wrong partition for grub is chosen.
Also like it has been written in this post the uncheck box "secure boot" in "Grub Options" TAB
Boot Repair UI view
Hope this helps in future threads. The key is to install /repair grub using this boot/efi separate partition. In other cases commands which boot-repair asks for don't work at all.
- Comprehensive guide to UEFI idea Link 1