- GRUB redirects here. For other uses, see Grub.
GNU GRUB ("GRUB" for short) is a multiboot boot-loader software package from the GNU project. GRUB can also be used to select among the kernel images available on a particular operating system's partitions, as well as to pass boot-time parameters to such kernels. In technical terms, a multiboot boot loader is one which can load any executable file with a multiboot header present in the first 8 KB of the file. Such a header consists of 32 bits of "magic" number, 32 bits of flags, a further 32 bits of magic number, followed by data about the executable image.
GNU GRUB developed from a previous package called the GRand Unified Bootloader (a play on Grand Unified Theory). The GNU operating system uses GNU GRUB as its official bootloader, and most distributions of GNU/Linux foster its deployment.
The most used version of GRUB is referred to as "GRUB Legacy". This version is still receiving bug fixes but no new features are being added. The GRUB developers have switched their focus to GRUB 2, a complete rewrite that merges in source code from PUPA. As of May 2006 GRUB 2 is still classified as unstable (in development, not ready for production usage).
Features
- Dynamically configurable; kernel parameters modules loaded and most other settings or parameters can be changed at boot time.
- Flexible command-line interface; provides a simple, bash-like command line interface.
- Custom booting; the CLI lets users write new boot sequences.
- File system access; allows users to view the contents of files on any supported file systems.
- GRUB mounts the file system to load a more advanced and customized copy of itself. It also loads its configuration and allows boot-time changes, like selecting different kernels or initrd
- Support multiple executable formats.
- Support non-Multiboot operating systems
- Multiboot compliant
- Loads multiple modules
- Supports a human-readable configuration file
- Menu interface
- Graphical - Most distributions take advantage of this to provide a customized boot menu.
- Text
- Support multiple file system types
- Support automatic decompression
- Geometry translation independent
- Detect all installed RAM.
- Support Logical Block Address (LBA) mode.
- Download OS images from a network.
- Support diskless systems.
Installation
- No reinstall after config changes - Unlike LILO there is no need to reinstall GRUB to the Master Boot Record or a partition after a change to the configuration file.
- In Linux, the "grub-install" command is used to install stage1 to either the MBR or a partition
- Grub's configuration file, stage2 (usually), and other files must be in a usable partition.
- Config File - The grub configuration file is usually stored in /boot/grub. The name of the file depends on distribution. In Debian it is menu.lst. RedHat/Fedora used grub.conf. Fedora also provides a symbolic link from /etc/grub.conf to /boot/grub/grub.conf.
- Non-standard devices - These portable media let you use GRUB on a system that is having problems booting.
Supported File Systems
As of 2005
Supported Operating Systems
GRUB boot process
- The BIOS finds a bootable device (hard disk) and transfers control to the master boot record (MBR, the first 512 bytes of the hard disk).
- The MBR contains GRUB stage 1. Given the small size of the MBR, Stage 1 does little more than load the next stage of GRUB (which may reside physically elsewhere on the disk). Stage 1 can either load stage 1.5, or it can load Stage 2 directly.
- GRUB Stage 1.5 is located in the first 30 kilobytes of hard disk immediately following the MBR. Stage 1.5 loads Stage 2.
- GRUB Stage 2 (loaded by Stage 1 or 1.5) receives control, and displays to the user the GRUB boot menu (or if the menu is inaccessible, drops the user to the GRUB prompt, where the user can manually specify the boot parameters).
- GRUB loads the user-selected (or default) kernel into memory and passes control on to the kernel. Alternatively chainloading is possible: GRUB hands off control to another bootloader which then continues the process of loading that kernel. The chainloading makes it possible to boot operating systems that don't follow the conventions and have boot processes of their own, for example, Microsoft Windows.
External links
System software | Boot loaders | GNU project software
GRUB | Grub | GRand Unified Bootloader | GRUB | GRUB | GRUB | GNU Grand Unified Boot loader | GRUB | GRUB | GRUB