When you are preparing to install a dual-boot operating system, configuring a low-level bootloader like GRUB, or troubleshooting severe hardware initialization errors, you must know exactly how your Linux system booted. Modern computers use the UEFI (Unified Extensible Firmware Interface) standard, but older machines (or virtual machines configured incorrectly) still rely on the archaic Legacy BIOS standard.
You do not need to restart your computer and frantically mash the F12 key to figure this out. You can ask the Linux kernel directly from the terminal.
How to Check the Firmware Directory
The fastest and most universally reliable method across all Linux distributions (Ubuntu, Fedora, Arch, etc.) is to check if the kernel successfully populated the /sys/firmware/efi directory during the boot process.
If the system booted via UEFI, the motherboard explicitly passes EFI data to the kernel, and this folder will exist. If the system booted via Legacy BIOS, the motherboard remains silent, and the kernel never creates this folder.
- Open your Linux terminal.
- Execute the following command to check if the directory exists:
ls -l /sys/firmware/efi
Interpreting the Output
If you are using UEFI:
The terminal will instantly print a list of files and subdirectories, such as efivars, fw_platform_size, and systab. This definitive output proves your system booted using the modern UEFI standard.
If you are using Legacy BIOS:
The terminal will output a stark error message: ls: cannot access '/sys/firmware/efi': No such file or directory.
This confirms that your system fell back to the older Legacy BIOS boot method.
Note: If you are running Linux inside a virtual machine (like VirtualBox or VMware) and you receive the “No such file” error, it means you forgot to check the “Enable EFI” box in the VM’s hardware settings before installing the operating system.