EFI system partition: Difference between revisions

From ArchWiki
(Move mount after creation.)
(Add see also from UEFI.)
Line 1: Line 1:
[[Category:Boot process]]
[[Category:Boot process]]
The EFI System Partition (also called ESP or EFISYS) is a FAT32 formatted physical partition (in the main partition table of the disk, not LVM or software raid etc.) from where the UEFI firmware launches the UEFI bootloader and application.  
The [[Wikipedia:EFI System partition|EFI System Partition]] (also called ESP or EFISYS) is a FAT32 formatted physical partition (in the main partition table of the disk, not LVM or software raid etc.) from where the UEFI firmware launches the UEFI bootloader and application.  


It is an OS independent partition that acts as the storage place for the EFI bootloaders and applications to be launched by the EFI firmware. It is mandatory for UEFI boot. For more information see [[Wikipedia:EFI System partition]].
It is an OS independent partition that acts as the storage place for the EFI bootloaders and applications to be launched by the EFI firmware. It is mandatory for UEFI boot.  


It is recommended to use always GPT for UEFI boot as some UEFI firmwares do not allow UEFI-MBR boot.
It is recommended to use always GPT for UEFI boot as some UEFI firmwares do not allow UEFI-MBR boot.
Line 42: Line 42:
It is possible to make the ESP part of a RAID1 array, but doing so brings the risk of data corruption, and further considerations need to be taken when creating the ESP.
It is possible to make the ESP part of a RAID1 array, but doing so brings the risk of data corruption, and further considerations need to be taken when creating the ESP.
See https://bbs.archlinux.org/viewtopic.php?pid=1398710#p1398710 and https://bbs.archlinux.org/viewtopic.php?pid=1390741#p1390741 for details.
See https://bbs.archlinux.org/viewtopic.php?pid=1398710#p1398710 and https://bbs.archlinux.org/viewtopic.php?pid=1390741#p1390741 for details.
== See also ==

Revision as of 06:15, 12 April 2016

The EFI System Partition (also called ESP or EFISYS) is a FAT32 formatted physical partition (in the main partition table of the disk, not LVM or software raid etc.) from where the UEFI firmware launches the UEFI bootloader and application.

It is an OS independent partition that acts as the storage place for the EFI bootloaders and applications to be launched by the EFI firmware. It is mandatory for UEFI boot.

It is recommended to use always GPT for UEFI boot as some UEFI firmwares do not allow UEFI-MBR boot.

Partition Type

It should have the EFI System partition type.

In GNU Parted, boot flag (not to be confused with legacy_boot flag) has different effect in MBR and GPT disk. In MBR disk, it marks the partition as active. In GPT disk, it changes the type code of the partition to EFI System Partition type.

Parted has no flag to mark a partition as ESP in MBR disk (this can be done using fdisk though).

Partition size

It is recommended to keep ESP size at 512 MiB although smaller/larger sizes are fine.

According to a Microsoft note[1], the minimum size for the EFI System Partition (ESP) would be 100 MB, though this is not stated in the UEFI Specification. Note that for Advanced Format 4K Native drives (4-KB-per-sector) drives, the size is at least 260 MB, because it is the minimum partition size of FAT32 drives (calculated as sector size (4KB) x 65527 = 256 MB), due to a limitation of the FAT32 file format.

Creat the partition

GPT partitioned disks

  • fdisk/gdisk: Create a partition with partition type EFI System (EFI System in fdisk or ef00 in gdisk). Then format that partition as FAT32 using mkfs.fat -F32 /dev/<THAT_PARTITION>

(or)

  • GNU Parted: Create a FAT32 partition and in Parted set/activate the boot flag (not legacy_boot flag) on that partition
Note: If you get the message WARNING: Not enough clusters for a 32 bit FAT!, reduce cluster size with mkfs.fat -s2 -F32 ... or -s1, otherwise the partition may be unreadable by UEFI.

MBR partitioned disks

  • fdisk: Create a partition with partition type EFI System using fdisk.
  • Then format that partition as FAT32 using:
mkfs.fat -F32 /dev/<THAT_PARTITION>

Mount the partition

In case of EFISTUB, the kernels and initramfs files should be stored in the EFI System Partition. For sake of simplicity, you can also use the ESP as the /boot partition itself instead of a separate /boot partition, for EFISTUB booting.

ESP on RAID

It is possible to make the ESP part of a RAID1 array, but doing so brings the risk of data corruption, and further considerations need to be taken when creating the ESP. See https://bbs.archlinux.org/viewtopic.php?pid=1398710#p1398710 and https://bbs.archlinux.org/viewtopic.php?pid=1390741#p1390741 for details.

See also