- EFI System Partition
- Kernel
- Characteristics
- Size considerations
- Mount point
- Standard layout
- UEFI boot items
- See also
- References
- /boot/efi Linux partition: What is, usage recommendations
- /boot/efi Linux partition: What is, usage recommendations
- View partition details
- Usage Recommendations
- Closing Thoughts
- Related Linux Tutorials:
EFI System Partition
The EFI system partition (ESP) is a FAT formatted partition containing the primary EFI boot loader(s) or kernel image(s) for installed operating systems.
Kernel
Advanced partition selection ( CONFIG_PARTITION_ADVANCED ) and EFI GUID Partition support ( CONFIG_EFI_PARTITION ) must be enabled:
-*- Enable the block layer ---> Partition Types ---> [*] Advanced partition selection [*] EFI GUID Partition support
ISO8859-1 codepage must be enabled too, in order to mount the FAT EFI partition:
-*- File Systems ---> DOS/FAT/EXFAT/NT Filesystems ---> VFAT (Windows-95) fs support (437) Default codepage for FAT (iso8859-1) Default iocharset for FAT Native Language support ---> [*] NLS ISO 8859-1 (Latin 1; Western European Languages)
Characteristics
For creation instructions see Handbook.
parted (sys-block/parted) will show it with the boot, esp flags:
Model: ATA SAMSUNG SSD SM84 (scsi) Disk /dev/sda: 256GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 99.6MB 98.6MB fat32 EFI System Partition boot, esp
gdisk (sys-apps/gptfdisk) will show it with partition code EF00:
GPT fdisk (gdisk) version 1.0.1 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Disk /dev/sda: 500118192 sectors, 238.5 GiB Logical sector size: 512 bytes Disk identifier (GUID): 1B59C2C8-8795-4625-9718-4D636B005AC1 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 500118158 Partitions will be aligned on 2048-sector boundaries Total free space is 2669 sectors (1.3 MiB) Number Start (sector) End (sector) Size Code Name 1 2048 194559 94.0 MiB EF00 EFI System Partition
Size considerations
100 MiB should be enough for some primary bootloader payloads such as EFI stub kernels or boot loaders such as GRUB 2 or Windows. This forums post however suggests giving it more space if a distribution kernel is used.
Mount point
An entry in /etc/fstab is not needed for booting but might be useful for manually mounting the ESP.
/dev/sda1 /boot vfat noauto,noatime 0 2
Standard layout
There is a standard layout for the ESP. Vendors and distributions are supposed to put their stuff into vendor specific directories.
/boot └── EFI ├── Boot │ └── bootx64.efi ├── Gentoo │ └── bzImage-4.9.76-r1.efi └── Microsoft ├── Boot └── RecoveryHere the Microsoft subtree - and also the Boot subtree [1] - was created by an earlier installation of Windows 10 Creators Update. The Boot subtree is the fallback directory. If UEFI can't find any vendor specific directories it will boot from here. In a multiboot environment with properly set up vendor specific subtrees the Boot subtree can be deleted.
UEFI boot items
Computers with UEFI usually provide a boot menu and a configuration tool for creating, sorting or deleting boot items. The content of the ESP is visible to these tools and creating a boot item is like choosing the medium from a given selection, then surfing through the ESP and selecting the item, e.g bzImage-4.9.76-r1-gentoo.efi .
Alternatively, efibootmgr can be used for generating the UEFI boot items.
See also
- Handbook:AMD64/Installation/Disks#What is the EFI System Partition (ESP)?
- UEFI — a firmware standard for boot ROM designed to provide a stable API for interacting with system hardware. On x86 it replaced the legacy BIOS.
- FAT — filesystem originally created for use with MS-DOS (and later pre-NT Microsoft Windows).
- EFI stub — provides instructions on configuring and installing kernels in the EFI System Partition (ESP) of a computer running in EFI mode
- efibootmgr — a tool for managing UEFI boot entries.
- EFI Shell The UEFI Shell is a shell/terminal for the firmware which allows launching uefi applications which include uefi bootloaders.
- REFInd — a boot manager for EFI and UEFI platforms forked from and successor to rEFIt.
References
/boot/efi Linux partition: What is, usage recommendations
The /boot/efi partition is present on most Linux systems and is where the boot loaders (and sometimes kernel images and drivers) are stored for all of the installed operating systems on the disk. The system’s UEFI firmware will load these files upon system boot.
All systems with UEFI (as opposed to legacy BIOS) must have an EFI system partition in order to boot, however some Linux distros will choose to mount the files at some location other than /boot/efi , despite it being the most popular. In this tutorial, we will learn about the /boot/efi partition, what it is used for, and what kind of recommendations that administrators should keep in mind when partitioning their disks and creating an EFI partition.
In this tutorial you will learn:
- What is the /boot/efi partition used for?
- How to view the details of the /boot/efi partition
- What size should an admin make the EFI partition?
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Any Linux distro |
Software | fdisk, parted, gdisk, GNOME Disks |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions | # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command $ – requires given linux commands to be executed as a regular non-privileged user |
/boot/efi Linux partition: What is, usage recommendations
The purpose of the EFI partition is to house the EFI boot loader(s). Upon booting the system, UEFI will read information from the EFI partition before letting boot loader (typically GRUB or elilo on Linux) take over and boot into the operating system or other system utilities such as system repair. The whole process happens very quickly.
Disks formatted with both GPT and MBR partition schemes can contain an EFI partition, since UEFI can read from either type. On GPT, every partition type has a globally unique identifier. For the EFI partition, the GUID is C12A7328-F81F-11D2-BA4B-00A0C93EC93B . On MBR formatted disks, the EFI partition is represented by 0xEF .
View partition details
We can see the details of this partition with various Linux tools. If you do not find the same results on your system, it could mean that the partition is mounted elsewhere, is not mounted at all, or does not exist because it is part of a virtualized environment.
With gdisk :
With parted :
Usage Recommendations
- Unlike other typical Linux partitions, the EFI partition should be formatted with FAT.
- Size recommendation is 100 MB, but 500 MB is a good way to guarantee you will not run out of space.
- Do not use this partition to store anything except boot loader info.
- When dual booting, leave the EFI partition alone, as it contains info to boot operating systems.
- EFI partition needs to be a physical partition, not created under LVM or RAID.
Closing Thoughts
In this tutorial, we learned about the /boot/efi partition on a Linux system and found out what it is used for. We saw that the EFI partition is used to store boot loader files for UEFI firmware to access upon system boot. This is the first step in a long check list of what happens when booting into an operating system in your computer.
Related Linux Tutorials:
Comments and Discussions