Is your Linux system in BIOS or UEFI mode? Don’t worry, this guide will show you quick ways to check if Linux system is using BIOS or UEFI. BIOS (Basic Input/Output System) or UEFI (Unified Extensible Firmware Interface) are two different firmware interfaces that are used to boot up a computer. BIOS is the older interface, while UEFI is the newer interface. Most modern computers use UEFI, but some older computers may still be using BIOS.
Table of Contents
Checking If Linux System is Using BIOS or UEFI
So, how can you know if Linux system is using BIOS or UEFI?
Check the /sys/firmware/efi
directory
From the Linux terminal, run the command below to check if the /sys/firmware/efi
is present on your system.
ls -d /sys/firmware/efi
This directory is usually only present in the systems using UEFI. Therefore, if it exists, it means your system is using UEFI. Otherwise, it’s likely using BIOS.
See sample output from two different systems;
System using BIOS;
ls -d /sys/firmware/efi
ls: cannot access '/sys/firmware/efi': No such file or directory
On UEFI systems;
ls -d /sys/firmware/efi
/sys/firmware/efi
You can also simplify your command as follows;
[ -d /sys/firmware/efi ] && echo "UEFI" || echo "BIOS"
Check the Linux Partitioning Scheme
There are two main types of partitioning schemes:
- Master Boot Record (MBR): MBR is the older partitioning scheme and is supported by all BIOS-based computers.
- GUID Partition Table (GPT): GPT is the newer partitioning scheme and is supported by all UEFI-based computers. It is however possible that BIOS based systems use GPT.
Thus, you can simply use commands such as parted or gdisk or fdisk to find out if the system is using BIOS or UEFI.
Using parted command
You can use parted command to determine if the Linux system is using using BIOS or UEFI.
sudo parted /dev/<device> p
Where <device>
can be vd{a,b,c...}
, or sd{a,b,c...}
e.t.c.
For example;
sudo parted /dev/vda p
Sample output for BIOS based system, see Flags section (bios_grub);
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 118GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB bios_grub
2 2097kB 1881MB 1879MB ext4
3 1881MB 118GB 116GB
Sample output for UEFI based system;
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 1128MB 1127MB fat32 boot, esp
2 1128MB 3276MB 2147MB ext4
3 3276MB 107GB 104GB
Using gdisk command
You can use gdisk command to determine if Linux system is using BIOS or UEFI as follows;
sudo gdisk -l /dev/<device>
Where <device>
can be vd{a,b,c...}
, or sd{a,b,c...}
e.t.c.
For example;
sudo gdisk -l /dev/vda
Check the Code field for the values, EF00 and EF02.
- If you see the code
EF00
, it indicates that the partition has the “EFI System Partition” (ESP) attribute set. This is a strong indicator that the partition is used for UEFI booting. - If you see the code
EF02
, it represents a BIOS boot partition
Sample output for EFI system;
GPT fdisk (gdisk) version 1.0.8
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/vda: 209715200 sectors, 100.0 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): AF42249F-263F-40FD-93B3-301C8727B9ED
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 209715166
Partitions will be aligned on 2048-sector boundaries
Total free space is 4029 sectors (2.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 2203647 1.0 GiB EF00
2 2203648 6397951 2.0 GiB 8300
3 6397952 209713151 96.9 GiB 8300
Sample output for BIOS system;
GPT fdisk (gdisk) version 1.0.8
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/vda: 230686720 sectors, 110.0 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 28658D22-F7C9-45F7-A38A-1A0D7EE63AA2
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 230686686
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 2048 4095 1024.0 KiB EF02
2 4096 3674111 1.8 GiB 8300
3 3674112 230686686 108.2 GiB 8300
Using fdisk command
Similarly, you can find out about BIOS or UEFI using fdisk command.
You can use gdisk command to find out if Linux system is using BIOS or UEFI as follows;
sudo fdisk -l /dev/<device>
Where <device>
can be vd{a,b,c...}
, or sd{a,b,c...}
e.t.c.
For example;
sudo fdisk -l /dev/vda
Check the Type column.
BIOS based systems output (Type: BIOS boot);
Disk /dev/vda: 110 GiB, 118111600640 bytes, 230686720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 28658D22-F7C9-45F7-A38A-1A0D7EE63AA2
Device Start End Sectors Size Type
/dev/vda1 2048 4095 2048 1M BIOS boot
/dev/vda2 4096 3674111 3670016 1.8G Linux filesystem
/dev/vda3 3674112 230686686 227012575 108.2G Linux filesystem
UEFI based systems output (Type: EFI system);
Disk /dev/vda: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: AF42249F-263F-40FD-93B3-301C8727B9ED
Device Start End Sectors Size Type
/dev/vda1 2048 2203647 2201600 1G EFI System
/dev/vda2 2203648 6397951 4194304 2G Linux filesystem
/dev/vda3 6397952 209713151 203315200 96.9G Linux filesystem
Check from System DMI/SMBIOS table using dmidecode
You can check if the Linux system is using BIOS or UEFI from the desktop management interface using dmidecode command.
sudo dmidecode -t 0
Sample output from BIOS;
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 2.8 present.
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
Vendor: SeaBIOS
Version: 1.16.2-debian-1.16.2-1
Release Date: 04/01/2014
Address: 0xE8000
Runtime Size: 96 kB
ROM Size: 64 kB
Characteristics:
BIOS characteristics not supported
Targeted content distribution is supported
BIOS Revision: 0.0
Sample output from EFI system;
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 2.8 present.
Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
Vendor: EFI Development Kit II / OVMF
Version: 0.0.0
Release Date: 02/06/2015
Address: 0xE8000
Runtime Size: 96 kB
ROM Size: 64 kB
Characteristics:
BIOS characteristics not supported
Targeted content distribution is supported
UEFI is supported
System is a virtual machine
BIOS Revision: 0.0
Check from kernel startup log using dmesg command
You can also check from the kernel startup logs;
sudo dmesg | grep "EFI v"
If there is a hit, then the system is UEFI based. If no hit, then it is most likely BIOS.
Sample output;
[ 0.000000] efi: EFI v2.70 by EDK II
Check from the Boot Menu
You can also check from the system boot menu. Restart your computer and access the boot menu during the boot process to confirm whether it is using UEFI or BIOS.
And that is it! You have how to check if Linux system is using BIOS or UEFI.