LinuxCommandLibrary

grub-mkconfig

TLDR

Print configuration to stdout (dry run)

$ sudo grub-mkconfig
copy
Generate configuration to file
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
copy
Display help
$ grub-mkconfig --help
copy
Display version
$ grub-mkconfig --version
copy

SYNOPSIS

grub-mkconfig [OPTION]

DESCRIPTION

grub-mkconfig generates a GRUB bootloader configuration file by processing system settings and detecting installed operating systems. It is typically used after kernel updates or when modifying boot parameters.

PARAMETERS

-o, --output=FILE

Write the generated configuration to FILE instead of stdout
-h, --help
Display help message and exit
-V, --version
Display version information and exit

CAVEATS

This command should be run as root. The generated configuration depends on scripts in /etc/grub.d/ and settings in /etc/default/grub. After making changes to GRUB settings, always run grub-mkconfig to regenerate the configuration.

HISTORY

grub-mkconfig is part of GRUB 2 (GRand Unified Bootloader), which replaced the original GRUB Legacy. It provides automatic detection of installed kernels and operating systems.

SEE ALSO

Copied to clipboard