GRUB 之后无法加载 Ubuntu

GRUB 之后无法加载 Ubuntu

错误

休假两周后,我最近打开了电脑,Ubuntu 似乎运行良好。我没有安装任何新程序或进行任何配置更改。

使用大约一小时后,我重启了电脑。它加载了初始启动菜单,然后进入 GRUB 菜单,我可以在里面选择 Ubuntu 或带有高级选项的 Ubuntu。之后,它只显示上述屏幕,然后转到带有闪烁光标的空白屏幕。

我尝试使用此帖子中描述的启动修复工具来修复我的 Grub,因为我认为这是一个 Grub 引导加载程序问题,但这并不能解决问题。

https://linuxconfig.org/ubuntu-22-04-not-booting-troubleshooting-guide

说实话,此时我已经筋疲力尽,完全没有主意了。我真的不想完全重新安装 Ubuntu,因为第一次正确设置太麻烦了。我正考虑换用 Windows 操作系统,因为我似乎每个月都会遇到一个问题,需要半天时间才能用 Ubuntu 解决。任何有关故障排除的想法都非常感谢。

如果您需要,这里是启动修复工具的输出。

boot-repair-4ppa2056                                              [20230409_0211]

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






Recommended repair: ____________________________________________________________

The default repair of the Boot-Repair utility will reinstall the grub-efi of
sda2,
using the following options:  sda1/boot/efi
Additional repair will be performed: unhide-bootmenu-10s use-standard-efi-file restore-efi-backups


rm /mnt/boot-sav/sda1/efi/Boot/bootx64.efi
mv /mnt/boot-sav/sda1/efi/Boot/bkpbootx64.efi /mnt/boot-sav/sda1/efi/Boot/bootx64.efi
Mount sda1 on /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1/boot/efi

======================== Reinstall the grub-efi of sda2 ========================

chroot /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1 grub-install --version
grub-install (GRUB) 2.06-2ubuntu7.1
chroot /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1 modprobe efivars

chroot /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1 efibootmgr -v before grub install
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0001,0002
Boot0001* ubuntu    HD(1,GPT,aaaaa027-5ba8-4dbb-aca7-152c99f66004,0x800,0x100000)/File(EFIubuntushimx64.efi)
Boot0002* UEFI OS   HD(2,GPT,9240a165-d190-4ab6-8a12-46dc207b42ee,0x71e8a0,0x2130)/File(EFIBOOTBOOTX64.EFI)..BO

chroot /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1 uname -r
5.15.0-43-generic

chroot /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1 grub-install --efi-directory=/boot/efi --target=x86_64-efi
Installing for x86_64-efi platform.
grub-install: warning: EFI variables cannot be set on this system.
grub-install: warning: You will have to complete the GRUB setup manually.
Installation finished. No error reported.
df /dev/sda1
mv /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1/boot/efi/EFI/Boot/bootx64.efi /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1/boot/efi/EFI/Boot/bkpbootx64.efi
cp /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1/boot/efi/efi/ubuntu/grubx64.efi /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1/boot/efi/EFI/Boot/bootx64.efi

chroot /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1 grub-install --efi-directory=/boot/efi --target=x86_64-efi
Installing for x86_64-efi platform.
grub-install: warning: EFI variables cannot be set on this system.
grub-install: warning: You will have to complete the GRUB setup manually.
Installation finished. No error reported.

chroot /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1 efibootmgr -v after grub install
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0001,0002
Boot0001* ubuntu    HD(1,GPT,aaaaa027-5ba8-4dbb-aca7-152c99f66004,0x800,0x100000)/File(EFIubuntushimx64.efi)
Boot0002* UEFI OS   HD(2,GPT,9240a165-d190-4ab6-8a12-46dc207b42ee,0x71e8a0,0x2130)/File(EFIBOOTBOOTX64.EFI)..BO
Warning: NVram was not modified.

chroot /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1 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.19.0-38-generic
Found initrd image: /boot/initrd.img-5.19.0-38-generic
Found linux image: /boot/vmlinuz-5.19.0-35-generic
Found initrd image: /boot/initrd.img-5.19.0-35-generic
Found linux image: /boot/vmlinuz-5.15.0-56-generic
Found initrd image: /boot/initrd.img-5.15.0-56-generic
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.

Unhide GRUB boot menu in sda2/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 Ubuntu 22.04.2 LTS entry (sda1/efi/ubuntu/grubx64.efi file) !


============================ Boot Info After Repair ============================

 => No boot loader is installed in the MBR of /dev/sda.
 => No boot loader is installed in the MBR of /dev/sdb.
 => libparted MBR boot code is installed in the MBR of /dev/sdc.

sda1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /efi/BOOT/bkpbootx64.efi /efi/BOOT/bootx64.efi 
                       /efi/BOOT/fbx64.efi /efi/BOOT/mmx64.efi 
                       /efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi 
                       /efi/ubuntu/MokManager.efi /efi/ubuntu/shimx64.efi 
                       /efi/ubuntu/grub.cfg

sda2: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  Ubuntu 22.04.2 LTS
    Boot files:        /boot/grub/grub.cfg /etc/fstab /etc/default/grub

sdb1: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  
    Boot files:        

sdc1: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  
    Boot files:        

sdd: ___________________________________________________________________________

    File system:       iso9660
    Boot sector type:  Grub2 (v1.99-2.00)
    Boot sector info:  Grub2 (v1.99-2.00) is installed in the boot sector of 
                       sdd and looks at sector 0 of the same hard drive for 
                       core.img, but core.img can not be found at this 
                       location.
    Mounting failed:   mount: /mnt/BootInfo/FD/sdd: /dev/sdd already mounted or mount point busy.


================================ 1 OS detected =================================

OS#1:   Ubuntu 22.04.2 LTS on sda2

================================ Host/Hardware =================================

CPU architecture: 64-bit
Video: GA102 [GeForce RTX 3080] Advanced Micro Devices, Inc. [AMD/ATI] from NVIDIA Corporation Advanced Micro Devices, Inc. [AMD/ATI]
Live-session OS is Ubuntu 64-bit (Ubuntu 22.04.1 LTS, jammy, x86_64)

===================================== UEFI =====================================

BIOS/UEFI firmware: F5(5.26) from American Megatrends International, LLC.
The firmware is EFI-compatible, and is set in EFI-mode for this live-session.
SecureBoot disabled (confirmed by mokutil).
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0001,0002
Boot0001* ubuntu    HD(1,GPT,aaaaa027-5ba8-4dbb-aca7-152c99f66004,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Boot0002* UEFI OS   HD(2,GPT,9240a165-d190-4ab6-8a12-46dc207b42ee,0x71e8a0,0x2130)/File(\EFI\BOOT\BOOTX64.EFI)..BO

728124f6ec8e22fbdbe7034812c81b95   sda1/BOOT/bkpbootx64.efi
728124f6ec8e22fbdbe7034812c81b95   sda1/BOOT/bootx64.efi
c152ec201c37b6e97bbc2207e49d1271   sda1/BOOT/fbx64.efi
fdafb5eece6caeccb788c946a28e6872   sda1/BOOT/mmx64.efi
3795ef72a4ed0369ca44e711527904bf   sda1/ubuntu/grubx64.efi
fdafb5eece6caeccb788c946a28e6872   sda1/ubuntu/mmx64.efi
ba8a7979ac57f1c0c307ef94d1020eb8   sda1/ubuntu/MokManager.efi
728124f6ec8e22fbdbe7034812c81b95   sda1/ubuntu/shimx64.efi

============================= Drive/Partition Info =============================

Disks info: ____________________________________________________________________

sda : is-GPT,   no-BIOSboot,    has---ESP,  not-usb,    not-mmc, has-os,    no-wind,    2048 sectors * 512 bytes
sdb : is-GPT,   no-BIOSboot,    has-noESP,  not-usb,    not-mmc, no-os, no-wind,    2048 sectors * 512 bytes
sdc : notGPT,   no-BIOSboot,    has-noESP,  not-usb,    not-mmc, no-os, no-wind,    2048 sectors * 512 bytes

Partitions info (1/3): _________________________________________________________

sda1    : no-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   not-far
sda2    : is-os,    64, apt-get,    signed grub-pc grub-efi ,   grub2,  grub-install,   grubenv-ok, update-grub,    farbios
sdb1    : no-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   farbios
sdc1    : no-os,    64, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   farbios

Partitions info (2/3): _________________________________________________________

sda1    : is---ESP, part-has-no-fstab,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot
sda2    : isnotESP, fstab-has-goodEFI,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot
sdb1    : isnotESP, part-has-no-fstab,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot
sdc1    : isnotESP, part-has-no-fstab,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot

Partitions info (3/3): _________________________________________________________

sda1    : not--sepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, sda
sda2    : not--sepboot, with-boot,  fstab-without-boot, not-sep-usr,    with--usr,  fstab-without-usr,  std-grub.d, sda
sdb1    : maybesepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, sdb
sdc1    : maybesepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, sdc

fdisk -l (filtered): ___________________________________________________________

Disk sda: 256.17 GiB, 275064201216 bytes, 537234768 sectors
Disk identifier: 31EFF0DA-E0FE-4D03-8639-BD1EE12EA540
        Start       End   Sectors   Size Type
sda1     2048   1050623   1048576   512M EFI System
sda2  1050624 537233407 536182784 255.7G Linux filesystem
Disk sdb: 256.17 GiB, 275064201216 bytes, 537234768 sectors
Disk identifier: 06A7A336-039B-4B46-A63C-896C87FBEDA0
      Start       End   Sectors   Size Type
sdb1   2048 537233407 537231360 256.2G Linux filesystem
Disk sdc: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk identifier: 0xf1d620b6
      Boot Start        End    Sectors  Size Id Type
sdc1        2048 3907028991 3907026944  1.8T 83 Linux
Disk sdd: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk identifier: 9240A165-D190-4AB6-8A10-46DC207B42EE
        Start       End   Sectors   Size Type
sdd1       64   7465119   7465056   3.6G Microsoft basic data
sdd2  7465120   7473615      8496   4.1M EFI System
sdd3  7473616   7474215       600   300K Microsoft basic data
sdd4  7475200 976773104 969297905 462.2G Linux filesystem

parted -lm (filtered): _________________________________________________________

sda:275GB:scsi:512:512:gpt:ATA Crucial_CT275MX3:;
1:1049kB:538MB:537MB:fat32:EFI System Partition:boot, esp;
2:538MB:275GB:275GB:ext4::;
sdb:275GB:scsi:512:512:gpt:ATA Crucial_CT275MX3:;
1:1049kB:275GB:275GB:ext4::;
sdc:2000GB:scsi:512:4096:msdos:ATA ST2000DM006-2DM1:;
1:1049kB:2000GB:2000GB:ext4::;
sdd:500GB:scsi:512:512:gpt:Samsung Portable SSD T5:;
1:32.8kB:3822MB:3822MB::ISO9660:hidden, msftdata;
2:3822MB:3826MB:4350kB::Appended2:boot, esp;
3:3826MB:3827MB:307kB::Gap1:hidden, msftdata;
4:3827MB:500GB:496GB:ext4::;

blkid (filtered): ______________________________________________________________

NAME   FSTYPE   UUID                                 PARTUUID                             LABEL                    PARTLABEL
sda                                                                                                                
├─sda1 vfat     1FA3-59C0                            aaaaa027-5ba8-4dbb-aca7-152c99f66004                          EFI System Partition
└─sda2 ext4     f88694e7-e96d-41a7-9122-c1a4c771d3d1 be434127-fa17-4d65-97dd-470c72b129c5                          
sdb                                                                                                                
└─sdb1 ext4     977484bf-11b6-4a6e-b377-f1ffac0abced 68923cb9-4f07-4db0-a629-eb891bf391b4 extendo                  
sdc                                                                                                                
└─sdc1 ext4     9a332771-8a3a-470d-8151-7838705f91db f1d620b6-01                          HDD                      
sdd    iso9660  2022-08-10-16-21-45-00                                                    Ubuntu 22.04.1 LTS amd64 
├─sdd1 iso9660  2022-08-10-16-21-45-00               9240a165-d190-4ab6-8a11-46dc207b42ee Ubuntu 22.04.1 LTS amd64 ISO9660
├─sdd2 vfat     8D6C-A9F8                            9240a165-d190-4ab6-8a12-46dc207b42ee ESP                      Appended2
├─sdd3                                               9240a165-d190-4ab6-8a13-46dc207b42ee                          Gap1
└─sdd4 ext4     592c0c0b-0b7b-4737-94a4-ddfd868af6a7 16164e37-d32d-6248-adda-ed0d4dadafce writable                 

Mount points (filtered): _______________________________________________________

                                                               Avail Use% Mounted on
/dev/disk/by-label/writable[/install-logs-2023-04-09.4/crash] 430.7G   0% /var/crash
/dev/disk/by-label/writable[/install-logs-2023-04-09.4/log]   430.7G   0% /var/log
/dev/sda1                                                     503.6M   1% /mnt/boot-sav/sda1
/dev/sda2                                                     106.5G  52% /media/ubuntu/f88694e7-e96d-41a7-9122-c1a4c771d3d1
/dev/sdb1                                                        18G  88% /mnt/boot-sav/sdb1
/dev/sdc1                                                     248.1G  81% /media/ubuntu/HDD
/dev/sdd1                                                          0 100% /cdrom

Mount options (filtered): ______________________________________________________


===================== sda1/efi/ubuntu/grub.cfg (filtered) ======================

search.fs_uuid f88694e7-e96d-41a7-9122-c1a4c771d3d1 root hd0,gpt2 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

====================== sda2/boot/grub/grub.cfg (filtered) ======================

Ubuntu   f88694e7-e96d-41a7-9122-c1a4c771d3d1
Ubuntu, with Linux 5.19.0-38-generic   f88694e7-e96d-41a7-9122-c1a4c771d3d1
Ubuntu, with Linux 5.19.0-35-generic   f88694e7-e96d-41a7-9122-c1a4c771d3d1
Ubuntu, with Linux 5.15.0-56-generic   f88694e7-e96d-41a7-9122-c1a4c771d3d1
### END /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_uefi-firmware ###

========================== sda2/etc/fstab (filtered) ===========================

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=f88694e7-e96d-41a7-9122-c1a4c771d3d1 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=1FA3-59C0  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

======================= sda2/etc/default/grub (filtered) =======================

GRUB_DEFAULT=0
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=false

==================== sda2: Location of files loaded by Grub ====================

           GiB - GB             File                                 Fragment(s)
            ?? = ??             boot/grub/grub.cfg                             1
 149.934200287 = 160.990621696  boot/vmlinuz                                   2
  68.707046509 = 73.773629440   boot/vmlinuz-5.15.0-56-generic                 1
 152.371700287 = 163.607867392  boot/vmlinuz-5.19.0-35-generic                 1
 149.934200287 = 160.990621696  boot/vmlinuz-5.19.0-38-generic                 2
 152.371700287 = 163.607867392  boot/vmlinuz.old                               1
 147.375972748 = 158.243745792  boot/initrd.img                                2
 157.249320984 = 168.845172736  boot/initrd.img-5.15.0-56-generic              4
 203.172847748 = 218.155184128  boot/initrd.img-5.19.0-35-generic              4
 147.375972748 = 158.243745792  boot/initrd.img-5.19.0-38-generic              2
 203.172847748 = 218.155184128  boot/initrd.img.old                            4

===================== sda2: ls -l /etc/grub.d/ (filtered) ======================

-rwxr-xr-x 1 root root 18683 Apr 15  2022 10_linux
-rwxr-xr-x 1 root root 43031 Apr 15  2022 10_linux_zfs
-rwxr-xr-x 1 root root 14180 Apr 15  2022 20_linux_xen
-rwxr-xr-x 1 root root 13369 Apr 15  2022 30_os-prober
-rwxr-xr-x 1 root root  1372 Apr 15  2022 30_uefi-firmware
-rwxr-xr-x 1 root root   700 Feb 19  2022 35_fwupd
-rwxr-xr-x 1 root root   214 Apr 15  2022 40_custom
-rwxr-xr-x 1 root root   215 Apr 15  2022 41_custom

相关内容