How to determine if the system is booted in BIOS or UEFI mode

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux (RHEL)

Issue

  • How to determine if the system is booted in BIOS or UEFI mode
  • Is the system booted in BIOS or UEFI mode

Resolution

  • To find out if your system was booted as EFI/UEFI or BIOS mode, check if the following directory exists:

      /sys/firmware/efi
    
  • Running the following command will check the above directory and output UEFI or BIOS depending on whether the directory exits or not:

      # [ -d /sys/firmware/efi ] && echo UEFI || echo BIOS
    
  • Additionally, look for "EFI" in dmesg output:

      # dmesg | grep -i "EFI"
    

    For example:

      # dmesg | grep -i "EFI"
      [    0.000000] efi: EFI v2.70 by EDK II
      [    0.000000] efi:  SMBIOS=0x3fbcc000  ACPI=0x3fbfa000  ACPI 2.0=0x3fbfa014 
      [    0.000000] efi: mem00: type=3, attr=0xf, range=[0x0000000000000000-0x0000000000001000) (0MB)
      [    0.000000] efi: mem01: type=2, attr=0xf, range=[0x0000000000001000-0x0000000000002000) (0MB)
      [    0.000000] efi: mem02: type=7, attr=0xf, range=[0x0000000000002000-0x00000000000a0000) (0MB)
      [    0.000000] efi: mem03: type=7, attr=0xf, range=[0x0000000000100000-0x0000000000806000) (7MB)
      ...
      <output omitted>
    

Diagnostic Steps

  • dmesg output can be a little trickier as there might be a few "EFI" lines even on a system that is booted in BIOS mode, especially if the firmware is actually EFI/UEFI based but legacy boot is used to boot in BIOS mode. For example:

      EFI Variables Facility v0.08 2004-May-17
    
  • A system booted in EFI mode will have many lines similar to those shown above, particularly a long series of efi: mem## lines.

      [    0.000000] efi: mem00: type=3, attr=0xf, range=[0x0000000000000000-0x0000000000001000) (0MB)
    
SBR
Components
Category
Tags

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.