How do I check if my EC2 instance running Linux booted using UEFI or legacy BIOS?
I want to check if my Amazon Elastic Compute Cloud (Amazon EC2) Linux instance booted from UEFI or legacy BIOS.
Unified Extensible Firmware Interface (UEFI) is a firmware specification. It's a newer replacement for the legacy BIOS firmware. The UEFI firmware runs special EFI binary files that have the .efi extension to load the boot loader or operating system. EC2 instances traditionally boot with the legacy BIOS mode. However, ARM-based EC2 instances (a1, c6g, m6g, and r6g) boot with the newer UEFI firmware.
To verify the existence of the /sys/firmware/efi directory, run the following command. This directory exists only if the instance boots using UEFI. If this directory doesn't exist, then the command returns Legacy BIOS Boot Detected: