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.

marked as duplicate by GAD3R, elbarna, G-Man, Romeo Ninov, schily Oct 23 '18 at 10:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


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



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

  • That is my /etc/default/grub configuration. However the /boot/grub/grubenv file just shows # GRUB Environment Block next_entry = #######...######### – R Cassani Oct 22 '18 at 18:13
  • Since your question was about grub2, did you check /boot/grub2/grubenv? – PhoenixCoder Oct 23 '18 at 3:45
  • you could also check the output of this command: grub2-editenv list – PhoenixCoder Oct 23 '18 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 Oct 23 '18 at 18:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.