GNU GRUB

From Free net encyclopedia

GRUB redirects here. For other uses, see Grub.

Image:Grub2.png

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", and is no longer begin actively developed. The GRUB developers have switched their focus to GRUB 2, a complete rewrite that merges in source code from PUPA.

Features

While traditional boot loaders such as the Linux Loader need to maintain a table of blocks on the hard disk, in order to locate a specific boot image, GRUB can directly locate boot images on the file system. As of 2005 it supports the following file systems:

Systems administrators can also deploy the GRUB on a floppy disk.

Other popular examples of bootloaders include LILO and SYSLINUX.

GRUB's user interface consists of a menu, colors of which can be chosen. Popular operating system distributions that include GRUB often use custom backgrounds with the distribution logo. Users can make their own backgrounds as well. The menu is based on a text file that can reside on any file on the disk, provided GRUB can access it - its location is specified during GRUB installation, and GRUB needs not to be reinstalled if the file is modified, only relocated. Some operating systems, like Debian, can automatically update the GRUB menu file when installing a new kernel. If the menu file is inaccessible, GRUB can also be used through a command line interface to boot the desired kernel.

GRUB boot process

  1. The BIOS finds a bootable device (hard disk) and moves control to the master boot record (MBR, the first 512 bytes of the hard disk).
  2. 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.
  3. GRUB Stage 1.5 is located in the first 30 kilobytes of hard disk immediately following the MBR. Stage 1.5 loads Stage 2.
  4. 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).
  5. 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

Template:Portalpar

es:Grub fr:GRand Unified Bootloader it:GRUB ja:GRUB no:GNU Grand Unified Boot loader pl:GRUB pt:GRUB sv:GRUB