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.

0

1 Answer 1

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

4
  • That is my /etc/default/grub configuration. However the /boot/grub/grubenv file just shows # GRUB Environment Block next_entry = #######...#########
    – R Cassani
    Commented Oct 22, 2018 at 18:13
  • Since your question was about grub2, did you check /boot/grub2/grubenv? Commented Oct 23, 2018 at 3:45
  • you could also check the output of this command: grub2-editenv list Commented Oct 23, 2018 at 3:58
  • I checked /boot/grub/grubenv as I'm using Mint, and grub2 commands are named grub, even when the GRUB version is 2.02
    – R Cassani
    Commented Oct 23, 2018 at 18:16

Not the answer you're looking for? Browse other questions tagged .