I have just installed centos 8 alongside windows 10, and grub shows a menu with three centos entries and windows, with first entry as default.
I want grub to always pre-select the entry I used last boot, e.g. if at some point I boot windows I want the fourth entry in the grub menu (the windows entry) to be pre-selected and the same with centos.
I read here: https://wiki.centos.org/HowTos/Grub2 that this could be achieved by having the next two lines in the /etc/default/grub file:
Code: Select all
GRUB_SAVEDEFAULT=true
GRUB_DEFAULT=saved
Code: Select all
grub2-mkconfig -o /boot/grub2/grub.cfg
here is my /etc/default/grub:
Code: Select all
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto resume=/dev/mapper/cl-swap rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true