1

Is there a file that contains the option of the GRUB2 menu that was chosen for the current boot? This question is different from obtaining the Kernel boot sequence, for example, to differentiate two boot options with the same boot sequence.

1 Answers1

1

I belive if you have set the grub to save the default grub boot, like so:

/etc/default/grub:

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

Then you will find it in the /boot/grub2/grubenv file

# more /boot/grub2/grubenv

# GRUB Environment Block
saved_entry=CentOS Linux (3.10.0-693.21.1.el7.x86_64) 7 (Core)

For more info, please go here https://www.gnu.org/software/grub/manual/grub/html_node/Environment-block.html