Overview

GNU GRUB (Grand Unified Bootloader) is the standard boot loader used by many Unix-like systems. It presents a menu at system start that lets users choose among installed operating systems or kernel versions, passes boot-time parameters to kernels, and can invoke an interactive command line for advanced tasks. GRUB implements the Multiboot Specification and can therefore work with multiboot-compliant kernels and OS loaders (Multiboot-compliant OSes).

Design and components

Modern GRUB (commonly called GRUB 2) is modular: a small first-stage component is installed in firmware-controlled areas (BIOS boot sectors or an EFI executable), which then loads a larger core with filesystem drivers, device access, and modules. Core components include the configuration file (typically grub.cfg), modules for filesystems (ext4, btrfs, xfs, ntfs read-only), device drivers, and a command interpreter. GRUB can directly read kernel images, initramfs files and pass parameters to them; it also supports chainloading other boot loaders such as the Windows boot manager. For convenience, many distributions provide helper scripts like grub-install and grub-mkconfig or wrappers such as update-grub.

History and development

GRUB originated within the GNU Project as a flexible replacement for simple, single-OS boot loaders. Over time it evolved from the older GRUB Legacy architecture to GRUB 2, a complete redesign that added modularity, richer scripting in configuration, UEFI support, and improved device and filesystem handling. The project is maintained as free software under the GNU General Public License and receives contributions that expand hardware and format support.

Common uses and examples

Typical tasks performed with GRUB include selecting kernels at boot, recovering a system from a broken configuration, and setting up dual-boot systems. Common interactive commands are set, linux, initrd, boot and chainloader. Administrators often regenerate a configuration file rather than editing grub.cfg by hand; for example, grub-mkconfig scans installed kernels and writes a new config that the core loader will use. GRUB can also boot images provided over a network (PXE) or from different partitions and devices, and it can directly load a kernel image stored as a file (kernel images).

Security and recovery

GRUB supports password protection for menu entries and the command line, which helps prevent unauthorized boot-time changes. However, because the boot loader runs before the operating system, physical access to the machine or firmware settings can often bypass protections; secure boot and firmware passwords provide extra safeguards. GRUB includes a rescue mode for recovering from corrupted boot sectors or configuration files; typical recovery steps include setting the root device, loading a kernel and initrd, and issuing the boot command.

Notable distinctions

  • GRUB Legacy vs GRUB 2: GRUB 2 is the actively maintained, modular successor with UEFI support and more features.
  • BIOS vs UEFI: installation and image layout differ—UEFI uses EFI binaries while BIOS uses staged boot sectors and core images.
  • Multiboot: GRUB is a primary implementation of the Multiboot Specification, enabling it to start a variety of kernels and operating systems directly.

Because GRUB controls the earliest stage of system startup, understanding its configuration and recovery procedures is essential for system administrators and users who run multiple operating systems or maintain custom kernel configurations.