Systemd-boot - prefer another entry (not top one)

I have 2 kernels installed, how do I get systemd-boot to prefer the other kernel on time out?

I have normal arch and the surface kernel installed, need to select the surface kernel by default.

How to change the default entry to boot

There is a default entry inside /efi/loader/loader.conf that determine the default boot entry.

On a new install, it will look something like this:

default 665eca4ae83246df8ec17d1cbc6a1763*

That first string of characters is you entry token which identifies the install. That is important if you are dual-booting with another Linux, otherwise it can be replaced with *. That line supports wildcards and so if you want to boot the LTS kernel by default you could use something like this:

default 665eca4ae83246df8ec17d1cbc6a1763*lts.conf

Alternatively, if you want to boot the mainline kernel by default, something like this should work:

default 665eca4ae83246df8ec17d1cbc6a1763-*-arch?-?.conf

These changes will take effect on the next reboot and nothing else is required except modifying the file.



Brill, new to systemd-boot, haven’t had much chance to look into it - to busy fsck’ing my other computer up :rofl:

I now have two computers running systemd-boot!

Em, once sytemd-boot menu appears, highlight the entry you want to boot by default and press d, that will mark a default entry to boot after timeout.


That will only work until the kernel updates. The solution @pebcak pointed out from the wiki is a better long-term solution.


This is my preferred method, but without the need of d key, the last selected entry is automatically set as default. There is a configuration for this. When the Kernel that is selected last is updated, then I have to reboot anyway and can select the same entry again.

It’s basically the combination of your suggestion with the suggestion of pebcak. Just use @saved as the value, I think that was all, but I don’t remember the details. Lookup here for more:

My current configuration for file /efi/loader/loader.conf:

default @saved
timeout 5
console-mode auto
reboot-for-bitlocker 1

There is also the super easy lazy way like @dzyndzla wrote:

when the boot menu appears move the selector (this will stop the countdown) to your preferred kernel and then press ‘D’ to make it your new default entry.

If you use this method you will have to set it again once in a blue moon.

You literally have to do it on every kernel update. This is because a new entry is installed every time.

With the config file change, you make the change once and it “just works”

1 Like

Done and works well.


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