Boot order grub items fc39

Hi, I’m new with Fedora, but I like it.

Installed on two of my notebook, on the first one all is ok but on the second one, I’ve same problem with the items listed during the grub boot.

As you may see the last kernel is not on top but in the meddle

If I do:

Blockquotegrub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

system start with first kernel 6.5.11

I would like to start with the last kernel on the first line (6.6.4-200)

How is possible change the order items listed in grub menu?

I hope that all is clear, I’m new with Fedora, I’ve checked in forum but I don’t find any solution.

Thank you since now

That can be a bit tricky as the file /etc/machine-id seems to have been modified. Therefore the normal procedure for removing old entries won’t work, and the sequence of the entries is purely in alphabetical order. Because the old value of machine-id occurs earlier in the alphabet, the entries for that id occurs first in the boot order.

So what needs to be done is to remove the oldest files from the directory /boot/loader/entries/ using the rm command.

thank you, it works good

This command was an error and has been for more than 4 release versions of Fedora.

The correct command would have been grub2-mkconfig -o /boot/grub2/grub.cfg

The command you quoted overwrites the default pointer file at that location (which redirects grub to the file at /boot/grub2/grub.cfg) and will result is the system never seeing new kernel updates.

The fix is simple.

  1. sudo rm -f /boot/grub2/grub.cfg /boot/efi/EFI/fedora/grub.cfg
  2. sudo dnf reinstall grub2-common grub2-efi\*

Then never repeat the command that overwrites the file /boot/efi/EFI/fedora/grub.cfg.

1 Like

I would not have the confidence that I’ll never need to select one of those older kernels.

Apparently, Roberto is fine with that. But someone with a similar problem in the future reading this thread might be misled.

It is harder to rename those files appropriately than to remove them. But it is likely wiser to rename them. That also actually answers the question:

If you run

rpm -q --scripts kernel-core |grep add

you get the commands you can use to reinstate the entries for the older kernels, for example I get

/bin/kernel-install add 6.6.2-201.fc39.x86_64 /lib/modules/6.6.2-201.fc39.x86_64/vmlinuz || exit $?
/bin/kernel-install add 6.6.3-200.fc39.x86_64 /lib/modules/6.6.3-200.fc39.x86_64/vmlinuz || exit $?
/bin/kernel-install add 6.6.4-200.fc39.x86_64 /lib/modules/6.6.4-200.fc39.x86_64/vmlinuz || exit $?

Run these command you you will get the boot entries in the correct order.

1 Like

Thnak you everybody for your help.
I’m fashinated from Fedora and I need to study this version very well.

Thank you again