GNU GRUB

From Wikipedia, the free encyclopedia

(Redirected from GRand Unified Bootloader)
Jump to: navigation, search
GNU GRUB
Image:Grub2.png
the GNU GRUB logo
Developer GNU Project
Latest release 1.95 / October 15, 2006
Genre Bootloader
License GNU General Public License
Website http://www.gnu.org/software/grub/

GNU GRUB ("GRUB" for short) is a boot loader package from the GNU Project. GRUB is the reference implementation of the Multiboot Specification, which allows a user to have several different operating systems on their computer at once, and to choose which one to run when the computer starts. GRUB can be used to select from different kernel images available on a particular operating system's partitions, as well as to pass boot-time parameters to such kernels.

GNU GRUB developed from a previous package called the GRand Unified Bootloader (a play on grand unified theory). It is predominantly used on Unix-like systems; the GNU operating system uses GNU GRUB as its boot loader, as do most general-purpose Linux distributions. Solaris has used GRUB as its bootloader on x86 systems since the Solaris 10 1/06 release.

Contents

GRUB loading Debian GNU/Linux.
GRUB loading Debian GNU/Linux.

GRUB is dynamically configurable; it loads its configuration at startup, allowing boot-time changes such as selecting different kernels or initial RAM disks. To this end, GRUB provides a simple, bash-like command line interface, which lets users write new boot sequences.

GRUB is highly portable. It supports multiple executable formats, and is geometry translation independent; while Multiboot compliant, it supports non-multiboot operating systems such as Microsoft Windows and OS/2 via a chain loading function. GRUB supports all commonly used Unix file systems as well as VFAT and NTFS as used by Windows, and supports Logical Block Address (LBA) mode. GRUB allows users to view the contents of files on any supported file system.

GRUB can be used with a variety of different user interfaces. Most Linux distributions take advantage of GRUB's support for a graphical interface to provide a customized boot menu with a background image, and occasionally mouse support.[citation needed] GRUB's text interface can be set to use a serial link to provide a remote terminal boot loader access.

GRUB can download operating system images from a network, and can thus support disk-free systems. GRUB supports automatic decompression of OS images prior to booting from them.

GRUB differs from other boot loaders by being able to communicate with a user directly via a GRUB prompt. A GRUB prompt is the stage before GRUB loads an operating system and can be triggered at a text-mode GRUB booting screen—that controlled by the configuration file "menu.lst"—by pressing the "c" key. A GRUB prompt (similar to bash) can also be obtained from booting up GRUB as a stand alone system without an operating system attached or in any GRUB installation with an operating system when the "menu.lst" file is absent. From the GRUB prompt a user can manually select and control booting from any installed operating system by using bash-like commands. To boot an operating system automatically, the appropriate commands are placed in a configuration file called "menu.lst" in a designated subdirectory.

GRUB has a rich set of terminal commands that allow a user at the GRUB prompt to view the partition details of the hard disks, alter a partition setting, re-map the disk order temporarily, boot any user-defined configuration file and to view booting configuration of other boot loaders in filing formats GRUB supports. Thus, without prior knowledge of what is installed on a computer one can use GRUB from an external device such as a floppy disk, USB device or a CD-ROM to boot up an installed operating system.

GRUB uses a scrolling screen for selection of operating systems to boot. This means 150 or more booting choices can be controlled by GRUB with ease by adding each to the "menu.lst" configuration file, and selecting one at boot time using the arrow keys.

One boot loader can boot another boot loader by chainloading. GRUB uses the same two to three lines of command sequences to boot any DOS, Windows, Linux, BSD or Solaris system, making it very easy to work with.

Although GNU GRUB can be pre-packaged or retro-built into Unix-like operating systems, there are also specific GRUB implementations for DOS and Windows. GRUB can also be installed as a stand alone system unattached to any operating system. Its implementation requires one file for booting from a CD and two files for booting from a floppy, hard disk or a USB device. These files are available from any Linux Live CD that supports GRUB, making it easily and freely obtainable by computer users.

When a computer is turned on, the computer's BIOS finds the primary bootable device (usually the computer's 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 2 directly, or it can load stage 1.5: GRUB Stage 1.5 is located in the first 30 kilobytes of hard disk immediately following the MBR. Stage 1.5 loads Stage 2.

When GRUB Stage 2 receives control, it presents an interface to the user in order to select which operating system to boot. This normally takes the form of a graphical menu, although if this is not available or the user wishes further control, GRUB has its own command prompt, where the user can manually specify the boot parameters. GRUB can also be set to automatically load a particular kernel after a timeout period.

Once boot options have been selected, GRUB loads the selected kernel into memory and passes control on to the kernel. At this stage GRUB can pass control of the boot process to another loader using chain loading if required by the operating system.

GRUB in non-graphical mode
GRUB in non-graphical mode

A key feature of GRUB is that it can be installed without being attached to an operating system, although it needs a copy of a Linux image for such an installation. Working as a stand alone system it is virtually a mini system in its own right and able to boot all the installed major operating systems by a method known as chainloading.

Unlike LILO, there is no need to reinstall GRUB to the MBR 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. If these files or the partition become unavailable stage1 will drop the user to the command line interface.

The name and disk location of the GRUB configuration file varies from system to system; for example, in Debian GNU/Linux and openSUSE the file is stored in /boot/grub/menu.lst while Fedora uses /boot/grub/grub.conf. Fedora also provides a symbolic link from /etc/grub.conf to /boot/grub/grub.conf for FHS compatibility reasons.

Instead of being installed on the system's hard disk, GRUB can be installed on removable media such as an optical drive (bios access, and el-torito), floppy disk or USB flash drive in order to bring up a system which may not have or cannot boot from its own disk.

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 whose most important goal is to make GNU GRUB cleaner, safer, more robust, more portable and more powerful. GRUB 2 started under the name PUPA. PUPA was supported by the Information-technology Promotion Agency (IPA) in Japan. PUPA was integrated into GRUB 2 development around 2002, when the GRUB version 0.9x was renamed GRUB Legacy. When GRUB 2 is released it will bear the name GNU GRUB. As of December 2007, GRUB 2 is still in development and not ready for production use.

Some of the goals of the project include support for non-x86 platforms, internationalization/localization, non-ASCII characters, dynamic modules, memory management, a scripting mini-language, migrating platform specific (x86) code to platform specific modules, and an object-oriented framework.

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.