grub

GRand Unified Bootloader for Linux systems

TLDR

Install GRUB to disk
$ sudo grub-install /dev/sda
Update GRUB configuration (Debian/Ubuntu)
$ sudo update-grub
Generate config file directly
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
Set the default boot entry
$ sudo grub-set-default 0
Check GRUB version
$ grub-install --version

SYNOPSIS

grub-install [options] devicegrub-mkconfig [-o file]

DESCRIPTION

GRUB (GRand Unified Bootloader) is the standard bootloader for Linux systems. It loads the kernel and initrd, presenting a boot menu for system selection.GRUB 2 supports multiple filesystems, LVM, RAID, and encrypted partitions. It provides rescue mode for system recovery and scripting for advanced configurations.Unlike GRUB Legacy, GRUB 2 has no single unified grub command; its functionality is split across separate utilities such as grub-install, grub-mkconfig, grub-set-default, and grub-editenv. An interactive GRUB command line is available from the boot menu itself (press c), not from a running Linux shell.

PARAMETERS

--root-directory DIR

Install to alternate root.
--boot-directory DIR
Boot directory location.
--target TARGET
Target platform.
--recheck
Probe devices again.
--removable
Install for removable media.
--help
Display help information.

CONFIGURATION

/etc/default/grub

Main GRUB configuration file controlling default boot entry, timeout, kernel parameters, and display settings.
/etc/grub.d/
Directory containing scripts that generate the grub.cfg file. Custom entries can be added here.
/boot/grub/grub.cfg
Generated configuration file. Do not edit directly; use grub-mkconfig to regenerate.

INSTALL

sudo pacman -S grub

CAVEATS

Misconfiguration can prevent booting. Keep rescue media available. GRUB 2 differs from legacy GRUB.

HISTORY

GRUB was created as part of the GNU Project. GRUB 2 was released in 2002 as a complete rewrite with enhanced features.

SEE ALSO

grub-mkconfig(8), update-grub(8), grub-install(8)

RESOURCES

Homepage · Source code · Documentation