我在 Ubuntu 20.04/Windows 10 双启动时出现黑屏,只能在恢复模式下启动

我在 Ubuntu 20.04/Windows 10 双启动时出现黑屏,只能在恢复模式下启动

使用 Ubuntu 20.04 / Windows 10 双启动时出现黑屏。Windows 10 启动正常,但 Ubuntu 20.04 只能在恢复模式下启动。

我真的想放弃 Windows 生活,采用 Linux 作为操作系统,但与此同时,我的双启动出现了问题。我在另一个硬盘上安装了 Ubuntu,更具体地说是在我的 2TB 内置硬盘的一个分区中。Windows 安装在我的内置 256GB SSD 中。我在尝试安装时遇到了一些问题,安装过程中多次出现错误,所以我按照一些说明在没有互联网的情况下进行了安装。它运行良好,但现在我无法继续。

grub 似乎可以找到我的所有启动文件,例如 HD 中的 Ubuntu 和 SSD 中的 Windows 10,但如果我选择 Ubuntu(grub 中的第一个选项),我会卡在黑屏上。我可以通过恢复模式运行它,在选择“带有高级选项的 Ubuntu”(grub 中的第二个选项)后,我没有这方面的经验,但现在我正在做的是通过恢复模式下的 Ubuntu 进行部分升级。

细节:

我的笔记本电脑有 2 个显卡:

  1. 英特尔高清显卡(集成显卡)
  2. Nvidia GeForce 1050 max q 设计(独立显卡)

我检查了系统,Ubuntu(恢复模式)说它正在使用 Nvidia。

電子計算機[1]

我已经完成了干净的安装,但此时我连接了 Seagate 外置硬盘,Ubuntu 已安装并运行在其中。我遇到了一些问题。我按照用户评论的链接操作,但问题并未解决。我在启动时仍然遇到问题。最近,我甚至无法通过恢复模式启动。我做了一件事,并且成功了,那就是添加acpi = offgrub 参数。自从我这样做以来,我可以无错误地启动两次。我只这样做了一次,可以启动两次,最后一次,我没有添加这个小代码。

我运行了 Boot-Repair,它输出了这个日志。启动修复完成并生成了其他粘贴箱

============================= Boot Repair Summary ==============================

Warning: failed to translate partition name
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation
or fast restarting.)
Could not mount read-write, trying read-only
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation
or fast restarting.)
Could not mount read-write, trying read-only
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation
or fast restarting.)
Could not mount read-write, trying read-only
/usr/share/boot-sav/bs-cmd_terminal.sh: line 177: warning: command substitution: ignored null byte in input

Recommended repair: ____________________________________________________________

The default repair of the Boot-Repair utility will purge (in order to sign-grub) and reinstall the grub-efi-amd64-signed of
sdc2,
using the following options:        sdc1/boot/efi,
Additional repair will be performed: unhide-bootmenu-10s win-legacy-basic-fix use-standard-efi-file  restore-efi-backups


/boot/efi added in sdc2/fstab
rm /mnt/boot-sav/sda2/efi/Boot/bootx64.efi
mv /mnt/boot-sav/sda2/efi/Boot/bkpbootx64.efi /mnt/boot-sav/sda2/efi/Boot/bootx64.efi
rm /mnt/boot-sav/sdb1/efi/Boot/bootx64.efi
mv /mnt/boot-sav/sdb1/efi/Boot/bkpbootx64.efi /mnt/boot-sav/sdb1/efi/Boot/bootx64.efi
Quantity of real Windows: 1
Mount sdc1 on /boot/efi
apt-get -y update
Purge the GRUB of sdc2
grub-efi-amd64-signed available

The following packages were automatically installed and are no longer required:
libfprint-2-tod1 libnvidia-cfg1-440 libnvidia-common-440
libnvidia-compute-440 libnvidia-compute-440:i386 libnvidia-decode-440
libnvidia-decode-440:i386 libnvidia-encode-440 libnvidia-encode-440:i386
libnvidia-extra-440 libnvidia-fbc1-440 libnvidia-gl-440
libnvidia-gl-440:i386 libnvidia-ifr1-440 nvidia-compute-utils-440
nvidia-kernel-common-440 nvidia-kernel-source-440 nvidia-utils-440
xserver-xorg-video-nvidia-440
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 3 not upgraded.
DEBCHECK debOK, grub-efi-amd64-signed
DEBCHECK debOK
shim-signed available
Please type: sudo dpkg --configure -ansudo apt-get install -fynsudo apt-get purge -y grub*-common shim-signed
shim-signed available
linux-headers-generic available
linux-signed-generic NOT available (apt-cache policy  problem)
Then type: sudo apt-get install -y grub-efi-amd64-signed os-prober shim-signed linux-headers-generic
GRUB is still absent. Please try again.

Unhide GRUB boot menu in sdc2/etc/default/grub

==== Reinstall the grub-efi-amd64-signed os-prober shim-signed linux-headers-generic of sdc2 =====

grub-install --version
grub-install (GRUB) 2.04-1ubuntu26.4

efibootmgr -v from chroot before grub install
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0002,0003,0004,0000
Boot0000* ubu   VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0001* ubuntu    HD(1,GPT,7ac1c822-c071-419c-a842-735d0895936f,0x800,0x100000)/File(EFIUBUNTUSHIMX64.EFI)
Boot0002* Windows Boot Manager  HD(1,GPT,a1b191ce-24b9-4cc7-b895-9b6da5ede189,0x800,0x82000)/File(EFIMICROSOFTBOOTBOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0003* ubuntu    HD(2,GPT,e96f734c-5b2b-45a5-a8b7-92b0dae77bac,0xe5370000,0x135f1b)/File(EFIUBUNTUSHIMX64.EFI)..BO
Boot0004* ubuntu    HD(1,GPT,a1b191ce-24b9-4cc7-b895-9b6da5ede189,0x800,0x82000)/File(EFIUBUNTUSHIMX64.EFI)..BO

uname -r
5.4.0-42-generic

grub-install --efi-directory=/boot/efi --target=x86_64-efi --uefi-secure-boot
Installing for x86_64-efi platform.
Installation finished. No error reported.
df /dev/sdc1
mv /boot/efi/EFI/Boot/bootx64.efi /boot/efi/EFI/Boot/bkpbootx64.efi
cp /boot/efi/EFI/ubuntu/shimx64.efi /boot/efi/EFI/Boot/bootx64.efi
cp /boot/efi/EFI/ubuntu/grubx64.efi /boot/efi/EFI/Boot/
df /dev/sda2
mv /mnt/boot-sav/sda2/EFI/Boot/bootx64.efi /mnt/boot-sav/sda2/EFI/Boot/bkpbootx64.efi
cp /boot/efi/EFI/ubuntu/shimx64.efi /mnt/boot-sav/sda2/EFI/Boot/bootx64.efi
df /dev/sdb1
mv /mnt/boot-sav/sdb1/EFI/Boot/bootx64.efi /mnt/boot-sav/sdb1/EFI/Boot/bkpbootx64.efi
cp /boot/efi/EFI/ubuntu/shimx64.efi /mnt/boot-sav/sdb1/EFI/Boot/bootx64.efi

grub-install --efi-directory=/boot/efi --target=x86_64-efi --uefi-secure-boot
Installing for x86_64-efi platform.
Installation finished. No error reported.

efibootmgr -v from chroot after grub install
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0002,0000
Boot0000* ubu   VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0001* ubuntu    HD(1,GPT,7ac1c822-c071-419c-a842-735d0895936f,0x800,0x100000)/File(EFIubuntushimx64.efi)
Boot0002* Windows Boot Manager  HD(1,GPT,a1b191ce-24b9-4cc7-b895-9b6da5ede189,0x800,0x82000)/File(EFIMICROSOFTBOOTBOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................

update-grub
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 Ubuntu 20.04.1 LTS (20.04) on /dev/sda3
Found Windows Boot Manager on /dev/sdb1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation
or fast restarting.)
Could not mount read-write, trying read-only

Unhide GRUB boot menu in sdc2/boot/grub/grub.cfg

Unhide GRUB boot menu in sda3/boot/grub/grub.cfg

Boot successfully repaired.

You can now reboot your computer.

Please do not forget to make your UEFI firmware boot on the The OS now in use - Ubuntu 20.04.1 LTS CurrentSession entry (sdc1/EFI/ubuntu/shimx64.efi file) !
If your computer reboots directly into Windows, try to change the boot order in your UEFI firmware.

If your UEFI firmware does not allow to change the boot order, change the default boot entry of the Windows bootloader.
For example you can boot into Windows, then type the following command in an admin command prompt:
bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi

答案1

在恢复模式下,要么切换到英特尔显卡,要么将驱动程序切换到专有的 NVIDIA 驱动程序。如果没有专有驱动程序,您可能需要下载它。

相关内容