背景

背景

背景

我的系统已经运行了一年(或更长时间),最近,重新启动后,Ubuntu 22.04 没有出现,最终它在 UEFI BIOS 中稳定下来。ESC启动时点击会将我带到 Grub 菜单,该菜单只有一个条目可以进入 UEFI BIOS。我可以进入 Grub 的命令行并输入以下命令,我就可以启动到 Linux。(这似乎没有必要。不知何故,自动启动机制消失了。)

grub> set root=(hd1,gpt3)
grub> linux /BOOT/ubuntu_6usaiw/@/vmlinuz root=ZFS=rpool/ROOT/ubuntu_6usaiw boot=zfs
grub> initrd /BOOT/ubuntu_6usaiw/@/initrd.img
grub> boot

问题是为什么启动配置中的这些命令不能自动启动系统?是什么原因导致它突然停止启动?我有 Ubuntu PRO 服务。它是否更新了导致启动中断的某些内容?

解决方法

我仍然没有弄清楚系统中发生了什么变化,导致启动到 UEFI BIOS。不过,在社区的帮助下,我找到了解决办法。

根据评论,我在/etc/grub.d/40_custom配置文件中创建了一个新的启动菜单项,其中包含用于启动 Linux 的正确 grub 命令。此外,该新菜单项被设置为默认菜单项。

这是我的新/etc/default/grub文件,它选择了默认菜单项。请注意,UEFI 固件菜单项是 #0。由于40_custom稍后运行,它将位于菜单项 #1。

# 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=1
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="splash resume=UUID=2ea078a9-4754-4da5-a869-b70baf650372"
GRUB_CMDLINE_LINUX_DEFAULT="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=1024x768,auto
 
# 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"

40_custom脚本包含这个新的菜单项:

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry 'Special Boot' $menuentry_id_option 'Ubuntu-Linux-22dot04' {
set root=(hd1,gpt3)
linux /BOOT/ubuntu_6usaiw/@/vmlinuz root=ZFS=rpool/ROOT/ubuntu_6usaiw boot=zfs
initrd /BOOT/ubuntu_6usaiw/@/initrd.img
boot
}
### END /etc/grub.d/40_custom ###

进行这些更改后,运行sudo update-grubsudo install-grub,我至少可以再次获得自动启动。

但我仍然不知道是什么导致了这个问题。

机器信息

该机器有两个驱动器:nvme0n1(2TiB nvme ssd)和sda(1 TiB SATA SSD - 最近添加用于 SWAPsda1和备份sda2)。Linuxnvme0n1所在的 ZFS 文件系统有 4 个分区。

boot-repair实用程序将仅提供以下报告,但不会修复任何内容,因为我似乎无法解密分区nvme0n1p2。 (我怀疑这很关键,因为它是一个非常小的交换空间,在/etc/fstab中没有被禁用。)

    boot-repair-4ppa2056                                              [20231016_1119]
     
    ============================== Boot Info Summary ===============================
     
    => No boot loader is installed in the MBR of /dev/nvme0n1.
    => 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:        /grub.cfg
     
    nvme0n1p2: _____________________________________________________________________
     
        File system:       crypto_LUKS
        Boot sector type:  Unknown
        Boot sector info: 
     
    nvme0n1p3: _____________________________________________________________________
     
        File system:       zfs_member
        Boot sector type:  -
        Boot sector info: 
        Operating System:  
        Boot files:        
     
    nvme0n1p4: _____________________________________________________________________
     
        File system:       zfs_member
        Boot sector type:  -
        Boot sector info: 
        Operating System:  Ubuntu 22.04.3 LTS
        Boot files:        /etc/fstab /etc/default/grub
     
    sda1: __________________________________________________________________________
     
        File system:       swap
        Boot sector type:  -
        Boot sector info: 
     
    sda2: __________________________________________________________________________
     
        File system:       ext4
        Boot sector type:  -
        Boot sector info: 
        Operating System:  
        Boot files:        
     
     
    ================================ 1 OS detected =================================
     
    OS#1:   The OS now in use - Ubuntu 22.04.3 LTS CurrentSession on rpool/ROOT/ubuntu_6usaiw
     
    ================================ Host/Hardware =================================
     
    CPU architecture: 64-bit
    Video: GP107 [GeForce GTX 1050 Ti] EFI VGA from NVIDIA Corporation
    BOOT_IMAGE of the installed session in use:
    /BOOT/ubuntu_6usaiw/@/vmlinuz root=ZFS=rpool/ROOT/ubuntu_6usaiw boot=zfs
    df -Th / : rpool/ROOT/ubuntu_6usaiw zfs   1.8T  206G  1.6T  12% /
     
    ===================================== UEFI =====================================
     
    BIOS/UEFI firmware: 3803(5.13) from American Megatrends Inc.
    The firmware is EFI-compatible, and is set in EFI-mode for this installed-session.
    SecureBoot disabled (confirmed by mokutil).
    BootCurrent: 0000
    Timeout: 1 seconds
    BootOrder: 0000
    Boot0000* ubuntu HD(1,GPT,98401b0a-7aef-4108-8ba2-32b2726657bd,0x800,0x100000)/File(\EFI\UBUNTU\SHIMX64.EFI)
     
     
    ============================= Drive/Partition Info =============================
     
    Disks info: ____________________________________________________________________
     
    nvme0n1 : is-GPT, no-BIOSboot, has---ESP, not-usb, not-mmc, no-os, no-wind, 2048 sectors * 512 bytes
    sda : is-GPT, no-BIOSboot, has-noESP, not-usb, not-mmc, no-os, no-wind, 2048 sectors * 512 bytes
     
    Partitions info (1/3): _________________________________________________________
     
    nvme0n1p3 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, grubenv-ok, noupdategrub, not-far
    nvme0n1p1 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
    nvme0n1p4 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
    sda2 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
    mapper/keystore-rpool : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
     
    Partitions info (2/3): _________________________________________________________
     
    nvme0n1p3 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
    nvme0n1p1 : is---ESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
    nvme0n1p4 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
    sda2 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
    mapper/keystore-rpool : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
     
    Partitions info (3/3): _________________________________________________________
     
    nvme0n1p3 : is--zfs-boot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, nvme0n1
    nvme0n1p1 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, nvme0n1
    nvme0n1p4 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, nvme0n1
    sda2 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sda
    mapper/keystore-rpool : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sda
     
    fdisk -l (filtered): ___________________________________________________________
     
    Disk nvme0n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
    Disk identifier: 10CE2001-F2D1-43C4-AF9E-40C33E6E309C
                Start        End    Sectors  Size Type
    nvme0n1p1    2048    1050623    1048576  512M EFI System
    nvme0n1p2 1050624    5244927    4194304    2G Linux swap
    nvme0n1p3 5244928    9439231    4194304    2G Solaris boot
    nvme0n1p4 9439232 3907029134 3897589903  1.8T Solaris root
    Disk sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
    Disk identifier: BD95CBE7-5BC6-453C-966F-0CCBF1A71129
              Start        End    Sectors   Size Type
    sda1       2048  270534655  270532608   129G Linux swap
    sda2  270534656 1953523711 1682989056 802.5G Linux filesystem
    Disk zd0: 500 MiB, 524288000 bytes, 1024000 sectors
    Disk mapper/keystore-rpool: 484 MiB, 507510784 bytes, 991232 sectors
    Disk mapper/cryptoswap: 2 GiB, 2147483648 bytes, 4194304 sectors
     
    parted -lm (filtered): _________________________________________________________
     
    sda:1000GB:scsi:512:512:gpt:ATA WD Blue SA510 2.:;
    1:1049kB:139GB:139GB:linux-swap(v1):swap:swap;
    2:139GB:1000GB:862GB:ext4:Backup-01:;
    mapper/cryptoswap:2147MB:dm:512:512:unknown:Linux device-mapper (crypt):;
    mapper/keystore-rpool:508MB:dm:512:8192:loop:Linux device-mapper (crypt):;
    1:0.00B:508MB:508MB:ext4::;
    nvme0n1:2000GB:nvme:512:512:gpt:CT2000P3SSD8:;
    1:1049kB:538MB:537MB:fat32:EFI System Partition:boot, esp;
    2:538MB:2685MB:2147MB:::swap;
    3:2685MB:4833MB:2147MB:zfs::;
    4:4833MB:2000GB:1996GB:zfs::;
    zd0:524MB:unknown:512:8192:unknown:Unknown:;
     
    blkid (filtered): ______________________________________________________________
     
    NAME             FSTYPE      UUID                                 PARTUUID                             LABEL          PARTLABEL
    sda                                                                                                                   
    ├─sda1           swap        2ea078a9-4754-4da5-a869-b70baf650372 c3dbb487-4201-441e-91f4-537e5c9d3023                swap
    └─sda2           ext4        78ddbdfd-a265-4815-8253-f21ebd8fa790 2b414450-1fb4-4dd6-ae90-08dbfdd452e2 BKUP01         Backup-01
    zd0              crypto_LUKS b3c40e1f-922f-4119-86be-6c1cafa28df1                                                     
    └─keystore-rpool ext4        00873c9b-be59-48a3-8228-9175847bff29                                      keystore-rpool 
    nvme0n1                                                                                                               
    ├─nvme0n1p1      vfat        623E-2F75                            98401b0a-7aef-4108-8ba2-32b2726657bd                EFI System Partition
    ├─nvme0n1p2      crypto_LUKS 0499446b-d22f-4496-9443-63134aa6ff4e 165bf710-ba55-4b47-b393-3558a548ec66                
    │ └─cryptoswap                                                                                                        
    ├─nvme0n1p3      zfs_member  5837193240244028344                  9624a9b8-596c-d244-825b-1799db0a550c bpool          
    └─nvme0n1p4      zfs_member  2872672152338174268                  3db24d13-0e32-9243-a929-5a45392d5306 rpool          
     
    Mount points (filtered): _______________________________________________________
     
                                                      Avail Use% Mounted on
    bpool/BOOT/ubuntu_6usaiw                           1.3G  26% /boot
    /dev/mapper/keystore-rpool                       403.1M   0% /run/keystore/rpool
    /dev/nvme0n1p1[/grub]                            496.7M   3% /boot/grub
    /dev/sda2                                        725.1G   3% /media/backup
    //redwood/d-drive                                826.5G  11% /media/redwood_d_drive
    rpool/ROOT/ubuntu_6usaiw                           1.5T  12% /
    rpool/ROOT/ubuntu_6usaiw/srv                       1.5T   0% /srv
    rpool/ROOT/ubuntu_6usaiw/usr/local                 1.5T   0% /usr/local
    rpool/ROOT/ubuntu_6usaiw/var/games                 1.5T   0% /var/games
    rpool/ROOT/ubuntu_6usaiw/var/lib                   1.5T   0% /var/lib
    rpool/ROOT/ubuntu_6usaiw/var/lib/AccountsService   1.5T   0% /var/lib/AccountsService
    rpool/ROOT/ubuntu_6usaiw/var/lib/apt               1.5T   0% /var/lib/apt
    rpool/ROOT/ubuntu_6usaiw/var/lib/dpkg              1.5T   0% /var/lib/dpkg
    rpool/ROOT/ubuntu_6usaiw/var/lib/NetworkManager    1.5T   0% /var/lib/NetworkManager
    rpool/ROOT/ubuntu_6usaiw/var/log                   1.5T   0% /var/log
    rpool/ROOT/ubuntu_6usaiw/var/mail                  1.5T   0% /var/mail
    rpool/ROOT/ubuntu_6usaiw/var/snap                  1.5T   0% /var/snap
    rpool/ROOT/ubuntu_6usaiw/var/spool                 1.5T   0% /var/spool
    rpool/ROOT/ubuntu_6usaiw/var/www                   1.5T   0% /var/www
    rpool/USERDATA/root_mtocmd                         1.5T   0% /root
    rpool/USERDATA/tdavis_mtocmd                       1.5T   1% /home/tdavis
     
    Mount options (filtered): ______________________________________________________
     
     
    ============================== ls -R /dev/mapper/ ==============================
     
    /dev/mapper:
    control
    cryptoswap
    keystore-rpool
     
    ======================== nvme0n1p1/grub.cfg (filtered) =========================
     
    ### END /etc/grub.d/30_os-prober ###
    UEFI Firmware Settings   uefi-firmware
    ### END /etc/grub.d/30_uefi-firmware ###
     
    ================= nvme0n1p1: Location of files loaded by Grub ==================
     
               GiB - GB             File                                 Fragment(s)
                ?? = ??             grub.cfg                                       1
     
    ================= nvme0n1p3: Location of files loaded by Grub ==================
     
               GiB - GB             File                                 Fragment(s)
                ?? = ??             vmlinuz
                ?? = ??             vmlinuz-6.2.0-33-generic
                ?? = ??             vmlinuz-6.2.0-34-generic
                ?? = ??             vmlinuz.old
                ?? = ??             initrd.img
                ?? = ??             initrd.img-6.2.0-33-generic
                ?? = ??             initrd.img-6.2.0-34-generic
                ?? = ??             initrd.img.old
     
    ======================== nvme0n1p4/etc/fstab (filtered) ========================
     
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    # /boot/efi was on /dev/nvme0n1p1 during installation
    UUID=623E-2F75  /boot/efi       vfat    umask=0022,fmask=0022,dmask=0022      0       1
    /boot/efi/grub /boot/grub none defaults,bind 0 0
    UUID=2ea078a9-4754-4da5-a869-b70baf650372 none swap sw   0       0
    //redwood/d-drive /media/redwood_d_drive cifs credentials=/home/tdavis/.smbcredentials,iocharset=utf8 0 0
    UUID=78ddbdfd-a265-4815-8253-f21ebd8fa790 /media/backup ext4 defaults 0 0
     
    ==================== nvme0n1p4/etc/default/grub (filtered) =====================
     
    GRUB_DEFAULT=0
    GRUB_TIMEOUT_STYLE=menu
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT="splash"
    GRUB_CMDLINE_LINUX=""
    GRUB_GFXMODE=1024x768,auto
     
    ================= nvme0n1p4: Location of files loaded by Grub ==================
     
               GiB - GB             File                                 Fragment(s)
                ?? = ??             boot/vmlinuz
                ?? = ??             boot/vmlinuz-6.2.0-33-generic
                ?? = ??             boot/vmlinuz-6.2.0-34-generic
                ?? = ??             boot/vmlinuz.old
                ?? = ??             boot/initrd.img
                ?? = ??             boot/initrd.img-6.2.0-33-generic
                ?? = ??             boot/initrd.img-6.2.0-34-generic
                ?? = ??             boot/initrd.img.old
     
    =================== nvme0n1p4: 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 14387 Dec 18  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
     
    ======================== Unknown MBRs/Boot Sectors/etc =========================
     
    Unknown BootLoader on nvme0n1p2
     
     
    ================================= User choice ==================================
     
    Is there RAID on this computer? no
     
     
     
    ====================== Installed session with Root on ZFS ======================
     
    zpool list NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
    bpool  1.88G   462M  1.42G        -         -     0%    24%  1.00x    ONLINE  -
    rpool  1.81T   243G  1.57T        -         -     3%    13%  1.00x    ONLINE  -
     
    SOURCE                                           FSTYPE                   SIZE   USED  AVAIL USE% TARGET
    /dev/mapper/keystore-rpool                       ext4                     437M    28K 403.1M   0% /run/keystore/rpool
    rpool/ROOT/ubuntu_6usaiw                         zfs                      1.7T 205.9G   1.5T  12% /
    rpool/USERDATA/tdavis_mtocmd                     zfs                      1.5T    11G   1.5T   1% /home/tdavis
    rpool/USERDATA/root_mtocmd                       zfs                      1.5T  95.3M   1.5T   0% /root
    rpool/ROOT/ubuntu_6usaiw/srv                     zfs                      1.5T   384K   1.5T   0% /srv
    rpool/ROOT/ubuntu_6usaiw/usr/local               zfs                      1.5T   133M   1.5T   0% /usr/local
    rpool/ROOT/ubuntu_6usaiw/var/games               zfs                      1.5T   256K   1.5T   0% /var/games
    rpool/ROOT/ubuntu_6usaiw/var/lib                 zfs                      1.5T   5.3G   1.5T   0% /var/lib
    rpool/ROOT/ubuntu_6usaiw/var/log                 zfs                      1.5T 812.1M   1.5T   0% /var/log
    rpool/ROOT/ubuntu_6usaiw/var/spool               zfs                      1.5T   5.5M   1.5T   0% /var/spool
    rpool/ROOT/ubuntu_6usaiw/var/mail                zfs                      1.5T   256K   1.5T   0% /var/mail
    rpool/ROOT/ubuntu_6usaiw/var/snap                zfs                      1.5T   4.8M   1.5T   0% /var/snap
    rpool/ROOT/ubuntu_6usaiw/var/www                 zfs                      1.5T   256K   1.5T   0% /var/www
    rpool/ROOT/ubuntu_6usaiw/var/lib/NetworkManager  zfs                      1.5T   384K   1.5T   0% /var/lib/NetworkManager
    rpool/ROOT/ubuntu_6usaiw/var/lib/AccountsService zfs                      1.5T   256K   1.5T   0% /var/lib/AccountsService
    rpool/ROOT/ubuntu_6usaiw/var/lib/apt             zfs                      1.5T 164.5M   1.5T   0% /var/lib/apt
    rpool/ROOT/ubuntu_6usaiw/var/lib/dpkg            zfs                      1.5T  90.8M   1.5T   0% /var/lib/dpkg
    /dev/sda2                                        ext4                   788.9G  23.6G 725.1G   3% /media/backup
    bpool/BOOT/ubuntu_6usaiw                         zfs                      1.7G 459.6M   1.3G  26% /boot
    /dev/nvme0n1p1                                   vfat                     511M  14.3M 496.7M   3% /boot/efi
    /dev/nvme0n1p1[/grub]                            vfat                     511M  14.3M 496.7M   3% /boot/grub
    rpool/ROOT/ubuntu_6usaiw[/usr/share/hunspell]    zfs                      1.7T 205.9G   1.5T  12% /var/snap/firefox/common/host-hunspell
    //redwood/d-drive                                cifs                   931.4G 104.8G 826.5G  11% /media/redwood_d_drive
     
     
     
     
    Suggested repair: ______________________________________________________________
     
    The default repair of the Boot-Repair utility would not act on the boot.
     
    Confirmation request before suggested repair: __________________________________
     
    You may want to retry after mounting your encrypted partitions so that the tool can verify their contents. (sudo cryptsetup luksOpen /dev/nvme0n1p2 myvolume)
    Are you sure you want to continue anyway?
    

我运行了一下update-grub,结果如下:

    root@birch:/etc/default# update-grub
    Sourcing file `/etc/default/grub'
    Sourcing file `/etc/default/grub.d/init-select.cfg'
    Sourcing file `/etc/default/grub.d/kdump-tools.cfg'
    Generating grub configuration file ...
    Found linux image: vmlinuz-6.2.0-34-generic in rpool/ROOT/ubuntu_6usaiw
    Found initrd image: initrd.img-6.2.0-34-generic in rpool/ROOT/ubuntu_6usaiw
    Found linux image: vmlinuz-6.2.0-33-generic in rpool/ROOT/ubuntu_6usaiw
    Found initrd image: initrd.img-6.2.0-33-generic in rpool/ROOT/ubuntu_6usaiw
    Warning: didn't find any valid initrd or kernel.
    Warning: didn't find any valid initrd or kernel.
    Warning: didn't find any valid initrd or kernel.
    Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
    Warning: os-prober will not be executed to detect other bootable partitions.
    Systems on them will not be added to the GRUB boot configuration.
    Check GRUB_DISABLE_OS_PROBER documentation entry.
    Adding boot menu entry for UEFI Firmware Settings ...

最后一行让我感到困扰,因为没有关于 Linux 的条目。

配置/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=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="splash resume=UUID=2ea078a9-4754-4da5-a869-b70baf650372"
GRUB_CMDLINE_LINUX_DEFAULT="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=1024x768,auto
 
# 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"

另外,值得注意的是 CFM 模式已被禁用。

运行后,update-grub我检查 mount /boot/efi 文件夹中的文件是否发生变化。时间戳更改为我运行命令时的时间:

    tdavis@birch:~$ tree -pD /boot/efi
    [drwxr-xr-x Dec 31  1969]  /boot/efi
    ├── [drwxr-xr-x Dec 12  2022]  EFI
    │   ├── [drwxr-xr-x Dec 12  2022]  BOOT
    │   │   ├── [-rwxr-xr-x Oct 17 16:19]  BOOTX64.EFI
    │   │   ├── [-rwxr-xr-x Oct 17 16:19]  fbx64.efi
    │   │   └── [-rwxr-xr-x Oct 17 16:19]  mmx64.efi
    │   └── [drwxr-xr-x Dec 12  2022]  ubuntu
    │       ├── [-rwxr-xr-x Oct 17 16:19]  BOOTX64.CSV
    │       ├── [-rwxr-xr-x Oct 17 16:19]  grub.cfg
    │       ├── [-rwxr-xr-x Oct 17 16:19]  grubx64.efi
    │       ├── [-rwxr-xr-x Oct 17 16:19]  mmx64.efi
    │       └── [-rwxr-xr-x Oct 17 16:19]  shimx64.efi
    └── [drwxr-xr-x Oct 17 16:18]  grub
        ├── [drwxr-xr-x Dec 12  2022]  fonts
        │   └── [-rwxr-xr-x Oct 17 16:19]  unicode.pf2
        ├── [-rwxr-xr-x Aug  9  2022]  gfxblacklist.txt
        ├── [-rwxr-xr-x Oct 17 16:18]  grub.cfg
        ├── [-rwxr-xr-x Oct 17 16:39]  grubenv
        ├── [drwxr-xr-x Oct 15 16:47]  i386-pc
        ├── [drwxr-xr-x Oct 17 16:19]  locale
        │   ├── [-rwxr-xr-x Oct 17 16:19]  en_AU.mo
        │   ├── [-rwxr-xr-x Oct 17 16:19]  en_CA.mo
        │   ├── [-rwxr-xr-x Oct 17 16:19]  en_GB.mo
        │   └── [-rwxr-xr-x Oct 17 16:19]  [email protected]
        ├── [-rwxr-xr-x Jun 28 12:04]  unicode.pf2
        └── [drwxr-xr-x Oct 17 16:19]  x86_64-efi
            ├── [-rwxr-xr-x Oct 17 16:19]  acpi.mod
            ├── [-rwxr-xr-x Oct 17 16:19]  adler32.mod
            ├── [-rwxr-xr-x Oct 17 16:19]  affs.mod
    .
    .
    .
            ├── [-rwxr-xr-x Oct 17 16:19]  zfscrypt.mod
            ├── [-rwxr-xr-x Oct 17 16:19]  zfsinfo.mod
            ├── [-rwxr-xr-x Oct 17 16:19]  zfs.mod
            └── [-rwxr-xr-x Oct 17 16:19]  zstd.mod
     
    8 directories, 295 files

相关内容