GRUB 选择菜单可以工作,但不可见

GRUB 选择菜单可以工作,但不可见

我刚刚在 Thinkpad W541 上完成了 Manjaro/Windows10 双启动设置,但随后遇到了一个奇怪的问题。每当我启动系统时,它不会显示 GRUB 菜单,而是停留在 Lenovo 徽标处。不过,我可以确认 GRUB 确实在后台运行(尽管显示屏停留在 Lenovo 徽标上),因为我仍然可以用键盘与它交互。例如,如果我按“Enter”,它会直接启动到 Manjaro;如果我按“向下”键,然后按“Enter”,它将启动到 Windows 10。这表明 GRUB 正在运行,只是菜单界面没有显示。

我在网上查了一下,发现了一个链接,其他用户(使用其他发行版)也遇到了同样的问题。他们声称这是 GRUB 中的一个错误,但我有些怀疑,因为我在 Manjaro 的论坛上找不到类似的投诉。

以下是有关我的系统的简要信息:

在此输入图像描述

我还将包含 /etc/default/grub 文件的内容:

GRUB_DEFAULT=0
GRUB_TIMEOUT=60
GRUB_TIMEOUT_STYLE=menu
GRUB_DISTRIBUTOR="Manjaro"
GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor resume=UUID=2bc98e71-4074-46c4-9ac5-1211bafa25e6 udev.log_priority=3"
GRUB_CMDLINE_LINUX=""

# If you want to enable the save default function, uncomment the following
# line, and set GRUB_DEFAULT to saved.
GRUB_SAVEDEFAULT=true

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=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 'videoinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

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

# Uncomment this option to enable os-prober execution in the grub-mkconfig command
GRUB_DISABLE_OS_PROBER=false

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
GRUB_COLOR_NORMAL="light-gray/black"
GRUB_COLOR_HIGHLIGHT="green/black"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/usr/share/grub/background.png"
GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to ensure that the root filesystem is mounted read-only so that
# systemd-fsck can run the check automatically. We use 'fsck' by default, which
# needs 'rw' as boot parameter, to avoid delay in boot-time. 'fsck' needs to be
# removed from 'mkinitcpio.conf' to make 'systemd-fsck' work.
# See also Arch-Wiki: https://wiki.archlinux.org/index.php/Fsck#Boot_time_checking
#GRUB_ROOT_FS_RO=true

我对 Linux 还很陌生,所以如果有人能帮助我那就太好了。谢谢。

答案1

GRUB 似乎可能由于某种原因选择了错误的视频后端。

一个可能的原因仅适用于您的系统使用 UEFI 样式引导过程,因此如果/sys/firmware/efi/您的系统上不存在目录,则您将以旧版 BIOS 样式引导,并且此答案不适用于您。

但如果/sys/firmware/efi/您的系统上确实存在,那么您的系统将以 UEFI 方式启动。 UEFI曾经有两种图形编程接口:GOP和UGA。 UGA 是 UEFI 从较旧的 EFI 1.0 规范继承的,而 GOP 是 UEFI 的新规范。实际上,现在只有 Apple 设备将 UGA 与 UEFI 结合使用,而 UEFI 的所有其他用户都已在 GOP 上进行标准化。

(有关更多详细信息,请参阅SuperUser.SE 上的这个问题.)

如果您的系统似乎为引导加载程序提供了两种图形界面,但实际上只有其中一种可以工作,那么 GRUB 最终可能会选择错误的一种。

如果这是问题所在,您可以通过在文件末尾添加如下行来修复它/etc/default/grub

# Video backend
GRUB_VIDEO_BACKEND=efi_gop

然后运行grub-mkconfig -o /boot/grub/grub.cfg以更新位于 的主 GRUB 配置文件/boot/grub/grub.cfg

如果您想尝试UGA图形编程接口,可以替换efi_gop为。efi_uga

相关内容