During remote access t o server with muti os, you may want to switch between different OS, it is impossible if you want to make it by manully select grub menus in this scenario, so cant this be achived? Of course No, you just use the grub-reboot command to make it, here we go.
first, please execute the command "sudo grub-reboot #NO", Which NO means the items you want to bootup in grub bootup menu.
for example
sudo grub-reboot 3
then reboot the system with command
sudo rebootThen you will find the items 3(start from item 0) system was seleted and taken as the default system to boot.

afther this, you will bootup the system you want, event if you are in a remote access.
在包含submenu的情境下,比如,要启动的系统在高级菜单里面,可以通过如下字符串的形式提供启动信息,可以通过执行如下命令:
sudo grub-reboot "Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-137-generic"注意,命令行参数要和/boot/grub/grub.cfg文件中的描述完全一致才可以。
sudo grub-reboot "Advanced options for Ubuntu>Ubuntu, with Linux 5.15.0-58-generic"
或则用数字序号代替,
sudo grub-reboot '1>6'
sudo reboot'1>6'前一个1代表主菜单的第一项入口,也就是Advanced options for Ubuntu,后面的6表示第子菜单的第六项启动,也就是我们选择的启动内核。主,子菜单序号都从0开始记。

在远程访问服务器时,如果需要在多重启动选项中切换操作系统,可以使用grub-reboot命令预设下次启动的GRUB菜单项。例如,输入sudogrub-reboot3或sudogrub-rebootAdvancedoptionsforUbuntu>Ubuntu,withLinux5.4.0-137-generic来选择特定的启动项。重启系统(sudoreboot)后,设置的选项将成为默认启动的系统。即使在有子菜单的情况下,如Advancedoptions,也可以通过指定主菜单和子菜单的序号(如1>6)来选择启动内核。
1276

被折叠的 条评论
为什么被折叠?



