LinuxCommandLibrary

grub

GRand Unified Bootloader for Linux systems

TLDR

Enter GRUB shell

$ sudo grub
copy
Install GRUB to disk
$ sudo grub-install /dev/sda
copy
Update GRUB configuration
$ sudo update-grub
copy
Generate config file
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
copy
Check GRUB version
$ grub-install --version
copy

SYNOPSIS

grub [options]
grub-install [options] device

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.

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.

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

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community