EFI System partition

From Wikipedia, the free encyclopedia
Jump to: navigation, search

The EFI System partition (ESP) is a partition on a data storage device that is used by computers adhering to the Unified Extensible Firmware Interface (UEFI).

It contains the boot loader programs for all operating systems installed (in other partitions) on the device, device driver files for devices present in a computer that are used by the firmware at boot time, system utility programs that are intended to be run before an operating system is booted, and data files such as error logs.[1]

Overview[edit]

The EFI System partition needs to be formatted with a FAT12, FAT16 or FAT32 file system. The globally unique identifier (GUID) for the EFI System partition in the GUID Partition Table (GPT) scheme is C12A7328-F81F-11D2-BA4B-00A0C93EC93B, while its ID in the MBR partition table scheme is 0xEF. Both GPT and MBR-partitioned disks can contain an EFI System partition, as UEFI firmwares are required to support both partitioning schemes. Also, El Torito bootable format for CD-ROMs and DVDs is supported.[1]

UEFI provides backward compatibility with legacy systems by reserving the first block (sector) of the partition for compatibility code, effectively creating a legacy boot sector. On legacy BIOS-based systems, the first sector of a partition is loaded into memory and execution is transferred to this code. UEFI firmwares do not execute the code in the Master Boot Record (MBR), except when booting in legacy BIOS mode through the Compatibility Support Module (CSM).[1]

Despite the fact that the UEFI specification requires MBR partition tables to be fully supported,[1] some UEFI firmwares immediately switch to the BIOS-based CSM booting upon detecting certain types of partition table on the boot disk, effectively preventing UEFI booting to be performed from EFI System partitions contained on MBR-partitioned disks.[2]

UEFI firmwares support booting from removable storage devices such as USB flash drives. For that purpose, a removable device needs to be formated with a FAT12, FAT16 or FAT32 file system, while a boot loader needs to be stored according to the standard ESP file hierarchy, or by providing a complete path of a boot loader to the system's boot manager.[1]

Usage[edit]

Linux[edit]

GRUB 2 and elilo serve as conventional, full-fledged standalone UEFI boot managers for Linux. Once loaded by a UEFI firmware, they both can access and boot kernel images from all devices, partitions and file systems they support, without being limited to the EFI System partition.

EFI Boot Stub makes it possible to boot a Linux kernel image without the use of a conventional UEFI boot loader. By masquerading itself as a PE/COFF image and appearing to the firmware as a UEFI application, an x86 kernel image with EFI Boot Stub enabled can be directly loaded and executed by a UEFI firmware. Such kernel images can still be loaded and run by BIOS-based boot loaders; thus, EFI Boot Stub allows a single kernel image to work in any boot environment.[3]

Linux kernel's support for the EFI Boot Stub is enabled by turning on option CONFIG_EFI_STUB (EFI stub support) during the kernel configuration.[4] It was merged into version 3.3 of the Linux kernel mainline, released on March 18, 2012.[5]

Gummiboot is a simple UEFI boot manager that loads and runs configured UEFI images, accessing only the EFI System partition. Configuration file fragments, kernel images and initrd images are required to reside on the EFI System partition, as Gummiboot does not provide support for accessing files on other partitions or file systems. Linux kernels need to be built with CONFIG_EFI_STUB enabled so they can be directly executed as UEFI images.[6]

Mount point for the EFI System partition is usually /boot/efi, where its content is accessible after Linux is booted.[7]

Windows[edit]

Microsoft recommends that when partitioning a disk, the EFI System partition be the first partition on the disk.[8] This is not a requirement of the EFI specification itself. On Windows XP 64-Bit Edition and later, access to the EFI System partition is obtained by running the mountvol /s command.

Apple–Intel[edit]

On Apple–Intel architecture Macintosh computers, the EFI partition is initially blank and not used for booting.[9] However, the EFI partition is used as a staging area for firmware updates;[10] specifically, it places a firmware flash utility (EFI binary) and data file (FD – "Firmware Device"[11]) in the directory EFI/APPLE/FIRMWARE which is then run when rebooting the system in "flash firmware" mode.[12]

The system will still boot after the EFI partition is deleted, in which case the boot manager will allow users to choose whether to start a Boot Camp partition or the default Mac OS X, but firmware updates will fail.

See also[edit]

References[edit]

  1. ^ a b c d e "UEFI Specifications (version 2.4 and older)" (PDF). Unified EFI, Inc. June 2013. Retrieved 2013-09-25. 
  2. ^ "UEFI system booting from MBR partition table and GRUB legacy". archlinux.org. June 2012. Retrieved 2013-10-06. 
  3. ^ "EFI Boot Stub (Linux kernel documentation)". kernel.org. Retrieved 2013-10-06. 
  4. ^ "CONFIG_EFI_STUB (line #1575)". "arch/x86/Kconfig (3.11.1)". kernel.org. Retrieved 2013-10-06. 
  5. ^ "1.10. EFI boot support". "Linux 3.3". kernelnewbies.org. 2012-03-18. Retrieved 2013-10-06. 
  6. ^ "gummiboot: Simple UEFI Boot Manager". freedesktop.org. Retrieved 2013-10-06. 
  7. ^ "UEFI - Community Ubuntu Documentation". ubuntu.com. 2013-12-21. Retrieved 2013-12-27. 
  8. ^ "EFI System Partition". Windows and GPT FAQ. 
  9. ^ rEFIt: Myths and Facts About Intel Macs – Myth: Mac OS X requires a hidden EFI System Partition
  10. ^ "Firmware updates for Intel-based Macs require a GUID partition scheme". Apple Knowledgebase. 
  11. ^ Zero to OS in a Flash: "Firmware device (FD) is a persistent physical repository that contains firmware code and data."
  12. ^ ubuntu forums: iMac EFI Firmware Update 1.2, September 29th, 2007

External links[edit]