EFI system partition

Last updated
Example of an EFI system partition as shown by KDE Partition Manager EFI system partition on Linux screenshot.png
Example of an EFI system partition as shown by KDE Partition Manager

The EFI (Extensible Firmware Interface) system partition or ESP is a partition on a data storage device (usually a hard disk drive or solid-state drive) that is used by computers that have the Unified Extensible Firmware Interface (UEFI). When a computer is booted, UEFI firmware loads files stored on the ESP to start operating systems and various utilities.

Contents

An ESP contains the boot loaders, boot managers, or kernel images of installed operating systems (which are typically contained in other partitions), device driver files for hardware devices present in a computer and 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

The EFI system partition is formatted with a file system whose specification is based on the FAT file system and maintained as part of the UEFI specification; therefore, the file system specification is independent from the original FAT specification. The actual extent of divergence is unknown: [2] Apple maintains a separate tool that should be used on Intel/x86-64 Macs, [3] while other systems use FAT utilities just fine. [4] 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 master boot record (MBR) partition-table scheme is 0xEF . Both GPT- and MBR-partitioned disks can contain an EFI system partition, as UEFI firmware is 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 firmware does not execute the code in the MBR, except when booting in legacy BIOS mode through the Compatibility Support Module (CSM). [1]

The UEFI specification requires MBR partition tables to be fully supported. [1] However, some UEFI implementations immediately switch to the BIOS-based CSM booting upon detecting certain types of partition table on the boot disk, effectively preventing UEFI booting from being performed from EFI system partitions contained on MBR-partitioned disks. [5]

UEFI firmware supports booting from removable storage devices such as USB flash drives. For that purpose, a removable device is formatted 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. On the other hand, FAT32 is always expected on fixed drives. [1]

Usage

Linux

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

The mount point for the EFI system partition varies depending on the bootloader used. Older bootloaders such as GRUB 2 and lilo/elilo default to /boot/efi. Alternatively, systemd-boot prefers either /efi or /boot over /boot/efi due to potential complications with nested autofs mounts. Regardless of the mount point path, its contents are accessible after Linux is booted. [6] [7]

Linux Kernel EFI Boot Stub

EFI Boot Stub makes it possible to boot a Linux kernel image without the use of a conventional UEFI boot loader. By masquerading as a PE/COFF executable image and appearing to the firmware as a UEFI application, a Linux 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. [8]

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. [9] It was merged into version 3.3 of the Linux kernel mainline, released on March 18, 2012. [10]

Systemd-boot is a simple UEFI boot manager that loads and runs configured EFI 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 systemd-boot does not provide support for accessing files on other partitions or file systems. Linux kernels need to be built with CONFIG_EFI_STUB=y so they can be directly executed as UEFI images. [11]

Apple

macOS on Intel (x86 and x86-64)

On Apple Mac computers using Intel x86-64 processor architecture, the EFI system partition is initially left blank and unused for booting into macOS. [12] [13]

However, the EFI system partition is used as a staging area for firmware updates [14] and for the Microsoft Windows bootloader for Mac computers configured to boot into a Windows partition using Boot Camp. [13] [15]

Custom Apple UEFI firmware named iBoot controls the logic for finding and loading bootloaders. iBoot will select the desired bootloader (potentially configured via Startup Keyboard Combinations or NVRAM), optionally falling back to either the internal macOS Installation, or a recovery system called recoveryOS. [13] [15] [16]

Older pre-UEFI Apple–Intel architecture machines required the EFI system partition to be formatted in HFS+. Third-party bootloaders needed to be "blessed" by a special ioctl command before becoming bootable by the firmware, a relic of the System Folder blessing from Classic Mac OS. There are otherwise no limitations to what kinds of EFI operating system or bootloader an Intel-based Apple computer can run. [17] [18]

iOS, iPadOS, macOS on Apple silicon (AArch64)

Devices using Apple silicon (AArch64) such as iPhones, iPads and all Mac computers from 2023 onward do not contain EFI/UEFI functionality and subsequently do not use EFI system partitions. [19] [20]

Windows

On Windows XP 64-Bit Edition and later, access to the EFI system partition is obtained by running the mountvol command.

The Windows boot manager is located at the \EFI\MICROSOFT\BOOT\ subfolder of the EFI system partition.

See also

Related Research Articles

<span class="mw-page-title-main">Booting</span> Process of starting a computer

In computing, booting is the process of starting a computer as initiated via hardware such as a button or by a software command. After it is switched on, a computer's central processing unit (CPU) has no software in its main memory, so some process must load software into memory before it can be executed. This may be done by hardware or firmware in the CPU, or by a separate processor in the computer system.

<span class="mw-page-title-main">Disk partitioning</span> Creation of separate accessible storage areas on a secondary computer storage device

Disk partitioning or disk slicing is the creation of one or more regions on secondary storage, so that each region can be managed separately. These regions are called partitions. It is typically the first step of preparing a newly installed disk, before any file system is created. The disk stores the information about the partitions' locations and sizes in an area known as the partition table that the operating system reads before any other part of the disk. Each partition then appears to the operating system as a distinct "logical" disk that uses part of the actual disk. System administrators use a program called a partition editor to create, resize, delete, and manipulate the partitions. Partitioning allows the use of different filesystems to be installed for different kinds of files. Separating user data from system data can prevent the system partition from becoming full and rendering the system unusable. Partitioning can also make backing up easier. A disadvantage is that it can be difficult to properly size partitions, resulting in having one partition with too much free space and another nearly totally allocated.

<span class="mw-page-title-main">Boot sector</span> Sector of a persistent data storage device

A boot sector is the sector of a persistent data storage device which contains machine code to be loaded into random-access memory (RAM) and then executed by a computer system's built-in firmware.

<span class="mw-page-title-main">GNU GRUB</span> Boot loader package

GNU GRUB is a boot loader package from the GNU Project. GRUB is the reference implementation of the Free Software Foundation's Multiboot Specification, which provides a user the choice to boot one of multiple operating systems installed on a computer or select a specific kernel configuration available on a particular operating system's partitions.

<span class="mw-page-title-main">Preboot Execution Environment</span> Standard for booting from a server

In computing, the Preboot eXecution Environment, PXE specification describes a standardized client–server environment that boots a software assembly, retrieved from a network, on PXE-enabled clients. On the client side it requires only a PXE-capable network interface controller (NIC), and uses a small set of industry-standard network protocols such as DHCP and TFTP.

<span class="mw-page-title-main">Multi-booting</span> Act of installing multiple operating systems on a single computer

Multi-booting is the act of installing multiple operating systems on a single computer, and being able to choose which one to boot. The term dual-booting refers to the common configuration of specifically two operating systems. Multi-booting may require a custom boot loader.

<span class="mw-page-title-main">UEFI</span> Operating system and firmware specification

Unified Extensible Firmware Interface is a specification that defines the architecture of the platform firmware used for booting the computer hardware and its interface for interaction with the operating system. Examples of firmware that implement the specification are AMI Aptio, Phoenix SecureCore, TianoCore EDK II, InsydeH2O. UEFI replaces the BIOS which was present in the boot ROM of all personal computers that are IBM PC compatible, although it can provide backwards compatibility with the BIOS using CSM booting. Intel developed the original Extensible Firmware Interface (EFI) specification. Some of the EFI's practices and data formats mirror those of Microsoft Windows. In 2005, UEFI deprecated EFI 1.10.

<span class="mw-page-title-main">Hackintosh</span> Non-Apple computer running macOS

A Hackintosh is a computer that runs Apple's Macintosh operating system macOS on computer hardware that is not authorized for the purpose by Apple. This can also include running Macintosh software on hardware it is not originally authorized for. Benefits of "Hackintoshing" can include cost, ease of repair and piecemeal upgrade, and freedom to use customized choices of components that are not available in the branded Apple products. macOS can also be run on several non-Apple virtualization platforms, although such systems are not usually described as Hackintoshes. Hackintosh laptops are sometimes referred to as "Hackbooks".

<span class="mw-page-title-main">GUID Partition Table</span> Computer disk partitioning standard

The GUID Partition Table (GPT) is a standard for the layout of partition tables of a physical computer storage device, such as a hard disk drive or solid-state drive, using universally unique identifiers, which are also known as globally unique identifiers (GUIDs). Forming a part of the Unified Extensible Firmware Interface (UEFI) standard, it is nevertheless also used for some BIOSs, because of the limitations of master boot record (MBR) partition tables, which use 32 bits for logical block addressing (LBA) of traditional 512-byte disk sectors.

<span class="mw-page-title-main">Apple–Intel architecture</span> Unofficial name used for Macintosh models that use Intel x86 processors

The Apple–Intel architecture, or Mactel, is an unofficial name used for Macintosh personal computers developed and manufactured by Apple Inc. that use Intel x86 processors, rather than the PowerPC and Motorola 68000 ("68k") series processors used in their predecessors or the ARM-based Apple silicon SoCs used in their successors. As Apple changed the architecture of its products, they changed the firmware from the Open Firmware used on PowerPC-based Macs to the Intel-designed Extensible Firmware Interface (EFI). With the change in processor architecture to x86, Macs gained the ability to boot into x86-native operating systems, while Intel VT-x brought near-native virtualization with macOS as the host OS.

<span class="mw-page-title-main">Das U-Boot</span> Open-source, primary boot the devices operating system kernel

Das U-Boot is an open-source boot loader used in embedded devices to perform various low-level hardware initialization tasks and boot the device's operating system kernel. It is available for a number of computer architectures, including 68k, ARM, Blackfin, MicroBlaze, IBM S360, My66, Motorola 68000, MOS 6502, ARM64 MIPS, Nios, SuperH, PPC, RISC-V and x86.

<span class="mw-page-title-main">Live USB</span> USB drive with a full bootable operating system

A live USB is a portable USB-attached external data storage device containing a full operating system that can be booted from. The term is reminiscent of USB flash drives but may encompass an external hard disk drive or solid-state drive, though they may be referred to as "live HDD" and "live SSD" respectively. They are the evolutionary next step after live CDs, but with the added benefit of writable storage, allowing customizations to the booted operating system. Live USBs can be used in embedded systems for system administration, data recovery, or test driving, and can persistently save settings and install software packages on the USB device.

<span class="mw-page-title-main">Windows Boot Manager</span> Boot process used in modern Windows NT-based products

The Windows Boot Manager (BOOTMGR) is the bootloader provided by Microsoft for Windows NT versions starting with Windows Vista. It is the first program launched by the BIOS or UEFI of the computer and is responsible for loading the rest of Windows. It replaced the NTLDR present in older versions of Windows.

The Linux booting process involves multiple stages and is in many ways similar to the BSD and other Unix-style boot processes, from which it derives. Although the Linux booting process depend very much on the computer architecture, those architectures share similar stages and software components, including system startup, bootloader execution, loading and startup of a Linux kernel image, and execution of various startup scripts and daemons. Those are grouped into 4 steps: system startup, bootloader stage, kernel stage, and init process. When a Linux system is powered up or reset, its processor will execute a specific firmware/program for system initialization, such as Power-on self-test, invoking the reset vector to start a program at a known address in flash/ROM, then load the bootloader into RAM for later execution. In personal computer (PC), not only limited to Linux-distro PC, this firmware/program is called BIOS, which is stored in the mainboard. In embedded Linux system, this firmware/program is called boot ROM. After being loaded into RAM, bootloader will execute to load the second-stage bootloader. The second-stage bootloader will load the kernel image into memory, decompress and initialize it then pass control to this kernel image. Second-stage bootloader also performs several operation on the system such as system hardware check, mounting the root device, loading the necessary kernel modules,... Finally, the very first user-space process starts, and other high-level system initializations are performed.

The BIOS boot partition is a partition on a data storage device that GNU GRUB uses on legacy BIOS-based personal computers in order to boot an operating system, when the actual boot device contains a GUID Partition Table (GPT). Such a layout is sometimes referred to as BIOS/GPT boot.

<span class="mw-page-title-main">BootX (Apple)</span> Boot loader developed by Apple Inc.

BootX is a software-based bootloader designed and developed by Apple Inc. for use on the company's Macintosh computer range. BootX is used to prepare the computer for use, by loading all required device drivers and then starting-up Mac OS X by booting the kernel on all PowerPC Macintoshes running the Mac OS X 10.2 operating system or later versions.

In Linux, and other Unix-like operating systems, the /boot/ directory holds files used in booting the operating system. The usage is standardized in the Filesystem Hierarchy Standard.

rEFInd Boot manager for UEFI systems

rEFInd is a boot manager for UEFI and EFI-based machines. It can be used to boot multiple operating systems that are installed on a single non-volatile device. It also provides a way to launch UEFI applications.

iBoot is the stage 2 bootloader for all Apple products. It replaces the old bootloader, BootX. Compared with its predecessor, iBoot improves authentication performed in the boot chain.

The booting process of Android devices starts at the power-on of the SoC and ends at the visibility of the home screen, or special modes like recovery and fastboot. The boot process of devices that run Android is influenced by the firmware design of the SoC manufacturers.

References

  1. 1 2 3 4 5 "Unified Extensible Firmware Interface (UEFI) Specification (versions 2.10 and older)" (PDF). UEFI.org. August 2022. Retrieved 2022-12-12.
  2. "UEFI Specification Version 2.5, Section 12.3 File System Format" (PDF). UEFI.org. April 2015. pp. 536, 537. Retrieved 2015-05-29. The file system supported by the Extensible Firmware Interface is based on the FAT file system. EFI defines a specific version of FAT that is explicitly documented and testable. Conformance to the EFI specification and its associate reference documents is the only definition of FAT that needs to be implemented to support EFI. To differentiate the EFI file system from pure FAT, a new partition file system type has been defined.
  3. "Technical Note TN2166: Secrets of the GPT". Developer.Apple.com. 2006-11-06. Retrieved 2015-05-06.
  4. "EFI system partition". ArchWiki. Retrieved 14 March 2020.
  5. "UEFI system booting from MBR partition table and GRUB legacy". ArchLinux.org. June 2012. Retrieved 2013-10-06.
  6. "UEFI - Community Ubuntu Documentation". Ubuntu.com. 2013-12-21. Retrieved 2013-12-27.
  7. "Boot Loader Specification". uapi-group.org. Retrieved 2024-02-15.
  8. "The EFI Boot Stub - The Linux Kernel Documentation". The Linux Kernel documentation. 2014-06-16. Archived from the original on 2023-10-04. Retrieved 2024-02-14.
  9. "Linux kernel 3.11.1 arch/x86/Kconfig: CONFIG_EFI_STUB (line #1575)". Kernel.org. Retrieved 2013-10-06.
  10. "Linux kernel 3.3: 1.10. EFI boot support". KernelNewbies.org. 2012-03-18. Retrieved 2013-10-06.
  11. "systemd-boot UEFI Boot Manager". Freedesktop.org . 2021-05-07. Archived from the original on 2024-02-14. Retrieved 2024-02-14.
  12. "rEFIt: Myths and Facts About Intel Macs – Myth: Mac OS X Requires a Hidden EFI System Partition". rEFIt.SourceForge.net.
  13. 1 2 3 "Boot process for an Intel-based Mac". Apple Support. Retrieved 2024-02-14.
  14. "Firmware updates for Intel-based Macs require a GUID partition scheme". Apple Knowledgebase.
  15. 1 2 "Boot modes of an Intel-based Mac with an Apple T2 Security Chip". Apple Support. Retrieved 2024-02-14.
  16. "Startup Security Utility on a Mac with an Apple T2 Security Chip". Apple Support. Retrieved 2024-02-14.
  17. "Ubuntu + Mac: Pure EFI Boot". The Slightly Disgruntled Scientist. 7 September 2014. Archived from the original on 8 March 2021. Retrieved 17 November 2019.
  18. "BLESS(8)". keith.github.io. Retrieved 2024-02-14.
  19. "Introduction to Apple Silicon: Storage". GitHub - Asahi Linux Wiki. 2023-11-02. Archived from the original on 2024-02-14. Retrieved 2024-02-14.
  20. "Boot process for a Mac with Apple silicon". Apple Support. Retrieved 2024-02-14.