重新安装 grub 后始终显示 grub 命令行

重新安装 grub 后始终显示 grub 命令行

我有两个硬盘,一个装有 Windows 10,另一个装有 Ubuntu(20.04)。Ubuntu 硬盘使用 LVM 进行全盘加密。

我发现的问题是,每次我尝试启动 Ubuntu 磁盘时,都会跳转到 grub 命令行。我知道如何启动它,但每次我想切换操作系统时都必须这样做,这很烦人。我已经尝试过sudo update-grub2或尝试删除并重新安装 grub。我仍然得到完全相同的错误。

在网上浏览后,我偶然发现了一个boot-repair工具,希望它能解决我的问题,但最终它仍然不能像我预期的那样正常工作。这是来自boot-repair https://paste.ubuntu.com/p/wthpKpVRyV/

这些是我的文件的内容/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_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="rhgb quiet splash acpi_enforce_resources=lax pcie_ports=compat"
GRUB_CMDLINE_LINUX=""

# 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"

答案1

我建议您添加这些行;
打开终端并输入sudo nano /etc/default/grub或使用 gedit。GRUB_DEFAULT
=0
#GRUB_DEFAULT=saved
#GRUB_SAVEDEFAULT=true
#GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
为 CMDLINE 添加此行,但这只是推测,在成功启动几次后,您可以将其改回来。因此,只需用 # 注释掉,而不是删除任何行。如果您在后面发现更多信息,您还可以调整此 grub 文件。
#GRUB_CMDLINE_LINUX_DEFAULT="安静启动"
GRUB_CMDLINE_LINUX_DEFAULT="rhgb 安静启动 acpi_enforce_resources=lax pcie_ports=compat"
GRUB_CMDLINE_LINUX=""
并取消注释此行;
GRUB_TERMINAL=控制台
使用相同的文件名保存(在 nano 中使用 Ctrl+O)
保存后,请确保更新 grub,否则不会发生任何事情!
输入sudo update-grub,这将生成一个新的 cfg 文件。
输入sudo shutdown -r now并报告结果。
注意:如果此答案不完整,这将使您启动到 grub 菜单,这将有助于诊断问题。之后您可以随时将其改回。

相关内容