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.
Asked
Active
Viewed 666 times
1 Answers
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
PhoenixCoder
- 45
- 1
- 8
-
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 03:45
-
you could also check the output of this command: **grub2-editenv list** – PhoenixCoder Oct 23 '18 at 03: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