Linux command
grub-set-default 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Example
sudo grub-set-default [entry_number]
Example
sudo grub-set-default --boot-directory /[path/to/boot_directory] [entry_number]
说明
grub-set-default sets the permanent default boot entry for GRUB. Unlike grub-reboot, this setting persists across all subsequent boots until changed. The entry can be specified as a number (0 for first entry), the full entry name from grub.cfg, or a menu entry identifier. Submenu entries use notation like "1>2" for the third item in the second submenu.
参数
- --boot-directory _DIR_
- Use alternative boot directory instead of /boot
FAQ
What is the grub-set-default command used for?
grub-set-default sets the permanent default boot entry for GRUB. Unlike grub-reboot, this setting persists across all subsequent boots until changed. The entry can be specified as a number (0 for first entry), the full entry name from grub.cfg, or a menu entry identifier. Submenu entries use notation like "1>2" for the third item in the second submenu.
How do I run a basic grub-set-default example?
Run `sudo grub-set-default [entry_number]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --boot-directory _DIR_ do in grub-set-default?
Use alternative boot directory instead of /boot