Talk:GNU GRUB

GRUB 2 has no stages
The chapter Version 2 (GRUB) claims that there are stage 1, stage 1.5, and stage 2 in GRUB2. However, according to a short list from the GRUB 2 manual that sums up the changes between grub legacy and grub 2, "The image files (see Images) that make up GRUB have been reorganised; Stage 1, Stage 1.5, and Stage 2 are no more". --195.37.142.74 (talk) 13:33, 12 January 2019 (UTC)

—

Grub2 has very similar stages as Grub v1. Some parts were moved around, but the assembler code of early stages is mostly the same. While Grub v1 had a documented process of, Grub2's process is not documented in such detail. Reading the code reveals the Grub v1 stages can be mapped roughly to:

Grub v1 and 2 also has 4 stages, but named in a different way. The stages are different in the way they load the next stage. 1st stage looks for 2nd stage in *one* fixed LBA sector. 2nd stage loads 3rd from *more* fixed LBA sectors (called a blocklist in Grub documentation, or extents in recent filesystems). 3rd stage loads 4th, and the config from a file record identified by partition number and file name.

The 1st and 2nd stages are necessary because the Legacy BIOS boot process has too little space (one sector) for a filesystem driver written in C. Even the blocklist of the 3rd stage did not fit in the 1st stage, making 2nd stage necessary. These stages expect that the next stage is not moved on the disk. If it's relocated, then the boot will fail without error message printed. This is why Grub2 discourages the use of blocklists in partitions, where defragmenting can move blocks. 3rd stage has just enough space for the necessary filesystem driver(s) to load modules and the config. Note that 3rd stage can also fail if the partition's index containing the modules is changed. This happens unexpectedly if it's a logical partition and another logical partition before it is removed.

This process is much simpler and safer on UEFI systems:. No need for the crammed and fragile early stages.

— Mongusius (talk) 14:32, 30 March 2019 (UTC)

GRUB BOOT made clearer
GRUB version 1

The MBR on a hard drive is small (512 bytes) and contains enough machine code to can chain boot GRUB stage 1 from another boot sector such as a partition's volume boot record. Given the small size of a boot sector, 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 1024 cylinders). Bootloaders other than GRUB can be placed in the MBR, such as LILO,boot0,EFI.

Stage 1 can load Stage 2 directly, but it is normally set up to load Stage 1.5. GRUB Stage 1.5 is located in the first 30 kilobytes of hard disk immediately following the MBR and before the first partition. If this space is not available (Unusual partition table, special disk drivers, GPT or LVM disk) the install of Stage 1.5 will fail. The stage 1.5 image contains filesystem specific drivers. This enables stage 1.5 to directly load stage 2 from a known location in the filesystem, for example from /boot/grub. Stage 2 will then load the default configuration file and any other modules needed.

Chaney44145 (talk) 13:29, 25 July 2012 (UTC)

Category "Research project"??
Is that adequate? —Preceding unsigned comment added by 87.174.124.55 (talk) 02:53, 31 May 2010 (UTC)

GRUB version 1
It would be worth noting that usually stage 2 is located under /boot/grub, and simply named "stage2". We know where stage 1 is (MBR), we know stage 1.5 (within the first 63 sectors), but not stage 2. — Preceding unsigned comment added by Raghu Udiyar (talk • contribs) 09:51, 9 November 2011 (UTC)

GRUB vs. GRUB2
The external link to the GRUB2 home page appears broken. From what I can see, the primary GRUB home page now refers to GRUB2. The older version is called "GRUB Legacy". I propose adjusting the external links, though this may imply more significant changes to the article as a whole. Eric Petrich (talk) 18:12, 11 June 2010 (UTC)

I suggest merging "Development" with "History" in some fashion. Also, for the section on "major distributions", Arch Linux has dropped Grub Legacy and made Grub2 officially supported, though it is only one option with Syslinux. Umma Kynes 08:08, 25 August 2012 (UTC)

GRUB kernel type
I came here after microkernel article said Grub was a microkernel(???). Send me a note if there is any truth to that. I think they mistook Grub for Hurd which sound alike(?). GRUB is an IBM PC BIOS Interrupt 13 based bootloader, as described by the "bootsector" analogy. From late 1990's on Interrupt 19 service were expected to be supported for boot services. GRUB wiki complain that an EFI compatible Grub can't be created because of Microsoft FAT licensing. However EFI specs do not require FAT to install an OS, but Microsoft does require FAT EFI loader to load Windows/DOS. See http://www.intel.com/content/www/us/en/architecture-and-technology/unified-extensible-firmware-interface/efi-specifications-general-technology.html (from http://msdn.microsoft.com/en-us/library/windows/hardware/gg463075 ). Shjacks45 (talk) 21:50, 16 March 2012 (UTC)

—

Grub (v1 and 2 too) is more comparable to a Unikernel: it runs only in Ring 0, and there is no userspace implemented. It's also similar to Monolithic kernels: modules (hardware, network and filesystem drivers, the OS loaders and even the Grub menu) are loaded to the same address space as the kernel, like modules in the Linux Kernel. Note that Grub was not designed as an Operating system, but a bootloader, that needed a few operating system features to be able to accomplish its task, therefore it has no "official" categorization.

To distinguishing common kernel types:
 * Microkernels (Minix, Redox) run their drivers with less privileges in Protection ring 1-3, than the kernel itself in Ring 0, and the memory area (address space) they can write to is separated, thereby protecting the kernel from driver anomalies.
 * Monolithic kernels (Linux, Windows) run drivers in the most privileged Ring 0 and separate user programs in Ring 3.
 * Unikernels (aka. Library OSes) (IncludeOS, OSv, MirageOS) run even user programs in the same memory address space and Protection ring as the kernel (Ring 0, but this might change in the future).

— Mongusius (talk) 13:43, 30 March 2019 (UTC)

Grub picture is obsolete?
Newly installed modern grub shows some welcome text and then the prompt "grub>". So is this picture in the article showing the menu obsolete? Yurivict (talk) 07:12, 15 September 2012 (UTC)

You haven't defined a menu yet. If "grub.cfg" is present, and defines a boot menu, you get something similar to the screen shot. Imaginos1892 October 9 2012 — Preceding unsigned comment added by 72.37.244.20 (talk) 20:14, 9 October 2012 (UTC)

grub1 config location
GRUB's config is menu.lst as is written in it's sources. grub.conf is often connected as a symlink to menu.lst, this causes some problems in situations when link breaks whuch may result in either broken grub config or with two config files without obvious specification which one is actually used. — Preceding unsigned comment added by 84.47.144.106 (talk) 06:38, 31 January 2013 (UTC)

Grub version used in Ubuntu 10.04?

 * Grub version 1 is still fairly prevalent in older -- but still supported -- releases, e.g., Ubuntu 10.04, CentOS 5.

According to this page, Grub2 has been the default for Ubuntu since Karmic (9.10) - 173.180.59.229 (talk) 01:16, 4 March 2013 (UTC)

Merge from Boot Repair Disk
I'm proposing that Boot Repair Disk be merged into this article. I don't think it warrants its own article, although it seems sufficiently notable to be mentioned alongside the mention of boot-repair (the package that's the entire purpose of the disk) in the "Other utilities" section of GNU GRUB. —me_and 11:07, 2 April 2013 (UTC)


 * Boot-repair-disk can also repair MsWindows-bootloading problems. It's not focused solely on grub and fits very well to be listed with other boot tools, such as on http://en.wikipedia.org/wiki/List_of_live_CDs . Grub is not a tool by design and wouldn't be able to be referenced as a fixable boot-tool. It would be awkward to list this tool from a grub sub-section via list_of_live_cds. I believe it can be mentioned of from the grub wikipage because there's a strong correlation, but the boot-repair-disk can also fix non-grub problems. Swestlake (talk) 06:45, 3 April 2013 (UTC)


 * Agreed, it wouldn't be that great to merge Boot Repair Disk into the section. &mdash; Dsimic (talk | contribs) 20:11, 18 November 2014 (UTC)

External links modified
Hello fellow Wikipedians,

I have just modified 3 external links on GNU GRUB. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
 * Corrected formatting/usage for https://www.gnu.org/software/grub/grub-2.en.html
 * Added archive https://web.archive.org/web/20110719115732/http://dlc.sun.com/osol/docs/content/SYSADV1/getov.html to http://dlc.sun.com/osol/docs/content/SYSADV1/getov.html
 * Added archive https://web.archive.org/web/20091021160244/http://docs.sun.com/app/docs/doc/819-2379/getnk?a=view to http://docs.sun.com/app/docs/doc/819-2379/getnk?a=view

When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.

Cheers.— InternetArchiveBot  (Report bug) 21:12, 14 September 2017 (UTC)

External links modified
Hello fellow Wikipedians,

I have just modified 3 external links on GNU GRUB. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
 * Added archive https://web.archive.org/web/20120920065446/http://en.opensuse.org/openSUSE%3AUpcoming_features to http://en.opensuse.org/openSUSE%3AUpcoming_features
 * Added archive https://web.archive.org/web/20110107003333/http://web.syllable.org/documentation/FAQ.html to http://web.syllable.org/documentation/FAQ.html
 * Added archive https://web.archive.org/web/20110204004710/http://gna.org/projects/grubutil to http://gna.org/projects/grubutil/

When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.

Cheers.— InternetArchiveBot  (Report bug) 16:23, 9 October 2017 (UTC)

External links modified
Hello fellow Wikipedians,

I have just modified one external link on GNU GRUB. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
 * Added archive https://web.archive.org/web/20121028160701/http://www.webjunction.org/documents/webjunction/An_Introduction_to_Ubuntu.html to http://www.webjunction.org/documents/webjunction/An_Introduction_to_Ubuntu.html

When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.

Cheers.— InternetArchiveBot  (Report bug) 13:25, 9 December 2017 (UTC)

Bloat in booting section?
There's a lot of info in the section about booting that feels like it should really be linked to the original pages, instead of placed on this page. What do my fellow wikipedians think? 180.66.165.245 (talk) 14:59, 21 July 2018 (UTC)

Indeed it's out-of-place here. Imo Grub needs its own wiki, where all this information can be shared, but the homepage is not equipped for this purpose. The only alternative, distribution wikis have a lot of information, but mostly practical (command lines) and geared towards the distro, while the information on this page is analytical. I haven't found a better, established alternative. Anyway, I've added direct links to 4 distro wiki pages with the most useful information to section "How-Tos and troubleshooting". — Mongusius (talk) 18:57, 30 March 2019 (UTC)

Version zero vs version one
Either this article is incorrect, or there should be some clarification whether Grub Legacy is known as both "version zero" and "version one".

"Two major versions of GRUB are in common use: GRUB version 1, called GRUB legacy, ..."

Two sentences later...

Section: "Version 0 (GRUB Legacy)"

...later in the article...

"GRUB version 1 (also known as "GRUB Legacy") is no longer under development and is being phased out" Gwideman (talk) 07:19, 4 August 2019 (UTC)

talk about grub crypto module, coreboot payload, etc
grub can do a lot more than most people think, it has lots of filesystem drivers and can run on bare metal as a coreboot payload in some cases.

also things like built-in crypto: LUKSv1 and v2(newer key deriv not supported at present), GPG signature verification(to an extent) etc.

For example Debian has this guide: https://cryptsetup-team.pages.debian.net/cryptsetup/encrypted-boot.html

Might be useful as a stub within the article, perhaps referencing the coreboot article. Libreleah (talk) 04:58, 23 June 2023 (UTC)

Moved "GNU operating system" to talk
I moved this sentence to talk: "The GNU operating system uses GNU GRUB as its boot loader, as do most Linux distributions and the Solaris operating system on x86 systems, starting with the Solaris 10 1/06 release." 1) GNU is a set of packages, not an operating system. 2) The prior sentence is sufficient. The prior sentence says, "It is predominantly used for Unix-like systems." Timhowardriley (talk) 05:09, 18 July 2023 (UTC)