Change grub to always use the last started kernel

Hello community,
how do i change grub to always use the last started kernel?
in my list of grub menus, zen is the first kernel, lts is the second and normale is the third.
i want to use lts kernel but i always have to select it manually. cause if i miss the time of 5 seconds i have to restart again :wink:

Hello,
You need to edit /etc/default/grub with these lines :

GRUB_DEFAULT="saved"

...

GRUB_SAVEDEFAULT="true"

then :

sudo grub-mkconfig -o /boot/grub/grub.cfg

Grub will use the last selected kernel as default.

4 Likes

Thanks a lot. Have a nice weekend :wink:

This solution does not work with Btrfs!

2 Likes

This may help with btrfs: https://forum.endeavouros.com/t/new-grub-option-grub-top-level

1 Like

@anon50380917 @manuel
I’ve changed it, rebootet twice… works!

I need to find out how btrfs works

Maybe this will help you as an explanation why Btrfs requires extra sausage. The post is from Dalto, in response to my question about how to determine which kernel to boot under Btrfs.

There is also another way to put the kernel to boot first, which would look like this with the default kernel:

change in /etc/default/grub:

GRUB_TOP_LEVEL="/boot/vmlinuz-linux"
1 Like

Thanks @anon50380917 , this helps a lot!
i’ve been working with ext4 as a file system for years. someday, when i reinstall my current system, i’ll probably consider btrfs. also because i’m using an nvme hard drive. with ext4, everything runs flawlessly for me and i don’t use snapshots (timeshift).

1 Like

I have resisted using Btrfs for a very long time because every previous attempt failed due to the problem with booting the desired kernel (due to my own incompetence). Now that everything is running well (thanks a lot to @dalto) , however, I wouldn’t want to miss it. Timeshift just caused me too many minor problems in the past, and the fact that the developer has abandoned it has reinforced my decision to stop using it. If and when Timeshift will appear from the Linux Mint workshop is just too uncertain. All the best to you!

1 Like

i have never dealt with btrfs just because everything works great with ext4. but in a short research i found phoronix, who clearly recommend btrfs for nvme disks. i will use it someday. christmas holidays are coming soon, so i would have time :wink:

The Btrfs-Assistant from @dalto is a great help :wink:

1 Like

You can also use a menu entry.

2 Likes

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