LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

grub-mkconfig

generate GRUB bootloader configuration file

TLDR

Print configuration to stdout (dry run)
$ sudo grub-mkconfig
copy
Generate configuration and write to the default file
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
copy
Generate configuration on Red Hat/Fedora systems
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
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.The command reads settings from /etc/default/grub and executes scripts in /etc/grub.d/ to produce the final grub.cfg file.

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

CONFIGURATION

/etc/default/grub

Main settings file controlling timeout, default entry, kernel parameters, and display options.
/etc/grub.d/
Directory of scripts executed during configuration generation. Custom boot entries can be added here.

INSTALL

sudo apt install grub-common
copy
sudo pacman -S grub
copy
sudo apk add grub
copy

CAVEATS

This command must 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. On Red Hat/Fedora, the command is named grub2-mkconfig and the config path is /boot/grub2/grub.cfg. On Debian/Ubuntu, update-grub is a convenient wrapper around grub-mkconfig.

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

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid