"EFI variables are not supported on this system"

The problem was simply that the efivarfs kernel module was not loaded.

This can be confirmed by:

sh-4.2# efivar-tester
UEFI variables are not supported on this machine.

If you are chrooted in to your new install, exit out, and then enable efivarfs:

exit
modprobe efivarfs

(efivarfs used to be efivars, so if this returns an error try modprobe efivars)

...and then chroot back in. In my case, this means:

chroot /mnt

but you should chroot the same way you did before.

Once back in, test again:

efivar-tester

This will no longer report an error, and you can install grub the same way you did before.

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub --recheck --debug

You will get this error if you have booted using legacy and not the UEFI method. You need to make sure to either select the UEFI boot item in the BIOS menu, or select UEFI as the default boot method.


I know, that's very old thread, but maybe will help for someone. Most guides suggest the same solution to mount virtual filesystems before chroot:

for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done

But now (maybe related to efivars/efivarfs changes) this loop skips one very special sub-mountpoint - /sys/firmware/efi/efivars and efibootmgr/grub fails.

So use this line instead:

for i in /dev /dev/pts /proc /sys /sys/firmware/efi/efivars /run; do sudo mount -B $i /mnt$i; done

Actual success story: Debian with 4.9.0-5 (efivars) saved by Arch Linux live cd (picked just because can boot uefi out of the box) with 4.14.9-1-ARCH (efivarfs) just by bind-mounting /sys/firmware/efi/efivars

Tags:

Uefi