GNU GRUB 在 Ubuntu 重新安装后启动时进行最少的类似 BASH 的行编辑

GNU GRUB 在 Ubuntu 重新安装后启动时进行最少的类似 BASH 的行编辑

我通常每隔几个月重新安装一次 Ubuntu。我将重要文件保存在硬盘中,然后重新安装,格式化我的电脑。之后,每当我启动电脑时,都会打开类似 BASH 的最小行编辑屏幕。我的电脑是联想 IdeaPad Gaming,配备 AMD Ryzen 7 和 NVIDIA GPU。

我尝试使用 Boot-Repair,但是没有作用。(以下是 Pastebin 生成的)。我也遵循了此伊斯福斯教程无济于事。

============================== Boot Info Summary ===============================

 => Grub2 (v2.00) is installed in the MBR of /dev/nvme0n1 and looks at sector 
    1 of the same hard drive for core.img. core.img is at this location and 
    looks for (,msdos5)/boot/grub. It also embeds following components:
    
    modules
    ---------------------------------------------------------------------------
    fshelp ext2 part_msdos biosdisk
    ---------------------------------------------------------------------------
 => No boot loader is installed in the MBR of /dev/sda.

nvme0n1p1: _____________________________________________________________________

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

nvme0n1p2: _____________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info: 

nvme0n1p5: _____________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  Ubuntu 20.04.3 LTS
    Boot files:        /boot/grub/grub.cfg /etc/fstab /etc/default/grub 
                       /boot/grub/i386-pc/core.img

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/10/11/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sdb: ___________________________________________________________________________

    File system:       iso9660
    Boot sector type:  Unknown
    Boot sector info: 
    Mounting failed:   mount: /mnt/BootInfo/FD/sdb: /dev/sdb already mounted or mount point busy.


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

OS#1:   Ubuntu 20.04.3 LTS on nvme0n1p5

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

CPU architecture: 64-bit
Video: Renoir from Advanced Micro Devices, Inc. [AMD/ATI]
Live-session OS is Ubuntu 64-bit (Ubuntu 20.04.3 LTS, focal, x86_64)

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

BIOS/UEFI firmware: FCCN16WW(1.16) from LENOVO
This live-session is in Legacy/BIOS/CSM mode (not in EFI mode).


85fa9d77b929ec4231aba29476574eb6   nvme0n1p1/BOOT/fbx64.efi
469e608783843a701d172242f016c79c   nvme0n1p1/BOOT/mmx64.efi
fa1bf1a7f90a852abe0bdbd089b7f1b0   nvme0n1p1/ubuntu/grubx64.efi
469e608783843a701d172242f016c79c   nvme0n1p1/ubuntu/mmx64.efi
728124f6ec8e22fbdbe7034812c81b95   nvme0n1p1/ubuntu/shimx64.efi
728124f6ec8e22fbdbe7034812c81b95   nvme0n1p1/BOOT/BOOTX64.efi

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

Disks info: ____________________________________________________________________

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

Partitions info (1/3): _________________________________________________________

nvme0n1p1   : no-os,    32, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   not-far
nvme0n1p5   : is-os,    64, apt-get,    grub-pc ,   grub2,  grub-install,   grubenv-ok, update-grub,    farbios
sda1    : no-os,    32, nopakmgr,   no-docgrub, nogrub, nogrubinstall,  no-grubenv, noupdategrub,   farbios

Partitions info (2/3): _________________________________________________________

nvme0n1p1   : is---ESP, part-has-no-fstab,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot
nvme0n1p5   : isnotESP, fstab-has-goodEFI,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot
sda1    : isnotESP, part-has-no-fstab,  no-nt,  no-winload, no-recov-nor-hid,   no-bmgr,    notwinboot

Partitions info (3/3): _________________________________________________________

nvme0n1p1   : not--sepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, nvme0n1
nvme0n1p5   : not--sepboot, with-boot,  fstab-without-boot, not-sep-usr,    with--usr,  fstab-without-usr,  std-grub.d, nvme0n1
sda1    : not--sepboot, no---boot,  part-has-no-fstab,  not-sep-usr,    no---usr,   part-has-no-fstab,  no--grub.d, sda

fdisk -l (filtered): ___________________________________________________________

Disk nvme0n1: 953.89 GiB, 1024209543168 bytes, 2000409264 sectors
Disk identifier: 0x81bbc6c4
          Boot   Start        End    Sectors   Size Id Type
nvme0n1p1 *       2048    1050623    1048576   512M  b W95 FAT32
nvme0n1p2      1052670 2000408575 1999355906 953.4G  5 Extended
nvme0n1p5      1052672 2000408575 1999355904 953.4G 83 Linux
Disk sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk identifier: 0xb10b63e2
      Boot Start       End   Sectors   Size Id Type
sda1        2048 976769023 976766976 465.8G  7 HPFS/NTFS/exFAT
Disk sdb: 14.42 GiB, 15472047104 bytes, 30218842 sectors
Disk identifier: 0x2cf4ba3a
      Boot   Start      End  Sectors  Size Id Type
sdb1  *          0  5999871  5999872  2.9G  0 Empty
sdb2       5271500  5279499     8000  3.9M ef EFI (FAT-12/16/32)
sdb3       6000640 30218841 24218202 11.6G 83 Linux

parted -lm (filtered): _________________________________________________________

sda:500GB:scsi:512:4096:msdos:ATA ST500LM030-2E717:;
1:1049kB:500GB:500GB:ntfs::;
sdb:15.5GB:scsi:512:512:unknown:Kingston DataTraveler 3.0:;
nvme0n1:1024GB:nvme:512:512:msdos:KINGSTON OM8PCP31024F-AI1:;
1:1049kB:538MB:537MB:fat32::boot;
2:539MB:1024GB:1024GB:::;
5:539MB:1024GB:1024GB:ext4::;

blkid (filtered): ______________________________________________________________

NAME        FSTYPE   UUID                                 PARTUUID                             LABEL                    PARTLABEL
sda                                                                                                                     
└─sda1      ntfs     FC62D44B62D40BF0                     b10b63e2-01                          Nuevo vol                
sdb         iso9660  2021-08-19-11-03-38-00                                                    Ubuntu 20.04.3 LTS amd64 
├─sdb1      iso9660  2021-08-19-11-03-38-00               2cf4ba3a-01                          Ubuntu 20.04.3 LTS amd64 
├─sdb2      vfat     54C5-9C6C                            2cf4ba3a-02                                                   
└─sdb3      ext4     6840b456-68b2-47ac-9b7f-0349bcc483f8 2cf4ba3a-03                          writable                 
nvme0n1                                                                                                                 
├─nvme0n1p1 vfat     C043-DD8E                            81bbc6c4-01                                                   
├─nvme0n1p2                                               81bbc6c4-02                                                   
└─nvme0n1p5 ext4     e50beef4-968b-4400-9a8b-5dd49d88f880 81bbc6c4-05                                                   

Mount points (filtered): _______________________________________________________

                                                                Avail Use% Mounted on
/dev/disk/by-label/writable[/install-logs-2022-07-16.15/crash]  10.6G   1% /var/crash
/dev/disk/by-label/writable[/install-logs-2022-07-16.15/log]    10.6G   1% /var/log
/dev/nvme0n1p1                                                 505.8M   1% /mnt/boot-sav/nvme0n1p1
/dev/nvme0n1p5                                                 880.4G   1% /mnt/boot-sav/nvme0n1p5
/dev/sda1                                                      465.7G   0% /mnt/boot-sav/sda1
/dev/sdb1                                                           0 100% /cdrom

Mount options (filtered): ______________________________________________________

/dev/disk/by-label/writable[/install-logs-2022-07-16.15/crash] ext4            rw,relatime
/dev/disk/by-label/writable[/install-logs-2022-07-16.15/log]   ext4            rw,relatime
/dev/nvme0n1p1                                                 vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
/dev/nvme0n1p5                                                 ext4            rw,relatime
/dev/sda1                                                      fuseblk         rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096
/dev/sdb1                                                      iso9660         ro,noatime,nojoliet,check=s,map=n,blocksize=2048

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

search.fs_uuid 20d8a7d0-0bd5-49fc-8aaa-28566a18a87e root 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

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

Ubuntu   e50beef4-968b-4400-9a8b-5dd49d88f880
Ubuntu, with Linux 5.15.0-41-generic   e50beef4-968b-4400-9a8b-5dd49d88f880
Ubuntu, with Linux 5.11.0-27-generic   e50beef4-968b-4400-9a8b-5dd49d88f880
### END /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_uefi-firmware ###

======================== nvme0n1p5/etc/fstab (filtered) ========================

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p5 during installation
UUID=e50beef4-968b-4400-9a8b-5dd49d88f880 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=C043-DD8E  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

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

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

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

           GiB - GB             File                                 Fragment(s)
 894.631454468 = 960.603209728  boot/grub/grub.cfg                             3
 890.641151428 = 956.318654464  boot/grub/i386-pc/core.img                     1
   8.262195587 = 8.871464960    boot/vmlinuz                                   1
   5.775386810 = 6.201274368    boot/vmlinuz-5.11.0-27-generic                 2
   8.262195587 = 8.871464960    boot/vmlinuz-5.15.0-41-generic                 1
   5.775386810 = 6.201274368    boot/vmlinuz.old                               2
   9.139122009 = 9.813057536    boot/initrd.img                                1
   9.078685760 = 9.748164608    boot/initrd.img-5.11.0-27-generic              1
   9.139122009 = 9.813057536    boot/initrd.img-5.15.0-41-generic              1
   9.078685760 = 9.748164608    boot/initrd.img.old                            1

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

-rwxr-xr-x 1 root root 18224 Jan 11  2022 10_linux
-rwxr-xr-x 1 root root 42359 Aug 12  2021 10_linux_zfs
-rwxr-xr-x 1 root root 12894 Aug 12  2021 20_linux_xen
-rwxr-xr-x 1 root root 12059 Aug 12  2021 30_os-prober
-rwxr-xr-x 1 root root  1424 Aug 12  2021 30_uefi-firmware
-rwxr-xr-x 1 root root   214 Aug 12  2021 40_custom
-rwxr-xr-x 1 root root   216 Aug 12  2021 41_custom



Suggested repair: ______________________________________________________________

The default repair of the Boot-Repair utility would purge (in order to fix packages) and reinstall the grub-efi of
nvme0n1p5,
using the following options:  nvme0n1p1/boot/efi
Additional repair would be performed: unhide-bootmenu-10s use-standard-efi-file

Blockers in case of suggested repair: __________________________________________

 The current session is in BIOS-compatibility mode. Please disable BIOS-compatibility/CSM/Legacy mode in your UEFI firmware, and use this software from a live-CD (or live-USB) that is compatible with UEFI booting mode. For example, use a live-USB of Boot-Repair-Disk-64bit (www.sourceforge.net/p/boot-repair-cd), after making sure your BIOS is set up to boot USB in EFI mode. This will enable this feature.

Final advice in case of suggested repair: ______________________________________

Please do not forget to make your UEFI firmware boot on the Ubuntu 20.04.3 LTS entry (nvme0n1p1/efi/****/grub****.efi (**** will be updated in the final message) file) !
The boot of your PC is in BIOS-compatibility/CSM/Legacy mode. You may want to retry after changing it to UEFI mode.

我也尝试过按照有关此主题的其他问题中所说的操作,但是没有任何效果。

答案1

根据 Boot-Repair Boot Info Summary,您的 PC 的启动处于 BIOS 兼容性/CSM/Legacy 模式。请以传统模式启动您的 PC。

相关内容