Jump to content

GNU GRUB: Difference between revisions

From Official NixOS Wiki
Ibizaman (talk | contribs)
m Add link to disko setup for a bios partition on GPT.
AP767 (talk | contribs)
Added Usage section, and a definition of what GNU GRUB is.
Line 1: Line 1:
{{expansion}}
{{expansion}}[https://www.gnu.org/software/grub/ GNU GRUB] , also known as the Grand Unified Bootlader, is a multiboot bootloader created and maintained by GNU. It is a non UEFI alternative to systemd-boot.
 
== Usage ==
To install and enable GRUB on UEFI systems, add this to your system configuration:
{{File|3=<nowiki>
boot.loader.grub = {
  enable = true;
  device = "nodev"; # "nodev" is used for UEFI
  efiSupport = true;
};
</nowiki>|name=/etc/nixos/configuration.nix|lang=nix}}
Alternatively, to install and enable GRUB on Legacy BIOS systems, add this to your system configuration:
{{File|3=<nowiki>
boot.loader.grub = {
  enable = true;
  device = "/dev/sda"; #replace with the drive intended for boot
};|name=/etc/nixos/configuration.nix|lang=nix}}
For additional GRUB module configuration options, refer to [https://search.nixos.org/options?channel=25.11&query=boot.loader.grub boot.loader.grub.]


== FAQ ==
== FAQ ==

Revision as of 20:11, 17 February 2026

☶︎
This article or section needs to be expanded. Further information may be found in the related discussion page. Please consult the pedia article metapage for guidelines on contributing.

GNU GRUB , also known as the Grand Unified Bootlader, is a multiboot bootloader created and maintained by GNU. It is a non UEFI alternative to systemd-boot.

Usage

To install and enable GRUB on UEFI systems, add this to your system configuration:

❄︎ /etc/nixos/configuration.nix
boot.loader.grub = {
  enable = true;
  device = "nodev"; # "nodev" is used for UEFI
  efiSupport = true;
};

Alternatively, to install and enable GRUB on Legacy BIOS systems, add this to your system configuration:

❄︎ /etc/nixos/configuration.nix
<nowiki>
boot.loader.grub = {
  enable = true;
  device = "/dev/sda"; #replace with the drive intended for boot
};

For additional GRUB module configuration options, refer to boot.loader.grub.

FAQ

→ See Bootloader#FAQ as those questions also applies to GRUB.

this GPT partition label contains no BIOS Boot Partition

This error is caused by using grub for legacy boot with a disk formatted as GPT[1].

This can be fixed either by:

☶︎
This article or section needs to be expanded. Further information may be found in the related discussion page. Please consult the pedia article metapage for guidelines on contributing.

How do I use GRUB in text mode?

Sometimes you need to access GRUB in text mode (e.g. when using out of band management systems like HP ILO in "textcons" mode).

To use GRUB in text mode there are two settings that need to be configured depending on whether you use EFI or BIOS boot:

boot.loader.grub.gfxmodeEfi= "text";
boot.loader.grub.gfxmodeBios= "text";

Only disabling the GRUB splash screen via boot.loader.grub.splashImage = null; results in a similar output but that is not the real text only mode.