Couldn't open either sysfs or procfs directories for accessing EFI variables.

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux 6.4
  • System with EFI Firmware instead of BIOS

Issue

  • Trying to access the EFI system tools results in "Couldn't open either sysfs or procfs directories for accessing EFI variables."
# efibootmgr -c -w -L "Red Hat Enterprise Linux" -d /dev/sda -p 1 -l "\\EFI\\redhat\\grub.efi"
Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.
Try 'modprobe efivars' as root.
# efibootmgr
Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.
Try 'modprobe efivars' as root.
# modprobe efivars
FATAL: Module efivars not found

Resolution

Change the system firmware from BIOS compatibility mode to EFI mode.

Root Cause

When the system is in BIOS compatibility mode, the EFI functionality of the firmware is not presented to the operating system.

As such, the Linux kernel did not detect the hardware as an EFI system, so did not load the EFI functionality supplied by efivars.

Diagnostic Steps

  • The kernel is built with CONFIG_EFI_VARS=y
  • This moves efivars.ko into the kernel instead of a module - reference
  • A confirmed EFI system does have /sys/firmware/efi but does not have efivars module
  • Check if the system firmware is in EFI mode and not BIOS Compatibility mode

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments