GNU GRUB 287817 223747214 2008-07-05T16:14:39Z 24.13.39.199 /* Development */ "most important goal" doesn't make sense when you list 5 goals as "most important" {{redirect|GRUB|other uses|grub (disambiguation)}} {{ Infobox Software | name = GNU GRUB | screenshot = [[Image:Grub2.png]] | caption = a GNU GRUB logo | developer = [[GNU Project]] | latest_release_version = 1.96 | latest_release_date = {{release date and age|2008|02|03}} | genre = [[Bootloader]] | license = [[GNU General Public License]] | website = [http://www.gnu.org/software/grub/ 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 system]]s 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 (computer science)|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 distribution]]s. [[Solaris Operating System|Solaris]] has used GRUB as its bootloader on x86 systems since the Solaris 10 1/06 release. == Features == GRUB is dynamically configurable; it loads its configuration at startup, allowing boot-time changes such as selecting different kernels or [[initrd|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 [[File Allocation Table|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 interface]]s. 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.{{Fact|date=November 2007}} GRUB's text interface can be set to use a [[serial port|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 (which is controlled by the configuration file "menu.lst" (or "grub.conf": see below)) by pressing the "c" key. A GRUB prompt (similar to [[bash]]) can also be obtained by booting 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 file 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]], [[Microsoft Windows|Windows]], [[Linux]], [[BSD]] or [[Solaris (operating system)|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. == Boot process == When a computer is turned on, the computer's [[BIOS]] finds the primary bootable device (usually the computer's hard disk) and loads the initial [[bootstrap]] program from the [[master boot record]] (MBR), the first 512 bytes of the hard disk, and then transfers control to this code. 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, which then continues to start itself. At this stage GRUB can also pass control of the boot process to another loader, using ''chain loading'', for operating systems such as Windows that do not support the Multiboot standard. In this case, copies of the other system's boot programs have been saved by GRUB; instead of a kernel, the other system is loaded as though it had been started from the MBR. This may be yet another boot manager, such as the Microsoft boot menu, allowing further selection of non-Multiboot operating systems. (This behavior is often automatic when modern Linux distributions are installed "on top of" existing Windows systems, allowing the user to retain the original operating system without modification, including systems that contain multiple versions of Windows.) One can boot off [[LILO]] from GRUB. == Installation == [[Image:GRUB screenshot.png|thumb|right|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|Chain loading]]. Unlike [[LILO (boot loader)|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 <code>/boot/grub/menu.lst</code> while [[Fedora (Linux distribution)|Fedora]] and [[Gentoo Linux]] uses <code>/boot/grub/grub.conf</code>. Fedora also provides a [[symbolic link]] from <code>/etc/grub.conf</code> to <code>/boot/grub/grub.conf<code> for [[Filesystem Hierarchy Standard|FHS]] compatibility reasons and other distros can establish symbolic links to the three locations. 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 (CD-ROM standard)|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. == Development == 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 [[rewrite (programming)|complete rewrite]] whose goals include making 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 February 2008, GRUB 2 is still in development, is not ready for production use, and is not documented. Some of the goals of the project include support for non-x86 [[platform (computing)|platforms]], [[internationalization]]/[[localization]], non-ASCII characters, [[dynamic modules (computing)|dynamic modules]], [[memory management]], a scripting [[mini-language (computing)|mini-language]], migrating platform specific (x86) code to platform specific modules, and an object-oriented framework. == Frontends== KGRUBEditor is a system [[GUI]] tool to view and edit the GRUB boot loader, written in the [[KDE]]4 libraries. <ref>[http://www.kde-apps.org/content/show.php?content=75442 KGRUBEditor KDE-Apps.org<!-- Bot generated title -->]</ref> Grub Conf is a [[GNOME]]2 based GRUB configuration editor. <ref>[http://grubconf.sourceforge.net/ GrubConf - GRUB Graphical Configuration Editor<!-- Bot generated title -->]</ref> grub-choose-default controls the default entry in menu.lst, through a [[python_(programming_language)|Python]] GUI. <ref>[http://mentors.debian.net/cgi-bin/sponsor-pkglist?action=details;package=grub-choose-default mentors.debian.net<!-- Bot generated title -->]</ref> <ref>[http://cs.unm.edu/~dmohr/grub.php David Mohr's Homepage - grub-choose-default<!-- Bot generated title -->]</ref> Under Windows if you are running [[ext2]]/[[ext3|3]], then you can use Ext2IFS <ref>http://www.fs-driver.org/</ref> GrubEd is a [[script]] which gives users a nice GUI to alter their grub settings at the touch of (a few) buttons. <ref>[http://ubuntuforums.org/showthread.php?t=228104 SCRIPT: GrubED - GUI Grub editing - Ubuntu Forums<!-- Bot generated title -->]</ref> There is a MS-Dos frontend: GRUB4DOS <ref>[https://gna.org/projects/grub4dos GRUB for DOS - Summary [Gna!&#93;<!-- Bot generated title -->]</ref> == Utilities == GRUB Utilities is a collection of multi platform utilities for GRUB Legacy, GRUB2 and GRUB for DOS. <ref>[https://gna.org/projects/grubutil/ GRUB Utilities - Summary [Gna!&#93;<!-- Bot generated title -->]</ref> == References == * {{cite web | url = http://www.pixelbeat.org/docs/disk/ | title = Details of GRUB on the PC | first = Pádraig | last = Brady | publisher = pixelbeat.org | accessdate = 2006-11-22 }} * {{cite web | url = http://www.gnu.org/software/grub/ | title = GNU GRUB | first = Yoshinori | last = Okuji | publisher = gnu.org | accessdate = 2007-11-29 }} === Notes === <References/> == See also == {{portal|Free software|Free Software Portal Logo.svg}} * [[bootman]] * [[LILO (boot loader)|LILO]] * [[elilo]] * [[NTLDR]] * [[Ncurses]] and Ncurses package for Windows in [[GnuWin32]] * [[SILO (boot loader)|SILO]] * [[Windows Vista startup process|BCD]] * [[Das U-Boot]] Universal Bootloader == External links == *[http://www.gnu.org/software/grub/ GNU GRUB Website] *[http://www.gnu.org/software/grub/manual Official GNU GRUB manual] *[http://www.gnu.org/software/grub/grub-2.en.html GRUB 2 Home Page] *[http://lists.gnu.org/mailman/listinfo/help-grub Official help-grub email list] *[http://grub.enbug.org/FrontPage GRUB wiki] *[http://jbakshi.50webs.com/Linux_tutorial/GRUB/GNU%20GRUB%20simplified.html GNU GRUB (0.97) Simplified for Newbies] * [http://www.pixelbeat.org/docs/disk/ Structure at the start of a hard disk in a PC and how GRUB fits into that structure]. *[http://www.supergrubdisk.org/ Super Grub Disk]: a boot utility that can restore and repair overwritten and misconfigured GRUB installs or directly boot various operating systems. *[http://sarovar.org/projects/grub4dos/ GRUB4DOS], [http://grub4dos.sourceforge.net/wiki/ Wiki] and [http://www.boot-land.net/forums/?showforum=66 Forum] *[http://www.geocities.com/lode_leroy/grubinstall/ WINGRUB: a GRUB installer for Windows] *[http://www.linuxdevcenter.com/pub/a/linux/2008/01/22/lilo-and-grub-boot-loaders-made-simple.html LILO and GRUB: Boot Loaders Made Simple by Judith Myerson] *[http://www.linuxjournal.com/article/4622 Boot with GRUB], [[Linux Journal]] - A good tutorial *[http://www.justlinux.com/forum/showthread.php?threadid=147959 How to install and boot 145 OS in a PC (using GRUB)] *[http://users.bigpond.net.au/hermanzone/p15.htm#How_to_add_Grub_to_your_USB_thumb_drive. How to add GRUB to your USB thumb drive.] {{GNU}} [[Category:Research projects]] [[Category:System software]] [[Category:Boot loaders]] [[Category:GNU project software|GRUB]] [[ar:جنو جرب]] [[ca:GRand Unified Bootloader]] [[cs:GRUB]] [[de:GRUB]] [[es:Grub]] [[eu:Grub]] [[fr:GRand Unified Bootloader]] [[ko:GRUB]] [[it:GRUB]] [[he:GRUB]] [[hu:GNU GRUB]] [[ml:ഗ്നു‌‌‌ ഗ്രബ്]] [[nl:GRUB]] [[ja:GRUB]] [[no:GNU Grand Unified Boot loader]] [[nn:GNU Grand Unified Boot loader]] [[pl:GRUB]] [[pt:GRUB]] [[ru:GRUB]] [[fi:GNU GRUB]] [[sv:GRUB]] [[tr:Grub]]