efibootmgr and it will list out all the boot entries your system has set
root@queeg-500:/boot/efi# efibootmgr BootCurrent: 0001 Timeout: 1 seconds BootOrder: 0001,0000,0002,0004,0003 Boot0000* Windows Boot Manager Boot0001* debian Boot0002* debian Boot0003* Hard Drive Boot0004* Windows Boot Manager
You can see from this list my system has five boot options set, and that the default one to boot from is
Boot0001 which is Debian. I don’t quite understand why there’s two Debian and two Windows, but it might be related to my system offering me the option of booting Debian normally, or in a safe mode, and Windows having the same options.
You can also see what order the machine will attempt to boot in. This is the same as the options inside the PC’s UEFI/BIOS boot menu.
If Grub is failing to install, it could be that any of those options says “unused” or something else invalid.
The entries in that menu can be removed using the command
efibootmgr -b 0003 -B, where the 0003 is the relevant number from the list above.