How to know if I'm booting using UEFI?
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.
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.