GRUB_SAVEDEFAULT not respected

After some recent updates I discovered Kernel 5.19 doesn’t yet play too well for me.
I also have Kernel 5.18 & that is fine.

Previously in this situation, I could choose my kernel at the grub menu & then Manjaro would always use that kernel as default until I changed the boot option.

Now this no longer works …? so I checked why this may be…

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

You should use these options in the grub to remember the last used kernel for booting … I do already have these options set, but now it does not work. Only the newer kernel boots unless I explicitly choose it every time.

Did you had those entries in your grub config file or did you add them? If you added them, have you executed sudo update-grub afterwards?

They were always there since installation.

Just to be sure I issued sudo update-grub & rebooted a few times. But 5.19 is still always the default.

If you don’t want to use 5.19, boot into 5.18 and uninstall 5.19, that’s the easiest solution for the moment.

Selectingt the kernel ist work done from grub.

You can have a look into the arch-grub-wiki to locate the problem

And please post:

ls -lA /boot/grub/grubenv ; cat /boot/grub/grubenv 
ls -lA /boot/grub/grubenv    ; cat /boot/grub/grubenv

-rw-r--r-- 1 root root 1024  6月 15 20:43 /boot/grub/grubenv
# GRUB Environment Block
# WARNING: Do not edit this file by tools other than grub-editenv!!!
menu_auto_hide=1
boot_success=1
saved_entry=gnulinux-advanced-b9ee3b75-9ee6-4c8c-9edf-fd672dd6813c>gnulinux-5.18.16-1-MANJARO x64-advanced-b9ee3b75-9ee6-4c8c-9edf-fd672dd6813c
################################################################

Interesting the saved entry says 5.18 but that is not what is used by default.

mine:

cat /boot/grub/grubenv                                                                                                                                              
# GRUB Environment Block
# WARNING: Do not edit this file by tools other than grub-editenv!!!
menu_auto_hide=1
boot_success=1
saved_entry=1>2
################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################### 

please try:

sudo grub-set-default "1>2" ; cat /boot/grub/grubenv 

this will boot the second kernel in the list

Please google for “grub saved_entry” :wink:

But be aware of the limitations of grub save-default in conjunction with btrfs

GRUB_SAVEDEFAULT=true

This will only work if /boot is not a btrfs, because grub cannot write to btrfs. But it will generate a misleading error message: “sparse file not allowed. Press any key to continue.”.

Thanks.

I applied grub-set-default "1>2" & confirmed that the grubenv now read saved_entry=1>2
I rebooted & let the grub select the default system.
It booted 5.19
Now the grubenv reads

cat /boot/grub/grubenv

# GRUB Environment Block
# WARNING: Do not edit this file by tools other than grub-editenv!!!
menu_auto_hide=1
boot_success=1
saved_entry=gnulinux-simple-b9ee3b75-9ee6-4c8c-9edf-fd672dd6813c
####################

I dont have btrfs. The efi boot partition is fat32 & my system partition is ext4

My Grub menu shows manjaro first & the manjaro submenu has 5.19, 5.19(f), 5.18, 5.18(f) so with the zero offset 1>2 should be the 3rd (5.18) but it is not & then it is overwritten anyway.

This is useful info, but it still doesn’t explain why the SAVEDEFAULT is not working at all. As I expect, which is to use the last explicitly chosen option.

what kernels do you have in grub?

1>2

boots the 3rd SubEntry in the 2nd line of grub

In my case this is my 2nd newest kernel :wink: (5.18)

I do use btrfs, so i have to change this manually. A>nd it works for me with the numbers :man_shrugging:

  • Manjaro Linux
  • Manjaro (Advanced options)
    • 5.19
    • 5.19 (fallback)
    • 5.18
    • 5.18 (fallback)
  • Archcraft
  • Archcraft (Advanced options)
    • Archcraft
    • Kernel
    • Fallback
    • Recovery

After rebooting again & explicitly choosing 5.18, the grubenv has now reverted to the original setting 4 posts above. But the default booted is still 5.19

saved_entry=gnulinux-advanced-b9ee3b75-9ee6-4c8c-9edf-fd672dd6813c>gnulinux-5.18.16-1-MANJARO x64-advanced-b9ee3b75-9ee6-4c8c-9edf-fd672dd6813c

So I’m still confused because it looks like the saved_entry is changing to what I select, but it is ignored as the default.

1 Like

Two things here:

  • Are you sure that the installed grub is the one from Manjaro and not from Archcraft? It seems so, as it’s using Manjaro’s config, but just to be sure.

  • And how are you adding Archcraft entries? As far as I remember os-prober just add a single entry for other operating systems.

Hi @cfinnberg ,

  • Yes I use the Manjaro branded grub. If at any time that gets overwritten by a distro on my 2nd partition I re-instate the Manjaro grub with the procedure below.
sudo su -

pacman-mirrors -f 5 && pacman -Syyu
grub-install --recheck --no-rs-codes
update-grub
sync && exit
  • The Archcraft (advanced) entries are just as provided. I haven’t done anything to alter the standard grub options.
    These were automatically available with Manjaro grub, afaik. I only have one Archcraft kernel, so I have no use for the advanced menu, it’s just there.
1 Like