I was searching, but didn't find an obvious way to know if GRUB is using UEFI in the system boot, or the BIOS compatibility mode, or a full fledged BIOS. I found only Windows methods. Is there something in GRUB or the Kernel boot logs that shows if I'm using UEFI, EFI or BIOS?

up vote 30 down vote accepted

If you've booted using the UEFI firmware as opposed to using BIOS firmware then your system should make the EFI NVRAM variables available in:

/sys/firmware/efi/vars/

or

/sys/firmware/efi/efivars/

When booting using a BIOS (or the BIOS emulation mode of UEFI firmware) then these variables aren't available.

In fact, as @Santropedro pointed out, the path

/sys/firmware/efi

is missing when booting using a BIOS, which is easier to check.

  • +1 for a method that is much faster and gets straight to the point, rather than depending upon a particular string output from the firmware or additional packages that may not be directly relevant in the current boot. – underscore_d Nov 11 '15 at 19:00
  • 2
    What means "variables not available"? It's enough checking there is not a folders inside: /sys/firmware/ called "efi"? – Santropedro Jan 13 '16 at 3:57
  • @Santropedro - it seems that it does. I'll edit the post. Thank you. – garethTheRed Jan 13 '16 at 10:47

First method:

Ok, I booted up my UEFI box to check. First clue, near the top of dmesg. This shouldn't appear if you're booted via BIOS:

[    0.000000] efi: EFI v2.31 by American Megatrends
[    0.000000] efi:  ACPI=0xd8769000  ACPI 2.0=0xd8769000  SMBIOS=0xd96d4a98 
[    0.000000] efi: mem00: type=6, attr=0x800000000000000f, range=[0x0000000000000000-0x0000000000001000) (0MB)
⋮


Second method:

$ sudo efibootmgr
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000
Boot0000* debian

If you are not, then the following should appear:

$ sudo efibootmgr        

EFI variables are not supported on this system.

Note that you'll have to have the efibootmgr package installed. You can also attempt to list the EFI variables:

$ efivar -l 
... over 100 lines of output ...


Third method:

Check if you have a /boot/efi:

$ df -h --local | grep /boot
/dev/sda2       229M   31M  187M  14% /boot
/dev/sda1       120M  250K  119M   1% /boot/efi

Inside that partition should be the files that UEFI executes to boot.

If using any of these methods the relevant entries doesn't appear, is very likely you are not using UEFI.

  • 6
    /boot/efi is just some directory in /boot and the rest are installed packages - all would likely exist on a system that was installed in UEFI mode, but is now booted with the compatibility support module. Still, the first is pretty sure-fire... You can disable the mount of the efivarfs with some kind of paranoid option. – mikeserv Aug 4 '14 at 18:38
  • @mikeserv /boot/efi is a mountpoint that i'm not sure needs to be mounted even if relevant to the firmware. so yeah, the mere presence of a placeholder folder there means little to nothing, and even if it has contents, those may not currently be used. – underscore_d Nov 11 '15 at 19:00
  • This solution (90 upvotes) talks about /sys/firmware/efi as a reliable indicator... askubuntu.com/a/162896/479118 – so perhaps, that is more reliable? – Frank Nocke Mar 2 at 20:05

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.