OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
boot-kernel high common DISPUTE

Fix "EFI variables are not supported on this system" during grub-install

archendeavouroscachyosmanjarogrubuefidesktoplaptop
AUDITED Audited against its sources and confirmed accurate.
RISK

grub-install --removable overwrites \EFI\BOOT\BOOTX64.EFI on the ESP. On a shared ESP that is the fallback loader other operating systems (and some firmware) rely on. Check what is there first.

Symptom

Repairing GRUB from a live USB fails:


grub-install: error: cannot find EFI directory.

or


EFI variables are not supported on this system.
grub-install: error: efibootmgr failed to register the boot entry

Afterwards the firmware still boots straight to Windows or to the BIOS setup screen.

Cause

The live USB was booted in **legacy/CSM mode**, so the kernel never exposed efivarfs and GRUB cannot write a UEFI boot variable. A UEFI installation cannot be repaired from a BIOS-mode live session. Secondarily, efivarfs may simply not be mounted in the chroot.

Fix

Confirm which mode the live session is in:


ls /sys/firmware/efi        # if this directory does not exist, you booted in BIOS mode

If it is missing: reboot, enter the firmware boot menu, and pick the entry prefixed **UEFI:** for your USB stick. Disable CSM/Legacy boot in the firmware if both entries appear.

If /sys/firmware/efi exists but efivars is not mounted (common inside a chroot):


sudo mount -t efivarfs efivarfs /sys/firmware/efi/efivars

Then chroot and reinstall GRUB, pointing --efi-directory at wherever the ESP is mounted in the installed system:


sudo arch-chroot /mnt
pacman -S grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
efibootmgr -v          # confirm the GRUB entry now exists

If the ESP is at /boot/efi instead, use --efi-directory=/boot/efi.

On firmware that refuses to keep custom boot variables (many consumer laptops), also install to the removable-media fallback path:


grub-install --target=x86_64-efi --efi-directory=/boot --removable

Verify

efibootmgr -v lists a GRUB entry pointing at \EFI\GRUB\grubx64.efi, and the machine boots to the GRUB menu without using the firmware's one-time boot override.

Sources

grub-install-efi-variables-not-supported