62

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?

4
  • Don't have the time to look up the answer, but I've been doing a lot of UEFI troubleshooting lately, too. This site is pretty helpful with understanding UEFI. rodsbooks.com/refind/index.html
    – 0xSheepdog
    Aug 4, 2014 at 17:05
  • 1
    I don't mean to sound smarmy, but what's the machine's firmware set to do?
    – ericx
    Aug 4, 2014 at 17:06
  • 1
    @ericx this question is under the pretense that you don't have any idea of how to check it out. That's why all solutions can be done on a booted system.
    – Braiam
    Nov 10, 2014 at 9:59
  • 1

2 Answers 2

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.

3
  • 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, 2014 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. Nov 11, 2015 at 19:00
  • 1
    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 N
    Mar 2, 2018 at 20:05
46

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.

3
  • +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. Nov 11, 2015 at 19:00
  • 3
    What means "variables not available"? It's enough checking there is not a folders inside: /sys/firmware/ called "efi"? Jan 13, 2016 at 3:57
  • @Santropedro - it seems that it does. I'll edit the post. Thank you. Jan 13, 2016 at 10:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .