New kernel installed but does not shown in grub

I have installed kernel 5.14.9-1 and after rebooting it does not boot into the latest kernel, Grub Menu only shows 5.13.19-2 and its fallback.
So far I have tried reinstalling the kernel.

➜  ~ uname -r
5.13.19-2-MANJARO
➜  ~ mhwd-kernel -li
Currently running: 5.13.19-2-MANJARO (linux513)
The following kernels are installed in your system:
   * linux513
   * linux514
   * linux515
➜  ~ sudo update-grub
[sudo] password for garvit-joshi: 
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-5.15-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-5.15-x86_64.img
Found initrd fallback image: /boot/initramfs-5.15-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.14-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-5.14-x86_64.img
Found initrd fallback image: /boot/initramfs-5.14-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.13-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-5.13-x86_64.img
Found initrd fallback image: /boot/initramfs-5.13-x86_64-fallback.img
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.
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...

The output you posted shows 3 installed kernels and all are detected while generating the grub config file…

Yes, But when I reboot every time 5.13 kernel is used. I GRUB Menu when I go to Advanced option there also 5.13 and fallback is listed.

Can you give output of ls /boot/grub/ -l?

➜  ~ ls /boot/grub/ -l
total 56
drwxr-xr-x 2 root root  4096 Oct  5 20:54 fonts
-rw-r--r-- 1 root root  6468 Oct  5 20:55 grub.cfg
-rw------- 1 root root  8399 Oct  7 02:53 grub.cfg.new
-rw-r--r-- 1 root root  1024 Oct  5 20:55 grubenv
drwxr-xr-x 2 root root  4096 Oct  7 02:48 locale
drwxr-xr-x 3 root root  4096 Oct  5 20:54 themes
drwxr-xr-x 2 root root 20480 Oct  7 02:48 x86_64-efi

Can you post the following files:

/boot/grub/grub.cfg and grub.cfg.new ?

This apparently denotes an issue in your /etc/default/grub config file or one of the scripts used to generate the /boot/grub/grub.conf file

You made a change or installed something that breaks the grub configuration file generation process.

Think of what you did in the past two days as apparently on October 5th you properly generated your grub.conf file.

I was trying to make things work so I did this

sudo grub-install --recheck --no-rs-codes 
sudo update-grub

Before that, on October 5 ,I reinstalled manajro from new ISO,and then just changed the GRUB background color from manjaro themes(/usr/share/grub/themes/manjaro/theme.txt), and did update-grub. Nothing More.

grub.cfg

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="${saved_entry}"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

set menu_color_normal=light-gray/black
set menu_color_highlight=green/black

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
insmod gfxmenu
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_14.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_24.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_48.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_bold_16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_mono_12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-14.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-18.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b14.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b18.pf2
insmod png
set theme=($root)/usr/share/grub/themes/manjaro/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=hidden
  set timeout=5
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 5 ; then
  set timeout=0
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Manjaro Linux' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-46702065-bed3-4f5e-a152-5c50607902b3' {
	savedefault
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
	linux	/boot/vmlinuz-5.13-x86_64 root=UUID=46702065-bed3-4f5e-a152-5c50607902b3 rw  quiet udev.log_priority=3
	initrd	/boot/amd-ucode.img /boot/initramfs-5.13-x86_64.img
}
submenu 'Advanced options for Manjaro Linux' $menuentry_id_option 'gnulinux-advanced-46702065-bed3-4f5e-a152-5c50607902b3' {
	menuentry 'Manjaro Linux (Kernel: 5.13.19-2-MANJARO x64)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.13.19-2-MANJARO x64-advanced-46702065-bed3-4f5e-a152-5c50607902b3' {
	savedefault
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
		linux	/boot/vmlinuz-5.13-x86_64 root=UUID=46702065-bed3-4f5e-a152-5c50607902b3 rw  quiet udev.log_priority=3
		initrd	/boot/amd-ucode.img /boot/initramfs-5.13-x86_64.img
	}
	menuentry 'Manjaro Linux (Kernel: 5.13.19-2-MANJARO x64 - fallback initramfs)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.13.19-2-MANJARO x64-fallback-46702065-bed3-4f5e-a152-5c50607902b3' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
		linux	/boot/vmlinuz-5.13-x86_64 root=UUID=46702065-bed3-4f5e-a152-5c50607902b3 rw  quiet udev.log_priority=3
		initrd	/boot/initramfs-5.13-x86_64-fallback.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/nvme0n1p1)' --class windows --class os $menuentry_id_option 'osprober-efi-7405-A3BC' {
	savedefault
	insmod part_gpt
	insmod fat
	search --no-floppy --fs-uuid --set=root 7405-A3BC
	chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
	fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### 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.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/41_snapshots-btrfs ###
### END /etc/grub.d/41_snapshots-btrfs ###

### BEGIN /etc/grub.d/60_memtest86+ ###
if [ "${grub_platform}" == "pc" ]; then
    menuentry "Memory Tester (memtest86+)" --class memtest86 --class gnu --class tool {
        search --fs-uuid --no-floppy --set=root  46702065-bed3-4f5e-a152-5c50607902b3
        linux16 /boot/memtest86+/memtest.bin 
    }
fi
### END /etc/grub.d/60_memtest86+ ###

grub.cfg.new:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="${saved_entry}"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

set menu_color_normal=light-gray/black
set menu_color_highlight=green/black

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_IN
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
insmod gfxmenu
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_14.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_24.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_48.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_bold_16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/dejavu_sans_mono_12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-14.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-18.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b12.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b14.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b16.pf2
loadfont ($root)/usr/share/grub/themes/manjaro/terminus-b18.pf2
insmod png
set theme=($root)/usr/share/grub/themes/manjaro/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=hidden
  set timeout=5
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 5 ; then
  set timeout=0
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Manjaro Linux' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-46702065-bed3-4f5e-a152-5c50607902b3' {
        savedefault
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
        linux   /boot/vmlinuz-5.15-x86_64 root=UUID=46702065-bed3-4f5e-a152-5c50607902b3 rw  quiet udev.log_priority=3
        initrd  /boot/amd-ucode.img /boot/initramfs-5.15-x86_64.img
}
submenu 'Advanced options for Manjaro Linux' $menuentry_id_option 'gnulinux-advanced-46702065-bed3-4f5e-a152-5c50607902b3' {
        menuentry 'Manjaro Linux (Kernel: 5.15.rc4.211005.g9e1ff30-1-MANJARO x64)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.rc4.211005.g9e1ff30-1-MANJARO x64-advanced-46702065-bed3-4f5e-a152-5c50607902b3' {
        savedefault
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
                linux   /boot/vmlinuz-5.15-x86_64 root=UUID=46702065-bed3-4f5e-a152-5c50607902b3 rw  quiet udev.log_priority=3
                initrd  /boot/amd-ucode.img /boot/initramfs-5.15-x86_64.img
        }
        menuentry 'Manjaro Linux (Kernel: 5.15.rc4.211005.g9e1ff30-1-MANJARO x64 - fallback initramfs)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.rc4.211005.g9e1ff30-1-MANJARO x64-fallback-46702065-bed3-4f5e-a152-5c50607902b3' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
                linux   /boot/vmlinuz-5.15-x86_64 root=UUID=46702065-bed3-4f5e-a152-5c50607902b3 rw  quiet udev.log_priority=3
                initrd  /boot/initramfs-5.15-x86_64-fallback.img
        }
        menuentry 'Manjaro Linux (Kernel: 5.14.9-1-MANJARO x64)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.14.9-1-MANJARO x64-advanced-46702065-bed3-4f5e-a152-5c50607902b3' {
        savedefault
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
                linux   /boot/vmlinuz-5.14-x86_64 root=UUID=46702065-bed3-4f5e-a152-5c50607902b3 rw  quiet udev.log_priority=3
                initrd  /boot/amd-ucode.img /boot/initramfs-5.14-x86_64.img
        }
        menuentry 'Manjaro Linux (Kernel: 5.14.9-1-MANJARO x64 - fallback initramfs)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.14.9-1-MANJARO x64-fallback-46702065-bed3-4f5e-a152-5c50607902b3' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
                linux   /boot/vmlinuz-5.14-x86_64 root=UUID=46702065-bed3-4f5e-a152-5c50607902b3 rw  quiet udev.log_priority=3
                initrd  /boot/initramfs-5.14-x86_64-fallback.img
        }
        menuentry 'Manjaro Linux (Kernel: 5.13.19-2-MANJARO x64)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.13.19-2-MANJARO x64-advanced-46702065-bed3-4f5e-a152-5c50607902b3' {
        savedefault
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
                linux   /boot/vmlinuz-5.13-x86_64 root=UUID=46702065-bed3-4f5e-a152-5c50607902b3 rw  quiet udev.log_priority=3
                initrd  /boot/amd-ucode.img /boot/initramfs-5.13-x86_64.img
        }
        menuentry 'Manjaro Linux (Kernel: 5.13.19-2-MANJARO x64 - fallback initramfs)' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.13.19-2-MANJARO x64-fallback-46702065-bed3-4f5e-a152-5c50607902b3' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root 46702065-bed3-4f5e-a152-5c50607902b3
                linux   /boot/vmlinuz-5.13-x86_64 root=UUID=46702065-bed3-4f5e-a152-5c50607902b3 rw  quiet udev.log_priority=3
                initrd  /boot/initramfs-5.13-x86_64-fallback.img
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/nvme0n1p1)' --class windows --class os $menuentry_id_option 'osprober-efi-7405-A3BC' {
        savedefault
        insmod part_gpt
        insmod fat
        search --no-floppy --fs-uuid --set=root 7405-A3BC
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
        fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### 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.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/41_snapshots-btrfs ###

Is your installation a btrfs one? Also what did you change exactly in GRUB?

I suppose the issue lies in grub-btrfs as it is where it stops in the grub.cfg.new file

### BEGIN /etc/grub.d/41_snapshots-btrfs ###

It stops at the start of this script generated output.

Are you on a btrfs installation?

//EDIT: anyway, the fact that your grub.cfg file is not updated and you have a leftover grub.cfg.new file shows that something breaks during the update-grub process apparently. Now the thing is to find what breaks and fix it.

1 Like

You should move grub.cfg to backup file (e.g. grub.bckup)

and

overwrite grub.cfg with grub.cfg.new.

Then the kernels 5.13, 5.14 and 5.15 should show up.

1 Like

That will work as the grub.cfg.new file seem to be correct but that will not fix the root of the issue. He should find what is breaking the grub.cfg creation.

1 Like

Yes … I have not done anything other then the above mentioned steps. For now i will fix the system.
Thanks @omano @Keruskerfuerst .

Hey, I just reinstalled manjaro from ISO 21.1.4 and still the problem exists.
The only commands i have run are these:

sudo pacman-mirrors --api --set-branch unstable
sudo pacman -Syu
pamac build google-chrome
uname -r
exit
sudo pacman -Syu

Still not fixed. Also my PC is in Dual boot with windows 11.

Hello,
grub-btrfs 4.10 break grub-mkconfig
grub-btrfs 4.10.2 solved this.
Sorry for the inconvenience.

4 Likes

Thanks.

@garvitjoshi9 As a temporary measure until this version lands, you can replace /etc/grub.d/41_snapshots-btrfs with the fixed version from: grub-btrfs/41_snapshots-btrfs at a790ff054e76b5997cde294ad9674e448ec12d53 · Antynea/grub-btrfs · GitHub

2 Likes

Thanks This Worked.

Yeah that was my guess. Thanks for the follow up and the fix. At first I was wondering why a new user would reply to me about the issue, then I found out you are the creator of this package :smiley:

:+1:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.