Hi all… First time posting here. I hope my asking this doesn’t offend… Here goes:
I’m running Fedora 44. I noticed today that my system is still running kernel version 7.0.12-201, which I thought was weird since newer versions have been released…
Some digging revealed the following:
paul@Gandalf:~$ rpm -q kernel
kernel-7.0.12-201.fc44.x86_64
kernel-7.2.5-200.fc44.x86_64 <=== should be booting that, right?
Is Fedora the only operating system on your machine?
In particular, I am wondering if there is another Linux distro, which provides GRUB on your system and which might have discovered Fedora’s kernel. But this other system would not automatically pick up Fedora’s updated kernels.
That is weird. If there is an issue with the saved default, which I have seen happen, it should at least list all the installed kernels. What is the output of the following command:
Fedora’s GRUB supports the Bootloader Specification (BLS), and assembles its menu from the fragments in this directory. A GRUB from another distro might not support it (or at least not look in there), relying on discovery of the actual kernel files instead. This is another reason why I suspect another GRUB being involved.
You told grub to always boot the last kernel you choose from the grub menu.
Change GRUB_SAVEDEFAULT=true to false and rebuild your grub to turn this off.
Fedora’s the only OS on the system. I run Windows in a virtual machine, but that’s not really relevant to this discussion. This used to be a dual-boot PC, with Windows 11 as the main OS, and I cycled through various Linux distros (Ubuntu, OpenSUSE, Fedora) as a secondary OS…
But when I went Fedora full-time, I wiped the partitions on the SSD. so /boot and /boot/efi should only have Fedora related stuff on them.
paul@Gandalf:~$ sudo ls /boot/loader/entries/
dccfddc851a046a19cb30a72160149e0-0-rescue.conf dccfddc851a046a19cb30a72160149e0-7.2.5-200.fc44.x86_64.conf
dccfddc851a046a19cb30a72160149e0-7.0.12-201.fc44.x86_64.conf
You are indeed correct. I added that for poops and giggles after running out of other ideas. The behaviour was the same before I added that line, so it didn’t really change anything. I’ve gotten rid of it.
Something is very weird here (which I guess you know already). The loader entries are for kernel 7.0.12 and 7.2.5. Yet your GRUB is showing 7.0.11 and 7.0.12, and I have no idea where 7.0.11 would even be coming from.
Let’s see which GRUB/shim your system is actually booting. What is the output of efibootmgr?
Also run lsblk -f -o +PARTUUID so you can match up the PARTUUID with the uuid from the efibootmgr listing.
Also run sudo grub2-editenv - list.
The file /boot/grub2/grub.cfg should show which grub is actually being used so
run sudo cat /boot/grub2/grub.cfg. This file contains file system uuids which points to the boot file system which can be matched up with the lsblk listing from above.
This option in the /etc/default/grub file will always save the last kernel selected as the default and no other kernel will boot until the user manually selects a different kernel from the grub menu.
I recommend that you remove that particular option from that file, then run the command sudo dnf reinstall kernel\* to reinstall the latest kernel and at the same time to update the /boot/grub2/grubenv and the /boot/grub2/grub.cfg files. This should make the newest kernel the default and allow booting from it.
The suggestion above was to change that from GRUB_SAVEDEFAULT=true to GRUB_SAVEDEFAULT=false which is not really correct. It should be removed entirely.
Running the command sudo grub2-editenv - list should show the content of that grubenv file to verify the content seems reasonable. It should look something like this.
The saved_entry should be the last kernel booted and menu_auto_hide may or may not be present depending if the user wants the menu to always be displayed or not.
@mostlyharmless
This is the content of an /etc/default/grub file on a vanilla install of f44.
I note there are several differences in the content you posted and potentially that may be the source of your issues.
**paul@Gandalf:\~$ efibootmgr**
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0001
Boot0000\* Fedora HD(2,GPT,1e6b61ba-b5a0-4890-9bf1-eaf9964c9788,0x1dd000,0x5f800)/\\EFI\\FEDORA\\SHIMX64.EFI
Boot0001\* Fedora HD(2,GPT,1e6b61ba-b5a0-4890-9bf1-eaf9964c9788,0x1dd000,0x5f800)/\\EFI\\FEDORA\\SHIM.EFI0000424f
paul@Gandalf:\~$
paul@Gandalf:\~$
**paul@Gandalf:\~$ lsblk -f -o +PARTUUID**
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS PARTUUID
sda
└─sda1 swap 1 51c94f50-a771-464d-be3b-25336873ceba \[SWAP\] faf8c204-683d-4c0f-b4c4-e7215f6dab4a
sdb
├─sdb1 ext4 1.0 Extra Space 14a0d297-90cf-429b-bdc9-253b18595475 152.2G 73% /mnt/extraSpace 60db9c45-a3e4-45e8-8428-3f27b4208537
└─sdb2 17e8dd36-0ee2-4d51-a456-2c88e2a73c48
sdc
├─sdc1 ntfs 3CBFF4BC7BE36A09 de9fb8db-db8d-4824-997a-b4a071308934
└─sdc2 ext4 1.0 Spinning Platter 0d616bc6-2e33-4d57-bcc5-554ba6dd0171 2.1T 0% /mnt/spinningPlatter c8c1cf7b-e220-4bf3-bd42-fa98af2cb5a1
sdd
└─sdd1 vfat FAT32 301B-11A1 3a7adad9-01
sde
sdg
sdh
sr0
zram0 swap 1 zram0 21de44f2-36b1-4350-b2ed-2fcfd3587fc0 \[SWAP\]
nvme0n1
├─nvme0n1p1 ext4 1.0 46638b64-86a5-4ad3-ba6b-b28540f5f20d b4b86d7d-d56c-4d7f-9afd-7833b9971be1
├─nvme0n1p2 vfat FAT16 B025-7DC4 170.8M 10% /boot/efi 1e6b61ba-b5a0-4890-9bf1-eaf9964c9788
├─nvme0n1p3 btrfs System Partition ae2dfa03-8181-44c2-8b12-f93bf5f1c064 154.7G 33% / ac517e19-b2f4-4efb-b40d-6a4703be4585
└─nvme0n1p4 btrfs User Home 020065ac-8b3d-4a1c-aa03-b36dab6f7e68 243G 65% /home ce4f495e-18c2-46c3-b99f-872c2a42c438
nvme1n1
└─nvme1n1p1 ext4 1.0 Second SSD a903d855-64de-4238-ab77-30e566a61c7c 921.4G 70% /mnt/secondSSD 0915ecc2-5d4e-4268-a193-0996418437b9
paul@Gandalf:\~$
paul@Gandalf:\~$
**paul@Gandalf:\~$ sudo grub2-editenv - list**
env_block=512+1
saved_entry=dccfddc851a046a19cb30a72160149e0-7.2.5-200.fc44.x86_64
boot_success=1
boot_indeterminate=24
save_default=false
paul@Gandalf:\~$ uname -r
7.0.12-201.fc44.x86_64
paul@Gandalf:\~$
**paul@Gandalf:\~$ sudo cat /boot/grub2/grub.cfg**
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
set pager=1
if \[ -f ${config_directory}/grubenv \]; then
load_env -f ${config_directory}/grubenv
elif \[ -s $prefix/grubenv \]; then
load_env
fi
if \[ "${env_block}" \] ; then
if \[ "${dev}" \]; then
set env_block="(${dev})${env_block}"
else
set env_block="(${root})${env_block}"
fi
export env_block
load_env -f "${env_block}"
fi
if \[ "${next_entry}" \] ; then
set default="${next_entry}"
set next_entry=
if \[ "${env_block}" \] ; then
save_env -f "${env_block}" next_entry
else
save_env next_entry
fi
set boot_once=true
else
set default="0"
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}"
if \[ "${env_block}" \] ; then
save_env -f "${env_block}" saved_entry
else
save_env saved_entry
fi
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
}
terminal_output console
if \[ x$feature_timeout_style = xy \] ; then
set timeout_style=menu
set timeout=1
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=1
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/00_tuned ###
set tuned_params=""
export tuned_params
set tuned_initrd=""
export tuned_initrd
### END /etc/grub.d/00_tuned ###
### BEGIN /etc/grub.d/01_users ###
if \[ -f ${prefix}/user.cfg \]; then
source ${prefix}/user.cfg
if \[ -n "${GRUB2_PASSWORD}" \]; then
set superusers="root"
export superusers
password_pbkdf2 root ${GRUB2_PASSWORD}
fi
fi
### END /etc/grub.d/01_users ###
### BEGIN /etc/grub.d/08_fallback_counting ###
insmod increment
# Check if boot_counter exists and boot_success=0 to activate this behaviour.
if \[ -n "${boot_counter}" -a "${boot_success}" = "0" \]; then
# if countdown has ended, choose to boot rollback deployment,
# i.e. default=1 on OSTree-based systems.
if \[ "${boot_counter}" = "0" -o "${boot_counter}" = "-1" \]; then
set default=1
set boot_counter=-1
# otherwise decrement boot_counter
else
decrement boot_counter
fi
if \[ "${env_block}" \]; then
save_env -f "${env_block}" boot_counter
else
save_env boot_counter
fi
fi
### END /etc/grub.d/08_fallback_counting ###
### BEGIN /etc/grub.d/10_linux ###
insmod part_gpt
insmod btrfs
search --no-floppy --fs-uuid --set=root ae2dfa03-8181-44c2-8b12-f93bf5f1c064
insmod part_gpt
insmod fat
search --no-floppy --fs-uuid --set=boot B025-7DC4
# This section was generated by a script. Do not modify the generated file - all changes
# will be lost the next time file is regenerated. Instead edit the BootLoaderSpec files.
#
# The blscfg command parses the BootLoaderSpec files stored in /boot/loader/entries and
# populates the boot menu. Please refer to the Boot Loader Specification documentation
# for the files format: https://systemd.io/BOOT_LOADER_SPECIFICATION/.
# The kernelopts variable should be defined in the grubenv file. But to ensure that menu
# entries populated from BootLoaderSpec files that use this variable work correctly even
# without a grubenv file, define a fallback kernelopts variable if this has not been set.
#
# The kernelopts variable in the grubenv file can be modified using the grubby tool or by
# executing the grub2-mkconfig tool. For the latter, the values of the GRUB_CMDLINE_LINUX
# and GRUB_CMDLINE_LINUX_DEFAULT options from /etc/default/grub file are used to set both
# the kernelopts variable in the grubenv file and the fallback kernelopts variable.
if \[ -z "${kernelopts}" \]; then
set kernelopts="root=UUID=ae2dfa03-8181-44c2-8b12-f93bf5f1c064 ro amd_iommu=on intel_iommu=off iommu=pt rd.driver.pre=vfio-pci kvm.ignore_msrs=1 "
fi
insmod blscfg
blscfg
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/10_reset_boot_success ###
# Hiding the menu is ok if last boot was ok or if this is a first boot attempt to boot the entry
if \[ "${boot_success}" = "1" -o "${boot_indeterminate}" = "1" \]; then
set menu_hide_ok=1
else
set menu_hide_ok=0
fi
# Reset boot_indeterminate after a successful boot
if \[ "${boot_success}" = "1" \] ; then
set boot_indeterminate=0
# Avoid boot_indeterminate causing the menu to be hidden more than once
elif \[ "${boot_indeterminate}" = "1" \]; then
set boot_indeterminate=2
fi
# Reset boot_success for current boot
set boot_success=0
if \[ "${env_block}" \]; then
save_env -f "${env_block}" boot_success boot_indeterminate
else
save_env boot_success boot_indeterminate
fi
### END /etc/grub.d/10_reset_boot_success ###
### BEGIN /etc/grub.d/12_menu_auto_hide ###
if \[ x$feature_timeout_style = xy \] ; then
if \[ "${menu_show_once}" \]; then
unset menu_show_once
if \[ "${env_block}" \]; then
save_env -f "${env_block}" menu_show_once
else
save_env menu_show_once
fi
set timeout_style=menu
set timeout=60
elif \[ "${menu_auto_hide}" -a "${menu_hide_ok}" = "1" \]; then
set orig_timeout_style=${timeout_style}
set orig_timeout=${timeout}
if \[ "${fastboot}" = "1" \]; then
# timeout_style=menu + timeout=0 avoids the countdown code keypress check
set timeout_style=menu
set timeout=0
else
set timeout_style=hidden
set timeout=1
fi
fi
fi
### END /etc/grub.d/12_menu_auto_hide ###
### BEGIN /etc/grub.d/14_menu_show_once ###
if \[ x$feature_timeout_style = xy \]; then
if \[ "${menu_show_once_timeout}" \]; then
set timeout_style=menu
set timeout="${menu_show_once_timeout}"
unset menu_show_once_timeout
if \[ "${env_block}" \]; then
save_env -f "${env_block}" menu_show_once_timeout
else
save_env menu_show_once_timeout
fi
fi
fi
### END /etc/grub.d/14_menu_show_once ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###
### BEGIN /etc/grub.d/25_bli ###
if \[ "$grub_platform" = "efi" \]; then
if \[ ! insmod bli \]; then
echo "bli module not available"
fi
fi
### END /etc/grub.d/25_bli ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
if \[ "$grub_platform" = "efi" \]; then
if \[ fwsetup --is-supported \]; then
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
fwsetup
}
fi
fi
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/35_fwupd ###
### END /etc/grub.d/35_fwupd ###
### 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 ###
Sorry about the FUBARed formatting up there, everyone. New here, trying to figure things out/ If anyone has any suggestions on how to make things more readable, by all means let me know. It’d be helpful for any future posts.
I am sorry, but I meant to ask for sudo cat /boot/efi/EFI/fedora/grub.cfg, but I wrote sudo cat /boot/grub2/grub.cfg . The file you did show looks fine.
sudo cat /boot/efi/EFI/fedora/grub.cfg is the file which will lead to the boot directory.