系统仅启动到 grub 提示符

系统仅启动到 grub 提示符

Ubuntu 20.10
计算机启动到 grub 提示符。我可以像这样手动启动我的操作系统,没问题:

grub> linux (hd0,gpt2)/boot/vmlinuz-5.8.0-33-generic root=/dev/sda2
grub> initrd (hd0,gpt2)/boot/initrd.img-5.8.0-33-generic
grub> boot

而且它马上就启动了(我现在就在上面)。我无论如何也想不起来如何让它自动启动。我也不确定它为什么一开始就停止工作了。

我尝试了启动修复工具,但没有效果。

这是 /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=10
GRUB_DEFAULT=1
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

#GRUB_DISABLE_OS_PROBER=true
# 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

这解决了 grub.cfg 中的问题并消除了搜索错误:

menuentry "Kubuntu" {
          insmod part_gpt
          insmod fat
          set root='hd0,gpt2'
          linux /boot/vmlinuz-5.8.0-33-generic root=UUID=79ff29a1-eb9c-4463-a39c-77b98c1a97f5 rw
          initrd /boot/initrd.img-5.8.0-33-generic
}

我也从中得到了答案14.04 升级触发 grub-pc 故障使用 Rossiar 的答案来获得一个很好的干净重置,所以实际上,这是最好的答案:

sudo apt-get purge grub-pc grub-common
sudo rm -r /etc/grub.d/
sudo apt-get install grub-pc grub-common
sudo grub-install /dev/sda
sudo update-grub

我还发现了一个可以更轻松地修改 grub 的东西,只要你按照自己喜欢的方式设置它。这是一个名为 Grub Customizer 的 GUI 程序。软件包安装 ->apt install grub-customizer

快速简便的教程在这里:https://itsfoss.com/customize-grub-linux/

相关内容