Score:1

Grub automatically boots into Recovery mode

my flag

Hardware Information:

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  

Recently, I booted into grub-recovery mode with the latest available kernel to fix the corrupted /etc/fstab, from then my system always boots into the recovery-mode*.

Everything works fine after my system boots into the recovery mode, but the thing is that why does it automatically start booting into the recovery mode?


$ 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"
  • Note:- While booting into recovery mode, it does not ask me to choose recovery options. It automatically selects the option "resume boot". So, in simple words I get the UI of grub rescue mode, It does not boot normally, normally it shows /dev/sda1 clean XXXX file and XXXX blocks But now it shows me some weird messages at the speed of lightening and Says "Welcome to Ubuntu" and then start loading services. At last I get the normal login screen. The interface is exactly what I get in grub recovery mode but it does not give me any recovery options and resumes the boot.

Logs:

$ 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)

I know my partitions are messed up. But I can not do anything for that. I'm pretty sure that this is not because of partitions D:

grub-editenv list didn't output anything.

Someone avatar
my flag
@nobody `$ grub-editenv list` don't output anything.
ChanganAuto avatar
us flag
*Disklabel type: dos* Why are you using MBR ("msdos") partitioning in a modern UEFI based machine? This makes no sense.
Someone avatar
my flag
@ChanganAuto I have no idea what that means.
in flag
It’s interesting that `sda3` does not start at `2101248`. Was this SSD being used as additional storage before becoming the bootable device?
Someone avatar
my flag
@matigo Yes!.....
Someone avatar
my flag
Earlier my entire system was on HDD then I cloned it into an SSD for better performance.
Someone avatar
my flag
The Hardware information block in the question is the output of the `neofetch` command.
in flag
I thought that might be the case. The message about `sda3` in the output shows a de-sync. So, even though you're using an SSD, you're not going to be getting the full performance because of how the partitions are laid out ...
in flag
Not sure if the error is from the partitions. HDDs and SSDs lay their data out slightly differently, with the spinning disks being more flexible with a couple of details. Only way to say for certain would be to swap the SSD with another and do a fresh install to compare … which would introduce so many variations from the current installation it would be impossible to compare
nobody avatar
gh flag
can you show `grub-editenv list` please.
oldfred avatar
cn flag
You do not show quiet splash in GRUB_CMDLINE_LINUX_DEFAULT=" " in /etc/default/grub. So it just may not be recovery mode but the standard list of the boot process? I prefer to see that and use GRUB_CMDLINE_LINUX_DEFAULT="noplymouth", which also speeds boot slightly. But it would have been better to do new install to SSD & restore data from HDD. And use gpt which UEFI highly suggests & Windows requires with UEFI. Ubuntu does not require gpt, but should. https://wiki.archlinux.org/title/Partitioning#Choosing_between_GPT_and_MBR
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.