如何在不删除 Ubuntu 的情况下从双启动中删除启动时的 Grub?

如何在不删除 Ubuntu 的情况下从双启动中删除启动时的 Grub?

我使用 Windows 11 PC 双启动了 ubuntu,但我不想每次打开 PC 时都显示 grub 屏幕并询问我的操作系统选择,因为我希望它直接启动到 Windows,但在需要时,我可以在系统启动时按 F9 进入启动选项并运行 ubuntu。可能吗?

答案1

然后,在 /etc/default/grub 中更改这些设置sudo update-grub

截取自info -f grub...

'GRUB_DEFAULT'

 The default menu entry.  This may be a number, in which case it
 identifies the Nth entry in the generated menu counted from zero,
 or the title of a menu entry, or the special string 'saved'.  Using
 the id may be useful if you want to set a menu entry as the default
 even though there may be a variable number of entries before it.

 For example, if you have:

 menuentry 'Example GNU/Linux distribution' --class gnu-linux --id example-gnu-linux {
    ...
 }

 then you can make this the default using:

      GRUB_DEFAULT=example-gnu-linux

 Previously it was documented the way to use entry title.  While
 this still works it's not recommended since titles often contain
 unstable device names and may be translated

 If you set this to 'saved', then the default menu entry will be
 that saved by 'GRUB_SAVEDEFAULT' or 'grub-set-default'.  This
 relies on the environment block, which may not be available in all
 situations (*note Environment block::).

 The default is '0'.

'GRUB_SAVEDEFAULT'

 If this option is set to 'true', then, when an entry is selected,
 save it as a new default entry for use by future runs of GRUB. This
 is only useful if 'GRUB_DEFAULT=saved'; it is a separate option
 because 'GRUB_DEFAULT=saved' is useful without this option, in
 conjunction with 'grub-set-default'.  Unset by default.  This
 option relies on the environment block, which may not be available
 in all situations (*note Environment block::).

‘GRUB_TIMEOUT’

 Boot the default entry this many seconds after the menu is
 displayed, unless a key is pressed.  The default is '5'.  Set to
 '0' to boot immediately without displaying the menu, or to '-1' to
 wait indefinitely.

 If 'GRUB_TIMEOUT_STYLE' is set to 'countdown' or 'hidden', the
 timeout is instead counted before the menu is displayed.

'GRUB_TIMEOUT_STYLE'

 If this option is unset or set to 'menu', then GRUB will display
 the menu and then wait for the timeout set by 'GRUB_TIMEOUT' to
 expire before booting the default entry.  Pressing a key interrupts
 the timeout.

 If this option is set to 'countdown' or 'hidden', then, before
 displaying the menu, GRUB will wait for the timeout set by
 'GRUB_TIMEOUT' to expire.  If <ESC> is pressed during that time, it
 will display the menu and wait for input.  If a hotkey associated
 with a menu entry is pressed, it will boot the associated menu
 entry immediately.  If the timeout expires before either of these
 happens, it will boot the default entry.  In the 'countdown' case,
 it will show a one-line indication of the remaining time.

相关内容