From the Debian GRUBEFIReinstall pages:
-
Boot using UEFI into a live environment.
-
If
/sys/firmware/efi/efivars
is empty, reboot into the rescue system with theefi=runtime
kernel parameter set. Then, mount the EFI variables in the live environment by running:mount -t efivarfs none /sys/firmware/efi/efivars
-
Mount the system in the live environment, particularly the root and /boot/efi partitions.
-
Bind-mount virtual filesystems:
for i in /dev /dev/pts /proc /sys /sys/firmware/efi/efivars /run; do sudo mount -B "$i" /mnt"$i" done
-
Chroot into the system.
-
Install
grub-efi
(and make sure thatgrub-pc-bin
remains installed). -
Re-install GRUB:
grub-install --target-i386-pc /dev/<DEVICE> --recheck grub-install /dev/<DEVICE> --bootloader-id=<ID> --recheck
Check that the EFI directory (
/boot/efi
) is not populated. -
Update the GRUB config file by running
update-grub
. -
Exit the chroot, unmount, and reboot.
Note: If the base system is LUKS-encrypted, make sure the device name used when unlocking is the same as the one used when unlocking during the normal boot sequence.