Grub2 Menu

I recently build a new computer, upgrading my hardware for the first time since 2010. I went over the top and selected high quality parts, ASUS ROG STRIX X570-E motherboard, AMD RYZEN 9 3950X processor, Gskill memory from ASUS compatiblity list for this motherboard, and Corsair Force MP600 NVMe PCIe Gen4 x4 M.2 1TB SSD for root and boot file systems. For Graphics I’m using ASUS Phoenix GTX 1650 PH-GTX1650-04GD6 4GB Video Card. In addition I have a couple 4TB Seagate hard drives for storage of my home directory as wells as photo, music, videos.

I initially installed windows 10 and let it run for approximately 1 month just to make check my build and hardware choices, as well as a burn in time. Everything worked flawlessly.

I then installed Fedora 33 workstation as a new install removing windows completely.
After an extended time of fine tuning my Fedora 33 install and discovering apps that I had missed, I think I’m close to having my system back to par with my 11 year old system. This was my first initial install except for VM’s to try new releases since Fedora 20. My old system is also running Fedora 33 but it has gotten their by system-upgrade.

The system boots far faster than my old system and my backups complete 5 hours sooner, all things to make me happy.

This was my first install of an efi boot system and thus my question.

The system nevers provides me with a boot menu as I’m accustomed to. When I run dnf list installed kernel it shows 3 different kernels. When I run grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg this is my output:

SU: # grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
Generating grub configuration file …
Adding boot menu entry for UEFI Firmware Settings …
done

It doesn’t show any menu entries as I would expect with my old system which was BIOS.

In researching this I find a file /boot/efi/EFI/fedora/grubenv in which there is a parameter menu auto hide that is set to 1.
ie.
SU: # less /boot/efi/EFI/fedora/grubenv

GRUB Environment Block

saved_entry=a113782b536540c7b1ad40d63bb9b213-5.13.12-100.fc33.x86_64
menu_auto_hide=1
boot_success=1
boot_indeterminate=0
#############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################

My question is can I just edit this file? And would setting this auto hide parameter to 0 allow me to see a menu.

Recently we have been receiving a new kernels very frequently and I’m having strange behavior on the system that would be helpful to try to boot to an older kernel where I didn’t see these issues to see if the issue is fixed.

Sorry for long post but any help appreciated.
Edward

The grub menu is hidden by default. Is it not also hidden on the older system?

You can see it by holding the shift key down when you power on.

You can also set it to show always by a simple change in one of the grub config files, then running the grub2-mkconfig again to make the change active.

What I did was edit the file /etc/grub.d/12_menu_auto_hide and change the lines where it said
set timeout_style=hidden
to
set timeout_style=menu

I also changed the “set timeout=0” to “set timeout=5”

You can set the timeout to whatever length you feel appropriate, but these changes will cause the menu to display during boot.

Note that some future update to grub may overwrite that file, but in almost 2 years of updates and system upgrades since hiding the menu became default I have not seen that happen.

IIRC, before I did a new install about 2 years ago the grub menu was always displayed, and I had been running with system upgrades for several years at that time.

Well the menu has been available to me since I installed Fedora 20. As I stated I was always on bios grub boot not efi and wasn’t sure what that changed. I will try the edits you suggested. I had found any thing mentioning the /etc/grub.d/12_menu_auto_hide file. I didn’t know of it’s existence. I had set GRUB_TIMEOUT=5 in /etc/default/grub but nothing changed. Not sure what that parameter is for.

I think the entry in /etc/default/grub is as the names says, default, and are over-ridden by the settings from grub.cfg. The entries from the files in /etc/grub.d are put into grub.cfg.

Did you run grub-mkconfig after that?

The settings in /etc/default/grub are usually used to generate grub.cfg.

When I look at 12_menu_auto_hide the behavior is dependent on a couple of variables being true, one being menu_auto_hide and other being menu_hide_ok. I see the menu_auto_hide in /boot/efi/EFI/fedora/grubenv but I don’t know how it is set. It is not in /etc/default/grub. It would be nice to know where these parameters originate and make changes there rather than in the program. In my case I know the menu_auto_hide is true but the menu_hide_ok is unknown to me. Its looks like that whole block of code would do nothing if menu_hide_ok is false or non-existent. Where can I find the state of menu_hide_ok?

Fedora is now using grub2 with BLS, it makes lots of settings in /etc/default/grub not being used.

The latest way to unhide the grub2 menu is:

sudo grub2-editenv - unset menu_auto_hide

https://discussion.fedoraproject.org/t/how-to-disable-grub2-menu-auto-hide/76519/4?u=sampsonf

2 Likes

Or press the ESC key if this is more comfortable.

Did you run grub-mkconfig after that? Yes

Does grub2-editenv command replace grub2-mkconfig?

No, that sets the value you asked about,

There are limited options that can be set in the grubenv file.

No, no need to make config after editing grubenv.

Hi Edward,

Did you try adding (or added)

GRUB_DISABLE_SUBMENU=true

and

GRUB_ENABLE_BLSCFG=false

to /etc/default/grub and then running (as root or sudo):

# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg


  • ‘disable submenu true’ gives the full menu again

  • ‘enable blscfg false’ = use /etc/default/grub file and not the systemd (BLS) at /boot/loader/entries

  • grub2-mkconfig -o [path-to-cfg] beware that that is the valid location on Fedora 33 and earlier, has changed in Fedora 34, see Fedorawiki on grub2; running grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg as root will generate a new grub.cfg in the right place.

Again, be sure to add GRUB_ENABLE_BLSCFG=false to /etc/default/grub to use the variables set in that file.

this is my working /etc/default/grub:

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=0
GRUB_DISABLE_SUBMENU=true

GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/swap vconsole.font=latarcyrheb-sun16 resume=/dev/dm-0 rd.lvm.lv=fedora/root rhgb quiet blacklist=nouveau rd.driver.blacklist=nouveau modprobe.blacklist=nouveau vga=845 nvidia-drm.modeset=1 acpi_osi=Linux acpi_backlight=vendor audit=0 selinux=0"

GRUB_DISABLE_RECOVERY="false"

GRUB_VIDEO_BACKEND="vbe"
GRUB_TERMINAL_OUTPUT="gfxterm"
GRUB_FONT_PATH=/boot/grub2/DejaVuSansMono.pf2
GRUB_GFXMODE=1920x1080
GRUB_GFXPAYLOAD_LINUX="keep"
GRUB_BACKGROUND=/boot/grub2/LA.jpg
GRUB_ENABLE_BLSCFG=false

Just run the command from @sampsonf.

sudo grub2-editenv - unset menu_auto_hide

What happen to you it’s because Fedora is the only OS installed on your system. During the installation, if Fedora didn’t find another OS on the system, the bootloader will be hidden by default.

1 Like

Sorry for delay in getting info back to all who responded. I ran grub2-editenv - unset menu_auto_hide as suggested by @sampsonf and I now get a menu. It would seem to me to be more transparent if the available options that can be used in /etc/default/grub and what they do were documented. Using a file like /etc/default/grub has as far as I know been the way things like this has always
been handled. How many nefarious commands have sprung up to do things that are hard to find out about. Maybe I getting too old for Linux(Fedora).

I like the explanation from @nippur about options he has in his /etc/default/grub although some I don’t really know what they do. It appears that I can specify a background image at boot and then I guess gnome will replace it with the background choosen in gnome settings after gnome is up.

As far as making changes in the init scripts it would seem that that would put me working against developers and I could be in a constant battle trying to get my system to behave as I would like.

Again, problem solved at this time, but I intend to try some of the settings recommended by @nippur

Thanks to all!

1 Like

May be you could try grub-customizer.

From dnf info grub-customizer info:

Name         : grub-customizer
Version      : 5.1.0
Release      : 7.fc34
Architecture : x86_64
Size         : 3.0 M
Source       : grub-customizer-5.1.0-7.fc34.src.rpm
Repository   : @System
From repo    : fedora
Summary      : Graphical GRUB2 settings manager
URL          : https://launchpad.net/grub-customizer
License      : GPLv3
Description  : Grub Customizer is a graphical interface to configure the
             : grub2/burg settings with focus on the individual list order -
             : without losing the dynamical behavior of grub.
             : 
             : The goal of this project is to create a complete and intuitive
             : graphical grub2/burg configuration interface. The main feature is
             : the boot entry list configuration - but not simply by modified
             : the grub.cfg: to keep the dynamical configuration, this
             : application will only edit the script order and generate proxies
             : (script output filter), if required.

For that see: https://www.gnu.org/software/grub/manual/grub/grub.html#Configuration

About the graphical grub-customizer: i personally don’t like it

I like this font type for my grub menu, read grub2 - Can GRUB font size be customised? - Unix & Linux Stack Exchange for how to ajust font type for grub2

Indeed the background picture for my grub menu, I used a .jpg file 1920x1080, can be any dimension your monitor is capable of. Put it in /boot/grub2 too (both can be put anywhere on the /boot partition as long as you ajust the path to it in /etc/default/grub)