Because the thread in which this topic has already been discussed is closed, I have to ask my question here in a new thread.
The solution described by @linux-aarhus, for example, means that the latest installed kernel is always booted: GRUB_DEFAULT=0.
However, I have always installed the latest LTS kernel and always want to boot with it. In the boot menu list, this is the 3rd entry from the top. So I selected GRUB_DEFAULT=2, but this led to another error message during the subsequent boot process: GRUB error: sparse file not allowed. What do I have to enter to be able to boot from the LTS kernel?
That cited solution does normally not apply.
It was explicitly about a case where grub had no write access.
The default is: GRUB_DEFAULT=saved
and GRUB_SAVEDEFAULT=true
and it will always boot the newest - or remember the last one that you chose and boot it next time
GRUB_DEFAULT=2
refers to the third entry
… if and when you have one “standard” and one fallback image for each kernel
(as is generated by default)
this will be the second “standard” kernel in the list
This is not the newest - but the second, the older one.
Precisely NOT, as it is known that btrfs cannot write to grub.env, precisely because ext4 is required for this. So you get around this by omitting GRUB_SAVEDEFAULT=true and using GRUB_DEFAULT=* instead. The only problem is that I have not achieved anything with the entry GRUB_DEFAULT=2, although the 3rd entry from above should correspond to a 2 (0 - 1- 2). What have I done wrong?
On sudo less /boot/grub/grub.cfg I get an output which, to be honest, I can’t really do much with. Also, I can’t get the whole content highlighted to copy it here.
My approach was only the following:
Grub boot menu:
mainline kernel
fallback
LTS-kernel
falback
The count starts at 0, so the LTS kernel is 2, but
Thanks ben, but there is no vmlinuz-linux in /boot/, only the two files with the names of my installed kernels:
vmlinuz-6.6-x86-64
and
vmlinuz-6.9-x86-64
I have read the passage in the Arch Wiki, but now I don’t know how to change the row fole. What good is a path with the name of the kernel if it changes again later when I upgrade?
The grub.env file cannot be written by grub in the early stage of loading.
You will have to edit the defaults when the system is up.
This can be don using grub-editenv, for information see man grub-editenv and full manual info grub-editenv
$ grub-editenv --help
Usage: grub-editenv [OPTION...] FILENAME COMMAND
Tool to edit environment block.
Commands:
create Create a blank environment block file.
list List the current variables.
set [NAME=VALUE ...] Set variables.
unset [NAME ...] Delete variables.
Options:
-?, --help give this help list
--usage give a short usage message
-v, --verbose print verbose messages.
-V, --version print program version
If FILENAME is `-', the default value //boot/grub/grubenv is used.
There is no `delete' command; if you want to delete the whole environment
block, use `rm //boot/grub/grubenv'.
Report bugs to <bug-grub@gnu.org>.
This implies that you can preset the saved entry by knowing the entry’s identification - example from my system - yours will of course differ
sudo grub-editenv - set saved_entry=gnulinux-6.6.32-1-MANJARO x64-advanced-07c78795-e8a4-4134-be2e-be5908c5b9f8
or you can specify which entry should be used after reboot
sudo grub-editenv - set next_entry=<the-next-entry>
or you can use the grub-set-default command
$ grub-set-default --help
Usage: grub-set-default [OPTION] MENU_ENTRY
Set the default boot menu entry for GRUB.
This requires setting GRUB_DEFAULT=saved in /etc/default/grub.
-h, --help print this message and exit
-V, --version print the version information and exit
--boot-directory=DIR expect GRUB images under the directory DIR/grub
instead of the /boot/grub directory
MENU_ENTRY is a number, a menu item title or a menu item identifier.
Report bugs to <bug-grub@gnu.org>.
Wenn ich den Eintrag GRUB_TOP_LEVEL="/boot/vmlinuz-6.6-x86-64"
so setze, bin ich auf die genaue Bezeichnung des Kernels festgelegt und muss dann nach jedem Kernelupdate diesen Eintrag wieder anpassen, sonst gibt das ein Problem beim nächsten boot? Ich dachte eher an soetwas, wie GRUB_TOP_LEVEL="/boot/vmlinuz-lts". Geht das nicht?