Forrest logo
back to the grub-mkconfig tool

grub-mkconfig:tldr:b71d4

grub-mkconfig: Do a dry run and print the configuration to `stdout`.
$ sudo grub-mkconfig
try on your machine

The "sudo grub-mkconfig" command is used to generate the configuration file for the GRUB (GRand Unified Bootloader) boot loader in Unix-like operating systems.

When you run this command with root privileges ("sudo"), it scans the system's partitions and identifies the installed operating systems and their kernel images. It also reads the system's "grub.d" directory, which contains scripts that customize the GRUB configuration.

Using this information, "grub-mkconfig" generates a new configuration file called "grub.cfg" in the "/boot/grub" directory. This file is read by GRUB during the boot process and determines the available operating systems and the boot options for each.

The "sudo grub-mkconfig" command is often used after installing a new operating system or making changes to the system's partition layout, kernel configuration, or boot options. It ensures that the GRUB bootloader is aware of these changes and can correctly load the selected operating system at boot time.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the grub-mkconfig tool