Linux command
grub-mkconfig 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Example
sudo grub-mkconfig
Example
sudo grub-mkconfig -o /boot/grub/grub.cfg
Example
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Example
grub-mkconfig --version
说明
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.
参数
- -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
FAQ
What is the grub-mkconfig command used for?
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.
How do I run a basic grub-mkconfig example?
Run `sudo grub-mkconfig` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -o, --output=FILE do in grub-mkconfig?
Write the generated configuration to FILE instead of stdout