Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
GNU GRUB
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Boot loader package}} {{Redirect2|GRUB|PUPA|the life stage of insects|Pupa|other uses|Grub (disambiguation)|and|Pupa (disambiguation)}} {{Use mdy dates|date=April 2017}} {{Infobox software | name = GNU GRUB | logo = Grub logo large.png | logo size = 120px | logo caption = GNU GRUB logo | logo alt = Logo depicting Richard Stallman with a magnifying glass checking the hard drive. | screenshot = GRUB v2.12 screenshot, Fedora 41.png | caption = GRUB v2.12 running in text mode | collapsible = | author = Erich Boleyn | developer = [[GNU Project]] | released = {{Start date and age|1995}} | ver layout = simple | latest release version = {{wikidata|property|preferred|references|edit|Q212885|P348|P548=Q2804309}} | latest release date = {{wikidata|qualifier|preferred|single|Q212885|P348|P548=Q2804309|P577}} | latest preview version = {{wikidata|property|preferred|references|edit|Q212885|P348|P548=Q51930650}} | latest preview date = {{wikidata|qualifier|preferred|single|Q212885|P348|P548=Q51930650|P577}} | programming language = [[Assembly language|Assembly]], [[C (programming language)|C]]<ref name="ohloh">{{cite web | url = http://www.ohloh.net/p/grub | title = Ohloh Analysis Summary β GNU GRUB | publisher = [[Ohloh]] | access-date = 2010-05-12 | archive-date = February 4, 2009 | archive-url = https://web.archive.org/web/20090204221010/http://www.ohloh.net/p/grub | url-status = live }}</ref> | operating_system = [[Linux]], [[GNU#GNU_as_an_operating_system|GNU/Hurd]], [[macOS]], [[BSD (operating system)|BSD]], ([[Solaris (operating system)|Solaris]]/ [[illumos]] (x86 port)), and [[Microsoft Windows|Windows]] (through chainloading) | platform = [[IA-32]], [[x86-64]], [[IA-64]], [[ARM architecture|ARM]], [[PowerPC]], [[Power ISA]], [[s390x]], [[MIPS architecture|MIPS]], [[RISC-V]], [[LoongArch]] and [[SPARC]] | size = | language = [[English language|English]] and others | genre = [[Bootloader]] | license = 2007: [[GNU General Public License|GPL-3.0-or-later]]{{efn|GPL-3.0-or-later since 2007-07-21.<ref>{{cite web|url=https://git.savannah.gnu.org/cgit/grub.git/commit/?id=5a79f472c750dc08f1d074f7d480ef571c6f2e36|title=Migrate to GNU General Public License Version 3.|date=2007-07-21|access-date=October 27, 2021|archive-date=October 27, 2021|archive-url=https://web.archive.org/web/20211027004239/https://git.savannah.gnu.org/cgit/grub.git/commit/?id=5a79f472c750dc08f1d074f7d480ef571c6f2e36|url-status=live}}</ref>}}<ref name="GNU GRUB license">{{cite web | url = http://bzr.savannah.gnu.org/lh/grub/trunk/grub/annotate/head:/COPYING | archive-url = https://archive.today/20130911174027/http://bzr.savannah.gnu.org/lh/grub/trunk/grub/annotate/head:/COPYING | url-status = dead | archive-date = 2013-09-11 | title = GNU GRUB license}}</ref><br />1999: [[GNU General Public License|GPL-2.0-or-later]]{{efn|GPL-2.0-or-later from 1999 until 2007-07-02.}} | website = {{URL|https://www.gnu.org/software/grub}} }} '''GNU GRUB''' (short for '''GNU GRand Unified Bootloader''', commonly referred to as '''GRUB''') is a [[boot loader]] package from the [[GNU Project]]. GRUB is the [[reference implementation]] of the [[Free Software Foundation]]'s [[Multiboot Specification]], which provides a user the choice to boot one of multiple [[operating system]]s installed on a computer if (dual booted) or select a specific [[Kernel (operating system)|kernel]] configuration available on a particular operating system's partitions. It loads up before the operating system GNU GRUB was developed from a package called the ''Grand Unified Bootloader'' (a play on [[Grand Unified Theory]]<ref>[http://searchenterpriselinux.techtarget.com/definition/GRUB-GRand-Unified-Bootloader EnterpriseLinux.com Definitions] {{Webarchive|url=https://web.archive.org/web/20101203081648/http://searchenterpriselinux.techtarget.com/definition/GRUB-GRand-Unified-Bootloader |date=December 3, 2010 }} Definition of GRand Unified Bootloader</ref>). It is predominantly used for [[Unix-like]] systems. ==Operation== {{Technical|section|date=August 2021}}[[File:GNU GRUB on MBR partitioned hard disk drives.svg|thumb|upright=1.5|GRUB2 on [[Master boot record|MBR]]-partitioned hard drive; stage 1 (<code>boot.img</code>) can alternatively be written into one of the [[Volume boot record|partition boot sectors]].<nowiki/>]] [[File:GNU GRUB on GPT partitioned hard disk drives.svg|thumb|upright=1.5|GRUB2 on a [[GUID Partition Table|GPT]]-partitioned hard drive, booting on [[BIOS|BIOS firmware]], or [[UEFI#CSM booting|UEFI compatibility mode (CSM)]]]] ==={{Anchor|MAP-FILE}}Booting=== {{See also|UEFI disk device compatibility}} When a computer is turned on, its [[BIOS]] finds the primary bootable device (usually the computer's hard disk) and runs the initial [[Bootstrapping (computing)|bootstrap]] program from the [[master boot record]] (MBR). The MBR is the first [[Disk sector|sector]] of the hard disk. This bootstrap program must be small because it has to fit in a single sector. For a long time, the size of a sector has been 512 bytes. Since 2009 there are hard disks available with a sector size of 4096 bytes, called [[Advanced Format]] disks, but {{as of|2013|10|lc=y}}, such hard disks are still accessed in 512-byte sectors, using the [[Advanced Format#512e|512e emulation]].<ref>{{cite web |last = Smith |first = Ryan |title = Western Digital's Advanced Format: The 4K Sector Transition Begins |publisher = [[AnandTech]] |date = December 18, 2009 |url = http://www.anandtech.com/show/2888 |access-date = October 10, 2013 |archive-date = March 12, 2012 |archive-url = https://web.archive.org/web/20120312061308/http://www.anandtech.com/show/2888 |url-status = live }}</ref> The legacy [[MBR partition table]] supports a maximum of four partitions and occupies 64 bytes, combined. Together with the optional [[MBR disk signature|disk signature]] (four bytes) and [[MBR disk timestamp|disk timestamp]] (six bytes), this leaves between 434 and 446 bytes available for the [[machine code]] of a boot loader. Although such a small space can be sufficient for very simple boot loaders,<ref>{{cite web |url = http://mbldr.sourceforge.net/ |title = mbldr (Master Boot LoaDeR) |year = 2009 |access-date = October 10, 2013 |website = mbldr.sourceforge.net |archive-date = March 16, 2013 |archive-url = https://web.archive.org/web/20130316062331/http://mbldr.sourceforge.net/ |url-status = live }}</ref> it is not big enough to contain a boot loader supporting complex and multiple [[file system]]s, menu-driven selection of boot choices, etc. Boot loaders with bigger footprints are therefore split into pieces, where the smallest piece fits in the MBR, while one or more larger pieces are stored in other locations such as empty sectors between the MBR and the first partition. The code in the MBR then does little more than starting the second part. The purpose of the remaining part(s) of the boot loader is to actually boot an operating system by configuring it and starting the [[kernel (operating system)|kernel]]. Kernels are in most cases stored as files residing on appropriate file systems, but the concept of a file system is unknown to the BIOS. Thus, in BIOS-based systems, the duty of a boot loader is to access the content of those files, so it can be loaded into the [[RAM]] and executed. One possible approach for boot loaders is to load kernel images by directly accessing hard disk sectors without understanding the underlying file system. Usually, an additional level of [[indirection]] is required, in form of ''maps'' or ''map files''{{snd}} auxiliary files that contain a list of physical sectors occupied by kernel images. Such maps need to be updated each time a kernel image changes its physical location on disk, due to installing new kernel images, file system defragmentation, etc. Also, in case of the maps changing their physical location, their locations need to be updated within the boot loader's MBR code, so the sectors indirection mechanism continues to work. This is not only cumbersome, but it also leaves the system in need of manual repairs in case something goes wrong during system updates.<ref name="boot-admin">{{cite web | url = http://www-uxsup.csx.cam.ac.uk/pub/doc/suse/suse9.0/adminguide-9.0/node8.html | title = Booting and Boot Managers | access-date = 2013-10-10 | publisher = SUSE | archive-date = September 17, 2013 | archive-url = https://web.archive.org/web/20130917130646/http://www-uxsup.csx.cam.ac.uk/pub/doc/suse/suse9.0/adminguide-9.0/node8.html | url-status = live }}</ref> Another approach is to make a boot loader aware of the underlying file systems, so kernel images are configured and accessed using their actual [[Path (computing)|file path]]s. That requires a boot loader to contain a driver for each of the supported file systems, so they can be understood and accessed by the boot loader itself. This approach eliminates the need for hardcoded locations of hard disk sectors and existence of map files, and does not require MBR updates after kernel images are added or moved around. The configuration of a boot loader is stored in a regular file, which is also accessed in a file system-aware way to obtain boot configurations before the actual booting of any kernel images. Thus, fewer things can go wrong during system updates. As a downside, such boot loaders are larger and more complex.<ref name="boot-admin" /> GNU GRUB uses the second approach, by understanding the underlying file systems. The boot loader itself is split into multiple ''stages'' so that it fits in the MBR boot scheme. Two major versions of GRUB are in common use: GRUB version 0, called ''GRUB legacy,'' is only prevalent in older releases of Linux distributions. ''GRUB 2'' was written from scratch and intended to replace its predecessor, and is now used by a majority of Linux distributions. ===Version 0 (GRUB Legacy)=== [[File:GRUB v1.5 Screenshot, Ubuntu 9.04.png|thumb|GRUB Legacy menu (running as part of [[Ubuntu (operating system)|Ubuntu]] 9.04 installation)]] GRUB 0.x follows a two-stage approach. The master boot record (MBR) usually contains GRUB ''stage 1,'' or can contain a standard MBR implementation which [[chain loading|chainloads]] GRUB ''stage 1'' from the active [[Partition Boot Sector|partition's boot sector]]. Given the small size of a boot sector (512 bytes), ''stage 1'' can do little more than load the next stage of GRUB by loading a few disk sectors from a fixed location near the start of the disk (within its first 1024 cylinders). ''Stage 1'' can load ''stage 2'' directly, but it is normally set up to load the ''stage 1.5.'', located in the first 30 [[KiB]] of hard disk immediately following the MBR and before the first partition. In case this space is not available (unusual partition table, special disk drivers, [[GUID Partition Table|GPT]] or [[Logical Volume Manager (Linux)|LVM]] disk) the install of ''stage 1.5'' will fail. The ''stage 1.5'' image contains file system drivers, enabling it to directly load ''stage 2'' from any known location in the filesystem, for example from <code>/boot/grub</code>. ''Stage 2'' will then load the default configuration file and any other modules needed. ==={{anchor|GRUB 2}}Version 2 (GRUB 2)=== [[File:GNU GRUB components.svg|thumb|upright=1.5|GRUB 2 β MBR vs. GPT partitioning and boot sequence visualized (systems using BIOS firmware).]] ==== Startup on systems using [[BIOS]] firmware ==== * See illustration in last image on the right.<ref>{{Cite web|title=GNU GRUB Manual 2.04|url=https://www.gnu.org/software/grub/manual/grub/grub.html#Images|access-date=2020-11-10|website=www.gnu.org|archive-date=April 3, 2018|archive-url=https://web.archive.org/web/20180403023208/http://www.gnu.org/software/grub/manual/grub/grub.html#Images|url-status=live}}</ref> * <code>boot.img</code> ('''stage 1''') is written to the first 440 bytes of the [[Master boot record|Master Boot Record]] (MBR boot code in sector 0), or optionally in a [[partition boot sector]] (PBR). It addresses <code>diskboot.img</code> by a 64-bit [[Logical block addressing | LBA]] address. The actual sector number is written by <code>grub-install</code>. <code>diskboot.img</code> is the first sector of <code>core.img</code> with the sole purpose to load the rest of <code>core.img</code> identified by LBA sector numbers also written by <code>grub-install</code>. ** On MBR partitioned disks, <code>core.img</code> ('''stage 1.5''') is stored in the empty sectors (if available) between the MBR and the first partition. Recent operating systems suggest a 1 MiB gap here for alignment (2047 512-byte, or 255 4KiB, sectors). This gap used to be 62 sectors (31 KiB) as a reminder of the sector number limit of [[Cylinder-Head-Sector]] (C/H/S) addressing used by [[BIOS]] before 1996, therefore <code>core.img</code> is designed to be smaller than 32 KiB. **On GPT partitioned disks <code>core.img</code> is written to its own partition. It must be flagged "BIOS_grub", must not be [[file system|formatted]] and can be as tiny as 1 MiB. * '''stage 2:''' <code>core.img</code> loads <code>/boot/grub/i386-pc/normal.mod</code> from the partition configured by <code>grub-install</code>. If the partition index has changed, GRUB will be unable to find the <code>normal.mod</code>, and presents the user with the GRUB Rescue prompt. * Depending on how GRUB2 was installed, the <code>/boot/grub/</code> is either in the ''root'' partition of the Linux distribution, or in the separate ''/boot'' partition. * '''after normal.mod loaded:''' <code>normal.mod</code> parses <code>/boot/grub/grub.cfg</code>, optionally loads modules (eg. for graphical UI and file system support) and shows the menu. ==== Startup on systems using [[UEFI]] firmware ==== * <code>/efi/<distro>/grubx64.efi</code> (for [[x64]] UEFI systems) is installed as a file in the [[EFI system partition|EFI System Partition]], and booted by the firmware directly, without a <code>boot.img</code> in MBR sector 0. This file is like stage1 and stage1.5. * <code>/boot/grub/</code> can be installed on the EFI System Partition or the separate ''/boot'' partition, among others. * For x64 UEFI systems, stage2 are the <code>/boot/grub/x86_64-efi/normal.mod</code> file and other <code>/boot/grub/</code> files. ==== After startup ==== GRUB presents a menu where the user can choose from operating systems (OS) found by grub-install. GRUB can be configured to automatically load a specified OS after a user-defined timeout. If the timeout is set to zero seconds, pressing and holding {{Keypress|Shift}}, or in some modern GRUB versions loaded using UEFI, pressing {{Keypress|Esc}} rapidly while the computer is booting makes it possible to access the boot menu.<ref name="howtogeek.com">{{cite web|url=http://www.howtogeek.com/196655/how-to-configure-the-grub2-boot-loaders-settings/|title=How to Configure the GRUB2 Boot Loader's Settings|website=HowToGeek.com|first=Chris|last=Hoffman|date=September 22, 2014|access-date=April 25, 2015|archive-date=April 28, 2015|archive-url=https://web.archive.org/web/20150428233135/http://www.howtogeek.com/196655/how-to-configure-the-grub2-boot-loaders-settings/|url-status=live}}</ref> In the operating system selection menu GRUB accepts a couple of commands: * By pressing {{key press|e}}, it is possible to edit kernel parameters of the selected menu item ''before the operating system is started''. The reason for doing this in GRUB (i.e. not editing the parameters in an already booted system) can be an emergency case: the system has failed to boot. Using the kernel parameters line it is possible, among other things, to specify a module to be disabled (blacklisted) for the kernel. This could be required if the specific kernel module is broken and thus prevents boot-up. For example, to blacklist the kernel module <code>nvidia-current</code>, one could append <code>modprobe.blacklist=nvidia-current</code> at the end of the kernel parameters. * By pressing {{key press|c}}, the user enters the GRUB command line. The GRUB command line resembles GNU Bash, but only implements a subset of the line editing functions and GRUB-specific commands.<ref>{{cite web |url=https://www.gnu.org/software/grub/grub-documentation.html |title=GNU GRUB documentation |access-date=April 16, 2014 |archive-date=April 18, 2014 |archive-url=https://web.archive.org/web/20140418191412/http://www.gnu.org/software/grub/grub-documentation.html |url-status=live }}</ref> Once boot options have been selected, GRUB loads the selected kernel into memory and passes control to the kernel. Alternatively, GRUB can pass control of the boot process to another boot loader, using ''[[chain loading]]''. This is the method used to load operating systems that do not support the [[Multiboot Specification]] or are not supported directly by GRUB. === Identifying partitions (UUID workaround) === A computer can have multiple hard disks connected to it. These could be identified via their SATA port. Each time the computer [[Power-on self-test|POSTs]], the hard disk connected to a specific motherboard port ''could'' be assigned the same identifier, for example {{code|hd0, hd1, β¦}}. But what if such consistency cannot be guaranteed? What if the constellation of connected hard disks changed from one start up to another? What if a hard disk will be connected to another computer? By entering {{code|ls}} into either the ''GRUB rescue console'' (available after loading <code>core.img</code> ) or the ''GRUB console'' (available after loading <code>normal.mod</code>) a list of all available hard disks and partitions can be obtained. For example, {{code|ls (hd0,5)/}}) will show numbers that can be assigned to actual hard disks and partitions. As it cannot be guaranteed that the "<code>hd0"</code>style numbering of hard disks via device numbers is consistent, GNU GRUB can use a [[Universally Unique Identifier]] (UUID) to identify partitions (actually file system instances). The file systems ext2, ext3, ext4 and xfs use a UUID to uniquely identify an instance. The UUID is created when a partition is formatted. The UUID is part of the file system and written to the [[Superblock (file system)|superblock]]. All operations other than formatting should leave the UUID unaltered. It is possible to change the UUID or duplicate it by using [[dd (Unix)|dd]] to clone an entire partition. The file {{code|grub.cfg}} is used to configure GRUB. It contains commands to be executed during each start-up. Without an existing and valid {{code|grub.cfg}}, GRUB will present a prompt. An absolute minimal {{code|grub.cfg}} might contain only the following two commands (cf. [[initial ramdisk]]): <pre> linux (hd0,1)/kernel/vmlinuz-3.20.1-4 ro # use the file name "vmlinuz-β¦" located in the directory /kernel on the first partition of the first hard disk as linux kernel image initrd (hd0,1)/boot/initrd.img-3.20.1-4 # use the file named "initrd.imgββ¦" located in the directory /boot on the first partition of the first hard disk as initial ramdisk </pre> A fancier {{code|grub.cfg}} will describe a menu to be presented, use multiple colors, and may specify a background picture. ==History== GRUB was initially developed by Erich Boleyn as part of work on booting the [[operating system]] [[GNU]]/[[GNU Hurd|Hurd]], developed by the [[Free Software Foundation]].<ref name="history">[https://www.gnu.org/software/grub/manual/html_node/History.html GRUB Manual β 1.2 Grub History] {{Webarchive|url=https://web.archive.org/web/20140416181331/https://www.gnu.org/software/grub/manual/html_node/History.html |date=April 16, 2014 }}. Gnu.org (2012-06-23). Retrieved on 2012-12-01.</ref> In 1999, Gordon Matzigkeit and Yoshinori K. Okuji made GRUB an official software package of the [[GNU Project]] and opened the [[software development process|development process]] to the public.<ref name="history"/> {{As of|2014}}, the majority of Linux distributions have adopted GNU GRUB 2. ===Development=== GRUB version 0 (also known as "GRUB Legacy") is no longer under development and is being phased out.<ref>[https://www.gnu.org/software/grub/grub-legacy.html GNU GRUB β GRUB Legacy] {{Webarchive|url=https://web.archive.org/web/20140420104228/http://www.gnu.org/software/grub/grub-legacy.html |date=April 20, 2014 }}. Gnu.org. Retrieved on 2012-12-01.</ref> The GNU GRUB developers have switched their focus to GRUB 2,<ref>{{cite web |url=https://www.gnu.org/software/grub/grub-2.en.html |title=GNU GRUB β GRUB 2 |access-date=2014-04-18 |url-status=bot: unknown |archive-url=https://web.archive.org/web/20080607115918/https://www.gnu.org/software/grub/grub-2.en.html |archive-date=June 7, 2008 |df=mdy-all}}.</ref> a [[rewrite (programming)|complete rewrite]] with goals including making GNU GRUB cleaner, 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 GRUB version 0.9x was renamed GRUB Legacy. Some of the goals of the GRUB 2 project include support for non-x86 [[computing platform|platforms]], [[internationalization and 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. GNU GRUB version 2.00 was officially released on June 26, 2012.<ref>{{cite mailing list |url=http://lists.gnu.org/archive/html/grub-devel/2012-06/msg00093.html |title=GRUB 2.00 released |date=June 28, 2012 |access-date=December 1, 2012 |mailing-list=grub-devel |first=Vladimir |last=Serbinenko |archive-date=January 13, 2013 |archive-url=https://web.archive.org/web/20130113150325/http://lists.gnu.org/archive/html/grub-devel/2012-06/msg00093.html |url-status=live }}</ref><ref>{{cite web|last=Larabel|first=Michael|title=GRUB 2.00 Boot-Loader Officially Released|url=https://www.phoronix.com/scan.php?page=news_item&px=MTEyODc|website=Phoronix.com|access-date=28 June 2012|archive-date=September 13, 2016|archive-url=https://web.archive.org/web/20160913072241/http://www.phoronix.com/scan.php?page=news_item&px=MTEyODc|url-status=live}}</ref> Three of the most widely used [[Linux distribution]]s use GRUB 2 as their mainstream boot loader.<ref>{{cite web |url=http://www.webjunction.org/documents/webjunction/An_Introduction_to_Ubuntu.html |title=An Introduction to Ubuntu |last=Haddon |first=Tom |date=26 January 2012 |publisher=WebJunction |access-date=21 September 2012 |url-status=dead |archive-url=https://web.archive.org/web/20121028160701/http://www.webjunction.org/documents/webjunction/An_Introduction_to_Ubuntu.html |archive-date=October 28, 2012 |df=mdy-all}}</ref><ref>{{cite web |url=http://www.techopedia.com/definition/15777/red-hat-enterprise-linux-rhel |title=What is Red Hat Enterprise Linux (RHEL)? |last=Janssen |first=Cory |publisher=Technopedia |access-date=21 September 2012 |archive-date=October 3, 2012 |archive-url=https://web.archive.org/web/20121003043553/http://www.techopedia.com/definition/15777/red-hat-enterprise-linux-rhel |url-status=live }}</ref><ref>{{cite web |url=http://www.itwire.com/business-it-news/open-source/56686-suse-chief-lists-progress-since-privatisation |title=SUSE chief lists progress since privatisation |last=Varghese |first=Sam |date=2012-09-20 |access-date=21 September 2012 |archive-date=September 22, 2012 |archive-url=https://web.archive.org/web/20120922122233/http://www.itwire.com/business-it-news/open-source/56686-suse-chief-lists-progress-since-privatisation |url-status=live }}</ref> [[Ubuntu (operating system)|Ubuntu]] adopted it as the default boot loader in its 9.10 version of October 2009.<ref>{{cite web|title=9.10 Karmic GRUB version|url=http://distrowatch.com/table.php?distribution=ubuntu|publisher=Distrowatch.com|access-date=8 July 2012|archive-date=May 9, 2012|archive-url=https://web.archive.org/web/20120509124455/http://distrowatch.com/table.php?distribution=ubuntu|url-status=live}}</ref> [[Fedora Linux|Fedora]] followed suit with Fedora 16 released in November 2011.<ref>[http://fedoraproject.org/wiki/GRUB_2 GRUB 2] {{Webarchive|url=https://web.archive.org/web/20120805080954/http://fedoraproject.org/wiki/GRUB_2 |date=August 5, 2012 }}. FedoraProject. Retrieved on 2012-12-01.</ref> [[OpenSUSE]] adopted GRUB 2 as the default boot loader with its 12.2 release of September 2012.<ref>[http://en.opensuse.org/openSUSE:Upcoming_features openSUSE:Upcoming features β openSUSE] {{webarchive|url=https://web.archive.org/web/20120920065446/http://en.opensuse.org/openSUSE%3AUpcoming_features |date=September 20, 2012}}. En.opensuse.org. Retrieved on 2012-12-01.</ref> [[Solaris (operating system)|Solaris]] also adopted GRUB 2 on the x86 platform in the Solaris 11.1 release.<ref>[http://www.oracle.com/technetwork/server-storage/solaris11/overview/solaris11-1-1845817.html Solaris 11.1] {{Webarchive|url=https://web.archive.org/web/20180619201612/http://www.oracle.com/technetwork/server-storage/solaris11/overview/solaris11-1-1845817.html |date=June 19, 2018 }}. Oracle Retrieved 2015-03-19.</ref> [[Buildroot]] also uses GNU GRUB for [[x86]] and [[X86-64|x86_64]] targets. In late 2015, the exploit of pressing backspace 28 times to bypass the login password was found and quickly fixed.<ref>{{cite web |url=http://thehackernews.com/2015/12/hack-linux-grub-password.html |website=thehackernews.com |title=You can Hack into a Linux Computer just by pressing 'Backspace' 28 times |date=December 16, 2015 |first=Swati |last=Khandelwal |access-date=March 13, 2017 |archive-date=April 30, 2017 |archive-url=https://web.archive.org/web/20170430230510/http://thehackernews.com/2015/12/hack-linux-grub-password.html |url-status=live }}</ref><ref>{{cite web |url=http://hmarco.org/bugs/CVE-2015-8370-Grub2-authentication-bypass.html#exploit |title=Back to 28: Grub2 Authentication 0-Day |first1=Hector |last1=Marco and |first2=Ismael |last2=Ripoll |date=December 2015 |access-date=March 13, 2017 |archive-date=May 17, 2017 |archive-url=https://web.archive.org/web/20170517200459/http://hmarco.org/bugs/CVE-2015-8370-Grub2-authentication-bypass.html#exploit |url-status=live }}</ref> ==={{Anchor|TRUSTED}}Variants=== GNU GRUB is [[free software]], so several variants have been created. Some notable ones, which have not been merged into GRUB mainline: * [[OpenSolaris]] includes a modified GRUB Legacy that supports Solaris VTOC slices, automatic 64-bit kernel selection, and booting from [[ZFS]] (with [[Data compression|compression]] and multiple boot environments).<ref>[http://dlc.sun.com/osol/docs/content/SYSADV1/getov.html#fwbqs x86: Modifying Boot Behavior by Editing the GRUB Menu at Boot Time] {{webarchive|url=https://web.archive.org/web/20110719115732/http://dlc.sun.com/osol/docs/content/SYSADV1/getov.html |date=July 19, 2011}}, Modifying Solaris Boot Behavior on x86 Based Systems (Task Map) β System Administration Guide: Basic Administration</ref><ref>[http://docs.sun.com/app/docs/doc/819-2379/getnk?a=view x86: Supported GRUB Implementations] {{webarchive|url=https://web.archive.org/web/20091021160244/http://docs.sun.com/app/docs/doc/819-2379/getnk?a=view |date=October 21, 2009}}, (System Administration Guide: Basic Administration) β Sun Microsystems</ref> * [[Google Summer of Code]] 2008 had a project to support GRUB legacy to boot from [[ext4]] formatted partitions.<ref>{{cite web | last = Peng | first = Tao | title = Grub4ext4 | url = https://code.google.com/archive/p/grub4ext4/ | access-date = June 13, 2017 | archive-date = December 31, 2016 | archive-url = https://web.archive.org/web/20161231162436/https://code.google.com/archive/p/grub4ext4/ | url-status = live }}</ref> * The [[Syllable Desktop|Syllable]] project made a modified version of GRUB to load the system from its [[AtheOS File System]].<ref>[http://web.syllable.org/documentation/FAQ.html#2_3 2.3 Why does Syllable have its own version of GRUB?] {{webarchive|url=https://web.archive.org/web/20110107003333/http://web.syllable.org/documentation/FAQ.html |date=January 7, 2011}}, Syllable Documentation</ref> * ''TrustedGRUB'' extends GRUB by implementing verification of the system integrity and boot process security, using the [[Trusted Platform Module]] (TPM).<ref>{{cite web | url = http://sourceforge.net/projects/trustedgrub/ | title = TrustedGRUB project | access-date = November 18, 2014 | website = sourceforge.net | date = June 5, 2013 | archive-date = November 29, 2014 | archive-url = https://web.archive.org/web/20141129024847/http://sourceforge.net/projects/trustedgrub/ | url-status = live }}</ref> * The Intel BIOS Implementation Test Suite (BITS) provides a GRUB environment for testing BIOSes and in particular their initialization of Intel processors, hardware, and technologies. BITS supports scripting via Python, and includes Python APIs to access various low-level functionality of the hardware platform, including ACPI, CPU and chipset registers, PCI, and PCI Express.<ref>[https://biosbits.org: BIOS Implementation Test Suite] {{Webarchive|url=https://web.archive.org/web/20161019132535/https://biosbits.org/ |date=October 19, 2016 }}, Official BITS website</ref> * GRUB4DOS is a GRUB legacy fork that improves the installation experience on DOS and [[Microsoft Windows]] by putting everything besides the GRLDR config in one image file. It can be loaded directly from DOS, or by [[NTLDR]] or [[Windows Boot Manager]].<ref>{{cite web |title=grub4dos |url=https://sites.google.com/site/grubdos/ |website=Google Site |access-date=7 April 2019 |archive-date=April 7, 2019 |archive-url=https://web.archive.org/web/20190407043143/https://sites.google.com/site/grubdos/ |url-status=live }}</ref><ref>{{cite web |title=GRUB for DOS Introduction |url=http://grub4dos.sourceforge.net/wiki/index.php/Grub4dos_tutorial |website=grub4dos.sourceforge.net |access-date=7 April 2019 |archive-url=https://web.archive.org/web/20190407042958/http://microsaint.narod.ru/_Info_Grub4Dos/Grub4dos_tutorial.html |archive-date=7 April 2019 |date=2007}}</ref> GRUB4DOS is under active development and as of 2021 supports UEFI.<ref>{{GitHub|https://github.com/chenall/grub4dos}}</ref> ==Utilities== ===GRUB configuration tools=== [[File:StartUp-Manager.png|thumb|upright=0.9|StartUp-Manager, a program used to configure GRUB]] The setup tools in use by various distributions often include modules to set up GRUB. For example, [[YaST|YaST2]] on [[SUSE Linux]] and [[openSUSE]] distributions and [[Anaconda (installer)|Anaconda]] on [[Fedora Linux|Fedora]]/[[Red Hat Enterprise Linux|RHEL]] distributions. StartUp-Manager and GRUB Customizer are graphical configuration editors for Debian-based distributions. The development of StartUp-Manager stopped on 6 May 2011 after the lead developer cited personal reasons for not actively developing the program.<ref>{{Cite web|url=https://launchpad.net/startup-manager/+announcement/8300|title=StartUp-Manager is dead : StartUp-Manager|website=launchpad.net|date=May 6, 2011 |language=en|access-date=2017-04-09|archive-date=August 1, 2020|archive-url=https://web.archive.org/web/20200801025445/https://launchpad.net/startup-manager/+announcement/8300|url-status=live}}</ref> GRUB Customizer is also available for Arch-based distributions. For GRUB 2 there are KDE Control Modules.<ref>[http://kde-apps.org/content/show.php/GRUB2+Bootloader+Editor?content=139643 GRUB2 Bootloader Editor] {{Webarchive|url=https://web.archive.org/web/20150907210938/http://kde-apps.org/content/show.php/GRUB2+Bootloader+Editor?content=139643 |date=September 7, 2015 }}. Kde-apps.org (2012-06-18). Retrieved on 2012-12-01.</ref><ref>{{cite web|url=http://kde-apps.org/content/show.php/Grub2+Kcm?content=137886|title=Grub2 KCM|website=KDE-Apps.org|access-date=2011-01-27|archive-date=September 6, 2015|archive-url=https://web.archive.org/web/20150906234436/http://kde-apps.org/content/show.php/Grub2+Kcm?content=137886|url-status=live}}</ref> GRLDR ICE is a tiny tool for modifying the default configuration of grldr file for GRUB4DOS.<ref>{{cite web|url=http://microsaint.narod.ru/_Info_Grub4Dos/Grub4dos_tutorial.html|title=Grub4dos tutorial|website=Narod.ru|access-date=April 25, 2015|archive-date=May 3, 2015|archive-url=https://web.archive.org/web/20150503014019/http://microsaint.narod.ru/_Info_Grub4Dos/Grub4dos_tutorial.html|url-status=live}}</ref> ===Boot repair utilities=== [[sourceforge:p/boot-repair/home/Home/|Boot-Repair]] is a simple graphical tool for recovering from frequent boot-related problems with GRUB and [[Microsoft Windows]] bootloader. This application is available under [[GNU General Public License|GNU GPL license]]. Boot-Repair can repair GRUB on multiple Linux distributions including, but not limited to, Debian, Ubuntu, [[Linux Mint|Mint]], Fedora, openSUSE, and [[Arch Linux]].[[File:GRUB customizer.png|thumb|212x212px|GRUB Customizer]] ===Installer for Windows=== [[sourceforge:projects/grub2win|Grub2Win]] is a Windows open-source software package. It allows GNU GRUB to boot from a Windows directory. The setup program installs GNU GRUB version 2.12 to an NTFS partition. A Windows GUI application is then used to customize the GRUB boot menu, themes, UEFI boot order, scripts etc. All GNU GRUB scripts and commands are supported for both UEFI and legacy systems. Grub2Win can configure GRUB for multiboot of Windows, Ubuntu, openSuse, Fedora and many other Linux distributions. It is freely available under [[GNU General Public License|GNU GPL License]] at [[sourceforge:projects/grub2win|SourceForge]]. ==Alternative boot managers== {{See also|Comparison of bootloaders}} The strength of GRUB is the wide range of supported platforms, file systems, and operating systems, making it the default choice for distributions and embedded systems. However, there are boot managers targeted at the end user that give more friendly user experience, graphical OS selector and simpler configuration: * [[rEFInd]] β Macintosh-style graphical boot manager, only for UEFI-based computers (BIOS not supported). * [https://github.com/CloverHackyColor/CloverBootloader CloverEFI] β Macintosh-style graphical boot manager for BIOS and UEFI-based computers. It emulates UEFI with a heavily modified [https://github.com/tianocore/tianocore.github.io/wiki/DuetPkg DUET] from the TianoCore project and requires a FAT formatted partition even on BIOS systems. As a benefit, it has a basic filesystem driver in the partition boot sector, avoiding the brittleness of a second or third stage and the infamous GRUB Rescue prompt. The user interface looks similar to rEFInd: both inherit from the abandoned boot manager [http://refit.sourceforge.net/ rEFIt]. Non-graphical alternatives: * [[systemd-boot]] β Light, UEFI-only boot manager with text-based OS selector menu. ==External links== {{Commons category}}{{Wikibooks|GRUB Installation After Windows Installation}} ===How-Tos and troubleshooting=== Distribution wikis have many solutions for common issues and custom setups that might help you: * [https://wiki.archlinux.org/index.php/GRUB Arch Linux /GRUB] * [https://help.ubuntu.com/community/Grub2#Links Ubuntu /Grub2] (also see Links at the bottom) * [[fedora:GRUB 2|Fedora /GRUB_2]] * [[gentoo:GRUB2|Gentoo /GRUB2]] * [http://wiki.rosalab.ru/en/index.php/Grub2_theme_tutorial Grub2 theme tutorial] ===Documentation=== * [https://www.gnu.org/software/grub/manual/grub/ GRUB manual] β most detailed documentation, including all commands * {{Official website}} * [https://web.archive.org/web/20101005232749/http://grub.enbug.org/ GRUB wiki archived in 2010] ===Introductory articles=== * [http://www.linuxjournal.com/article/4622 Boot with GRUB], an April 2001 article in [[Linux Journal]] ===Technicalities=== * [http://moi.vonos.net/linux/Booting_Linux_on_x86_with_Grub2/ Booting Linux on x86 using Grub2] β in-depth article * [[Unified Extensible Firmware Interface]] (UEFI firmware, common since 2012) * [[GUID Partition Table]] (GPT) β handles hard drives bigger than 2 [[TiB]] and more than 4 partitions * [[Master boot record]] used with [[BIOS|BIOS firmware]] (motherboards roughly before 2012) * [http://www.scs.stanford.edu/05au-cs240c/lab/specsbbs101.pdf BIOS Boot Specification Version 1.01 (January 11, 1996)] β hard to find ==See also== {{Portal|Free software}} * [[SYSLINUX|SysLinux (IsoLinux)]] β commonly used bootloader on CDs, DVDs * [[Windows Boot Manager|BOOTMGR]] β current Windows bootloader *[[NTLDR]] - previous Windows bootloader, used before [[Windows Vista]] *[[rEFInd]] - alternative boot loader for UEFI-based computers * [[Comparison of bootloaders]] {{Clear}} ==Notes== {{Notelist}} ==References== {{Reflist|30em}}{{GNU|state=collapsed}} {{Firmware and booting|state=collapsed}} [[Category:Free boot loaders]] [[Category:Free software primarily written in assembly language]] [[Category:Free software programmed in C]] [[Category:GNU Project software|GRUB]] [[Category:Research projects]] [[Category:1995 software]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Ambox
(
edit
)
Template:Anchor
(
edit
)
Template:As of
(
edit
)
Template:Cite mailing list
(
edit
)
Template:Cite web
(
edit
)
Template:Clear
(
edit
)
Template:Code
(
edit
)
Template:Commons category
(
edit
)
Template:Firmware and booting
(
edit
)
Template:GNU
(
edit
)
Template:GitHub
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Key press
(
edit
)
Template:Keypress
(
edit
)
Template:Main other
(
edit
)
Template:Notelist
(
edit
)
Template:Official website
(
edit
)
Template:Portal
(
edit
)
Template:Redirect2
(
edit
)
Template:Reflist
(
edit
)
Template:See also
(
edit
)
Template:Short description
(
edit
)
Template:Sister project
(
edit
)
Template:Snd
(
edit
)
Template:Technical
(
edit
)
Template:Template other
(
edit
)
Template:Use mdy dates
(
edit
)
Template:Webarchive
(
edit
)
Template:Wikibooks
(
edit
)