EFI System Partition

Resources

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[edit | edit source]

Advanced partition selection (CONFIG_PARTITION_ADVANCED) and EFI GUID Partition support (CONFIG_EFI_PARTITION) must be enabled:

KERNEL Enable support for GPT
-*- 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 EFI partition:

KERNEL Enable ISO8859-1 codepage
-*- File Systems --->
   Native Language support --->
      [*] NLS ISO 8859-1  (Latin 1; Western European Languages)

Characteristics[edit | edit source]

For creation instructions see Handbook

parted (sys-block/parted) will show it with the boot, esp flags:

root #parted /dev/sda print
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:

root #gdisk -l /dev/sda
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

Its filesystem can be created using the mkfs.fat command:

root #mkfs.fat -F 32 /dev/sda1

Size considerations[edit | edit source]

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[edit | edit source]

An entry in /etc/fstab is not needed for booting but might be useful for manually mounting the ESP.

FILE /etc/fstabConfiguring the ESP mountpoint
/dev/sda1              /boot             vfat              noauto,noatime             0    2

Standard layout[edit | edit source]

There is a standard layout for the ESP. Vendors and distributions are supposed to put their stuff into vendor specific directories.

user $tree -L 3 /boot
 /boot
 └── EFI
     ├── Boot
     │   └── bootx64.efi
     ├── Gentoo
     │   └── bzImage-4.9.76-r1.efi
     └── Microsoft
         ├── Boot
         └── Recovery

Here 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[edit | edit source]

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[edit | edit source]

  • Handbook:AMD64/Installation/Disks#What is the EFI System Partition (ESP)?
  • EFI stub kernel — Linux kernel, able to boot without a boot manager
  • 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.
  • Discussion page in Gentoo Handbook — how to use grub2 with ESP
  • Property:Efi-system-partition — Gentoo handbook property using /dev/sda1
  • Talk:GRUB2_Quick_Start#UEFI.2FGPT

External resources[edit | edit source]

References[edit | edit source]

    This article is issued from Gentoo. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.