启动时跳过 Grub

eri*_*ani 9 boot grub2 dual-boot uefi

我在 UEFI 机器的空磁盘中安装了 Ubuntu,并且在上周的软件更新之前一直直接启动,没有任何菜单或超时。我想保持启动简单,就像以前一样。

我所做的相关更改是将带有旧 Linux Deepin 安装的磁盘从我卖到装有 Ubuntu 的同一台机器上的 PC 上移动。所以现在我在同一台 PC 上有 2 个磁盘。

当然,在启动时,我现在有一个 grub 菜单可以在 Ubuntu 和 Deepin 之间进行选择。我不需要这个菜单,因为我总是使用 Ubuntu,深度磁盘有自己的 grub,我可以从 BIOS 选项中选择要启动的磁盘。

我如何回到旧的启动顺序?我真的不想断开我的深度磁盘。

阅读完这个问题后,我更改了/etc/default/grub文件中的一些内容,现在看起来像这样:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="noprompt"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
Run Code Online (Sandbox Code Playgroud)

然后就sudo update-grub没有问题的跑了。但是 grub 菜单和 10 秒超时在启动时仍然存在。

在 Ubuntu 磁盘上发布分区可能是相关的,因为不是默认设置:

分区 - 挂载点 - 标志

/dev/sda1 - - bios_grub

/dev/sda2 - /boot/efi - boot,esp

/dev/sda3 - / -

/dev/sda4 - /home -

/dev/sda5 - swap -

old*_*red 9

如果出于任何原因您只想要 Ubuntu,您可以关闭 os-prober。如果需要,将您自己的条目添加到 40_custom,但是 grub 会再次出现。

如果其他安装未找到菜单只有 grub,应该直接启动。

将此添加到 /etc/default/grub:

GRUB_DISABLE_OS_PROBER=true
Run Code Online (Sandbox Code Playgroud)

或关闭 os-prober 上的执行位:

sudo chmod a-x /etc/grub.d/30_os-prober
Run Code Online (Sandbox Code Playgroud)

然后再次运行更新 grub sudo update-grub