Yes, GRUB works with GPT (GUID Partition Table).
The method for installing GRUB, however, depends on whether the computer uses a traditional BIOS or a modern UEFI for its firmware. GRUB 2, the version of the bootloader used by modern Linux distributions, was built with GPT and UEFI support in mind.
Booting with UEFI and GPT
This is the standard and most straightforward boot configuration for modern systems.
How it works
- EFI System Partition (ESP): Instead of embedding bootloader code in a hidden sector of the disk, UEFI firmware loads bootloaders from files stored on a special FAT32-formatted partition called the ESP.
- GRUB's role: The GRUB bootloader files (
grubx64.efifor 64-bit systems) are placed in a vendor-specific subdirectory on the ESP, such as/EFI/ubuntuor/EFI/fedora. - UEFI boot variables: The UEFI firmware stores boot variables in NVRAM that point to the location of the GRUB EFI file on the ESP. When the system powers on, the firmware reads these variables to find and launch GRUB.
- OS chainloading: GRUB can then load a Linux kernel or chainload other operating systems, like Windows, which also use the ESP.
What's required
- A motherboard with UEFI firmware.
- A GPT-partitioned disk.
- An EFI System Partition (ESP), typically 100–500MB, formatted with FAT32. This partition is created during the OS installation process.
Booting with Legacy BIOS and GPT
While less common today, GRUB can also boot from a GPT disk on older systems that use traditional BIOS firmware, or on UEFI systems running in Compatibility Support Module (CSM) mode.
How it works
- BIOS Boot Partition: Because BIOS cannot read modern GPT partitions natively, GRUB needs a small, dedicated partition to store its core boot files. This unformatted partition, known as the BIOS Boot Partition, is marked with the
bios_grubflag and is typically 1–2 MB in size. - Protective MBR: GPT disks include a protective Master Boot Record (MBR) at the beginning of the disk for backward compatibility. GRUB's initial boot code is written to this MBR.
- Chainloading GRUB: When the system boots, the BIOS loads the initial GRUB code from the MBR. This code then references the BIOS Boot Partition to load the rest of the bootloader, which is GPT-aware and can read the partitions and files on the GPT-formatted disk.
- OS kernel loading: GRUB then loads the operating system's kernel from its partition, which can be located anywhere on the GPT disk.
What's required
- A motherboard with traditional BIOS or a UEFI system configured to use its Compatibility Support Module (CSM).
- A GPT-partitioned disk.
- A BIOS Boot Partition, typically 1–2 MB in size, with no filesystem. The installer will set the
bios_grubflag for this partition.
GRUB vs. GRUB 2 on GPT
- GRUB Legacy: The original, older GRUB (version 0.97 and earlier) did not natively support GPT. Patched versions existed, but modern Linux distributions no longer use this version.
- GRUB 2: All modern versions of GRUB include robust support for GPT. It is the version you will encounter when installing any current Linux distribution.
Installation considerations
When installing a Linux distribution, the installation program will automatically configure GRUB correctly based on your system's firmware and disk partitioning.
- For UEFI/GPT systems: The installer will detect UEFI, create or use an existing ESP, and install GRUB's EFI files to it.
- For BIOS/GPT systems: The installer will detect a legacy BIOS environment and either create a new BIOS Boot Partition or use an existing one to install GRUB's core boot image.
- For dual-boot systems: The
grub-mkconfigutility can detect other operating systems (like Windows) and automatically create menu entries for them.
Enjoyed this article? Share it with a friend.