Linux command
grub-reboot 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Example
sudo grub-reboot [entry_number]
Example
sudo grub-reboot --boot-directory=/[path/to/boot_directory] [entry_number]
Example
sudo grub-reboot "[submenu_title]>[entry_title]"
说明
grub-reboot sets the default boot entry for the next boot only. After booting once, GRUB reverts to the permanent default set by grub-set-default or the configuration file. The entry can be specified as a number (0 for first entry), the full entry name from grub.cfg, or a menu entry identifier. For entries within submenus, use the greater-than character (>) to separate the submenu title and the entry title, with no extra spaces (e.g., "Advanced options>Ubuntu, with Linux 5.15"). Use grep menuentry /boot/grub/grub.cfg to see available entries. This is useful for one-time boots into recovery mode, alternative kernels, or other operating systems without permanently changing the boot order.
参数
- --boot-directory=_DIR_
- Find GRUB images under DIR/grub instead of the default /boot/grub.
- -h, --help
- Print help message and exit.
- -V, --version
- Print version information and exit.
- -v, --verbose
- Print verbose messages.
FAQ
What is the grub-reboot command used for?
grub-reboot sets the default boot entry for the next boot only. After booting once, GRUB reverts to the permanent default set by grub-set-default or the configuration file. The entry can be specified as a number (0 for first entry), the full entry name from grub.cfg, or a menu entry identifier. For entries within submenus, use the greater-than character (>) to separate the submenu title and the entry title, with no extra spaces (e.g., "Advanced options>Ubuntu, with Linux 5.15"). Use grep menuentry /boot/grub/grub.cfg to see available entries. This is useful for one-time boots into recovery mode, alternative kernels, or other operating systems without permanently changing the boot order.
How do I run a basic grub-reboot example?
Run `sudo grub-reboot [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-reboot?
Find GRUB images under DIR/grub instead of the default /boot/grub.