Grub 自动启动进入恢复模式

Grub 自动启动进入恢复模式

硬件信息:

OS: Ubuntu 21.10 impish
Kernel: x86_64 Linux 5.13.0-21-generic
Uptime: 25m
Packages: 2223
Shell: bash 5.1.8
Resolution: 2560x1600
DE: Gnome 
WM: Mutter
WM Theme: Orchis
GTK Theme: Orchis-light [GTK2/3]
Icon Theme: Papirus
Font: Ubuntu 11
Disk: 55G / 916G (7%) (SSD) 
CPU:  AMD Ryzen 9 3900X 3.8 x 12
GPU: AMD Radeon™ Graphics
RAM:  2045 / 16384 MB  

最近,我使用最新的内核启动 grub-recovery 模式来修复损坏/etc/fstab,从那时起我的系统总是启动到恢复模式*。

我的系统启动到恢复模式后一切都正常,但问题是为什么它会自动开始启动到恢复模式?


$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=072236f0-42d6-4d8a-b91b-cea0f3f9bda3 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=B2DE-DE92  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0


$ lsblk -f
NAME  FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda                                                                          
├─sda1
│     vfat   FAT32       E7C1-FF6E                                           
├─sda2
│     vfat   FAT32       B2DE-DE92                                           
├─sda3
└─sda5
      ext4   1.0         072236f0-42d6-4d8a-b91b-cea0f3f9bda3  811.8G     6% /
sr0                                                                          

$ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu impish InRelease                               
Hit:2 http://security.ubuntu.com/ubuntu impish-security InRelease                     
Hit:3 http://archive.ubuntu.com/ubuntu impish-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu impish-updates InRelease
Ign:5 https://repo.vivaldi.com/stable/deb stable InRelease
Hit:6 http://archive.ubuntu.com/ubuntu impish-backports InRelease
Hit:7 https://repo.vivaldi.com/stable/deb stable Release
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.

Disklabel type: dos
Disk identifier: 0xc1b15721

Device     Boot   Start        End    Sectors   Size Id Type
/dev/sda1  *       2048    1050623    1048576   512M  b W95 FAT32
/dev/sda2       1050624    2101247    1050624   513M  b W95 FAT32
/dev/sda3       2103294 1953523711 1951420418 930.5G  5 Extended
/dev/sda5       2103296 1953523711 1951420416 930.5G 83 Linux

Partition 3 does not start on physical sector boundary.

$ sudo 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.13.0-21-generic
Found initrd image: /boot/initrd.img-5.13.0-21-generic
Found linux image: /boot/vmlinuz-5.11.0-39-generic
Found initrd image: /boot/initrd.img-5.11.0-39-generic
Found linux image: /boot/vmlinuz-5.11.0-38-generic
Found initrd image: /boot/initrd.img-5.11.0-38-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done

$ cat /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=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="noplymouth"
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"

$ blkid
/dev/sda5: UUID="072236f0-42d6-4d8a-b91b-cea0f3f9bda3" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="c1b15721-05"
/dev/sda1: UUID="E7C1-FF6E" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="c1b15721-01"
/dev/sda2: UUID="B2DE-DE92" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="c1b15721-02"
  • 注意:- 在启动到恢复模式时,它不会要求我选择恢复选项。它会自动选择“恢复启动”选项。所以,简而言之,我得到了 grub 救援模式的 UI,它无法正常启动,通常会显示/dev/sda1 clean XXXX file and XXXX blocks但现在它以闪电般的速度向我显示一些奇怪的消息,并显示“欢迎使用 Ubuntu”,然后开始加载服务。最后我得到了正常的登录屏幕。该界面与我在 grub 恢复模式下获得的界面完全相同,但它没有给我任何恢复选项并恢复启动。

日志:

$ sudo tail -f /var/log/syslog
Dec 30 12:02:12 linux systemd[4454]: tmp-sanity\x2dmountpoint\x2d1303829251.mount: Deactivated successfully.
Dec 30 12:02:12 linux systemd[1]: tmp-sanity\x2dmountpoint\x2d1303829251.mount: Deactivated successfully.
Dec 30 12:02:12 linux snapd[57152]: daemon.go:335: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
Dec 30 12:02:12 linux systemd[1]: Started Snap Daemon.
Dec 30 12:02:17 linux snapd[57152]: daemon.go:502: gracefully waiting for running hooks
Dec 30 12:02:17 linux snapd[57152]: daemon.go:504: done waiting for running hooks
Dec 30 12:02:17 linux snapd[57152]: daemon stop requested to wait for socket activation
Dec 30 12:02:17 linux systemd[1]: snapd.service: Deactivated successfully.
Dec 30 12:02:20 linux systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
Dec 30 12:06:45 linux kernel: [ 2569.626771] perf: interrupt took too long (4925 > 4920), lowering kernel.perf_event_max_sample_rate to 40500

$ sudo tail -f kern.log
Dec 30 11:44:48 linux kernel: [ 1253.063844] ntfs: driver 2.1.32 [Flags: R/O MODULE].
Dec 30 11:44:48 linux kernel: [ 1253.179625] QNX4 filesystem 0.2.3 registered.
Dec 30 11:44:48 linux kernel: [ 1253.462950] Btrfs loaded, crc32c=crc32c-intel, zoned=yes
Dec 30 11:47:55 linux kernel: [ 1439.954861] perf: interrupt took too long (3936 > 3930), lowering kernel.perf_event_max_sample_rate to 50750
Dec 30 11:56:09 linux kernel: [ 1934.146717] loop0: detected capacity change from 0 to 8
Dec 30 11:56:29 linux kernel: [ 1954.091673] loop0: detected capacity change from 0 to 8
Dec 30 11:56:36 linux kernel: [ 1961.124764] loop0: detected capacity change from 0 to 8
Dec 30 12:01:56 linux kernel: [ 2281.144210] loop0: detected capacity change from 0 to 8
Dec 30 12:02:12 linux kernel: [ 2297.021541] loop0: detected capacity change from 0 to 8
Dec 30 12:06:45 linux kernel: [ 2569.626771] perf: interrupt took too long (4925 > 4920), lowering kernel.perf_event_max_sample_rate to 40500

$ sudo tail -f auth.log
Dec 30 12:08:08 linux sudo: pam_unix(sudo:session): session opened for user root by someone(uid=1002)
Dec 30 12:08:29 linux sudo: pam_unix(sudo:session): session closed for user root
Dec 30 12:09:10 linux sudo:   someone : TTY=pts/2 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/tail -f kern.log
Dec 30 12:09:10 linux sudo: pam_unix(sudo:session): session opened for user root by someone(uid=1002)
Dec 30 12:09:48 linux sudo: pam_unix(sudo:session): session closed for user root
Dec 30 12:10:08 linux sudo:   someone : TTY=pts/2 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/tail -f boot.log
Dec 30 12:10:08 linux sudo: pam_unix(sudo:session): session opened for user root by someone(uid=1002)
Dec 30 12:10:24 linux sudo: pam_unix(sudo:session): session closed for user root
Dec 30 12:11:17 linux sudo:   someone : TTY=pts/2 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/tail -f auth.log
Dec 30 12:11:17 linux sudo: pam_unix(sudo:session): session opened for user root by someone(uid=1002)

我知道我的分区乱了。但我对此无能为力。我很确定这不是由于分区 D: 造成的

grub-editenv list没有输出任何东西。

相关内容