I was surprised to discover that in Manjaro, grub2 has the ability to self modify when booting. This comes in the form of remembering the last boot entry you used and automatically selecting it next time the machine is powered on, instead of defaulting to the topmost option.
While this is a harmless albeit useless feature, it implies the boot loader changes itself when picking an entry. I was used to the idea that only the update-grub command (or similar) can make any permanent change to the settings. Editing the config on use just to remember the last booted entry feels unsafe for something so minor considering how important the loader is: What if grub can become corrupted if you abort a boot or the machine is powered off right as you select a menu entry? That risk’s obviously greater if you have a power failure during a grub installation process, albeit that’s only triggered if you update kernels and you know when to be aware. Was curious if there’s more input on this.
I looked in /boot but couldn’t find where this info is stored. My concern is that in the past, I thought the boot loader is fully static and accessed fully as read-only on boot, only edited when the system updates it: Just wanting to make sure there’s no risk in updating any settings during use like that.
prompt> 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
##################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################%
Guys, what the user wanted was that in a dual boot, the last system chosen to boot would not be marked for automatic start and it would be resolved in /etc/default/grub
‘GRUB_DEFAULT’
The default menu entry. This may be a number, in which case it identifies the Nth entry in the generated menu counted from zero, or the title of a menu entry, or the special string ‘saved’.
‘GRUB_SAVEDEFAULT’
If this option is set to ‘true’, then, when an entry is selected, save it as a new default entry for use by future runs of GRUB. This is only useful if ‘GRUB_DEFAULT=saved’
If user wants GRUB to default to first menuentry GRUB_SAVEDEFAULT=true should be commented out to #GRUB_SAVEDEFAULT=true (as already suggested)
but GRUB_DEFAULT=Saved should also be changed to GRUB_DEFAULT=0