首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ubuntu 20.04在更新后将Ubuntu 20.04引导到grub终端,无法用update-grub永久修复

Ubuntu 20.04在更新后将Ubuntu 20.04引导到grub终端,无法用update-grub永久修复
EN

Ask Ubuntu用户
提问于 2020-08-26 05:57:30
回答 2查看 3.5K关注 0票数 1

更新后,Ubuntu20.04启动到grub终端。通过遵循下面的解决方案,我能够恢复登录,但是每次重新启动时,我都会得到grub终端。

我按照这个视频https://youtu.be/r7meKJsjqfY中的说明让我重新启动并运行,但是最后的步骤update-grub (我也尝试了grub-mkconfig /boot/grub/grub.cfg)不会永久地修复这个问题。每次重新启动我都会得到grub终端。

到目前为止我的解决方案..。

代码语言:javascript
复制
ls (hd1,gpt2)/ls (hd0,gpt2) <-----(this changes with/without external drive *)
set root=(hd1,gpt2)
linux /boot/vmlinuz root=/dev/sda2
initrd /boot/initrd.img
boot

(我尝试设置linux /boot/vmlinuz-5.4.0-40泛型和linux /boot/vmlinuz-5.4.0-42泛型,并使用相应的IMG文件)

重新启动后,打开终端。我都试过了..。

sudo update-grub

grub-mkconfig /boot/grub/grub.cfg

输出..。

代码语言:javascript
复制
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-42-generic
Found initrd image: /boot/initrd.img-5.4.0-42-generic
Found linux image: /boot/vmlinuz-5.4.0-40-generic
Found initrd image: /boot/initrd.img-5.4.0-40-generic
Adding boot menu entry for UEFI Firmware Settings
done

我还需要做什么吗?(我是linux新手,所以文档和其他解决方案感觉相当冗长,并且没有真正描述我的问题--至少我觉得自己接近解决方案,忽略了显而易见的问题)

这是我的grub文件

cat /etc/default/grub/

代码语言:javascript
复制
# 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=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
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"

cat /etc/default/grub.d/init-select.cfg

代码语言:javascript
复制
# Work around a bug in the obsolete init-select package which broke
# grub-mkconfig when init-select was removed but not purged.  This file does
# nothing and will be removed in a later release.
#
# See:
#   https://bugs.debian.org/858528
#   https://bugs.debian.org/863801

lsb_release -a

代码语言:javascript
复制
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal
  • 更多信息..。

如果我在grub终端中使用或不使用外部驱动器引导ls,则会看到根驱动器的不同标签。

代码语言:javascript
复制
(proc) (hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,gpt2) (hd1,gpt1) (cd0)

无外部驱动

代码语言:javascript
复制
(proc) (hd0) (hd0,gpt2) (hd0,gpt1) (cd0)
EN

回答 2

Ask Ubuntu用户

回答已采纳

发布于 2020-08-26 17:36:44

你有一个MBR驱动器和一个gpt驱动器?UEFI应该是第一步。

让我们看详细情况,使用ppa版本与您的实时安装程序(第二个选项)或任何工作安装,而不是旧的启动-修复ISO:请复制和粘贴pastebin链接到Boot摘要报告(不要发布报告),不要运行自动修复,直到审查。

https://help.ubuntu.com/community/Boot-Repair

https://sourceforge.net/p/boot-repair/home/Home/

如果是UEFI,则MBR中不应该有引导加载程序,因为所有的引导文件都在efi系统分区中。MBR可以用于旧的BIOS引导,但如果UEFI系统不能使用MBR。

MBR只对一个分区条目存在gpt,说明驱动器是gpt,所以旧的分区工具不会尝试将驱动器重新划分到MBR,并破坏它。

票数 1
EN

Ask Ubuntu用户

发布于 2020-08-26 06:47:01

我会尝试用以下方式重新创建initramfs:

代码语言:javascript
复制
sudo update-initramfs -c -k 5.4.0-42-generic

然后是sudo update-grub和重新启动。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1270168

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档