启动时跳过 Grub

启动时跳过 Grub

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

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

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

我该如何恢复旧的启动顺序?我真的不想断开我的 Deepin 磁盘。

看完之后这个问题我更改了文件中的某些内容/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"

然后运行sudo update-grub没有问题。但是启动时仍会出现 grub 菜单和 10 秒超时。

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

分区 - 挂载点 - 标志

/dev/sda1 - - bios_grub

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

/dev/sda3 - / -

/dev/sda4 - /home -

/dev/sda5 - swap -

答案1

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

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

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

GRUB_DISABLE_OS_PROBER=true

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

sudo chmod a-x /etc/grub.d/30_os-prober

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

答案2

通常情况下,如果您只运行一个操作系统,该选项GRUB_TIMEOUT=0就会起作用。如果 GRUB 2 的 os-prober 在运行脚本时识别出其他操作系统,则隐藏菜单超时功能会被条件语句禁用。这还会禁用在启动期间使用该键显示菜单的/etc/grub.d/30_os-prober功能。Shift

相关内容