Check if Linux is using UEFI or Legacy BIOS

Check if Linux is using UEFI or Legacy BIOS

When working with Linux systems, it's essential to know whether the system is using the UEFI (Unified Extensible Firmware Interface) or the Legacy BIOS (Basic Input/Output System). Knowing the firmware mode is crucial in scenarios involving hardware compatibility troubleshooting, system upgrade planning, or specific software installations. This knowledge is useful as it determines how the system initializes and communicates with hardware elements, affecting functions like Secure Boot and disk partitioning, among others. This tutorial explains how to check if Linux is using UEFI or Legacy BIOS.

The most straightforward method to determine whether the system is utilizing UEFI or a legacy BIOS is to check for the existence of the /sys/firmware/efi directory. If this directory is present, it signifies the system is using UEFI; conversely, if the directory is missing, it indicates that the system is running on legacy BIOS.

[ -d /sys/firmware/efi ] && echo UEFI || echo BIOS

The command checks if a directory exist and provide with one of two outputs: UEFI or BIOS.

Leave a Comment

Cancel reply

Your email address will not be published.