Some operations, such as updating firmware, can’t always be executed inside the operating system. This is because complete and unrestricted access to the hardware is needed, and any modern OS doesn’t allow that. Thankfully, there exists an alternative environment that can be used to perform said tasks; This environment being the EFI shell.
What is the EFI shell?
The UEFI specification defines a basic shell environment, that can be used to:
- Obtain information about the machine
- Partition disks
- Run other EFI applications
- Run bootloaders (such as GRUB)
Some motherboards have a built-in shell that can be selected as a boot option, older boards may require you to prepare a bootable external device containing the actual shell executable.
Boot into a EFI shell from an external device
Firstly, you’ll need a USB flash drive and a internet connection. Then follow these steps:
- Format the drive using the FAT32 filesystem
- Create the following directory tree:
- /EFI/BOOT
- Obtain an EFI shell executable. For this guide I’ll use the one provided by the TianoCore EDK II project:
- Download the file matching your PC architecture and place it inside the EFI directory of your flash drive
- Rename the file:
- If you downloaded the 64-bit executable: BOOTX64.EFI
- If you downloaded the 32-bit executable: BOOTIA32.EFI
If everything went well, you should be able to select your USB drive as a boot option which will immediately bring you to a shell prompt. Since the TianoCore binaries aren’t signed, you’ll need to temporarely disable Secure Boot.
If you are unable to boot into a shell it is possibile that your firmware is implementing an older version of the UEFI specification. In such case you’ll need to use an older version of the TianoCore executable (link).