# Grub2-mkconfig isn't applying settings in /etc/default/grub

**URL:** https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661
**Category:** Rocky Linux Help & Support
**Tags:** rocky-linux-9
**Created:** [January 28, 2024, 4:26am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661 "2024-01-28T04:26:28Z")
**Posts on this page:** 9
**Page:** 2

<div class="post-metadata">

### Author: ![johnquest](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@johnquest](https://forums.rockylinux.org/u/johnquest)
#### Post date: [January 30, 2024, 11:46pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/21 "2024-01-30T23:46:16Z")

</div>

Here is my /etc/default/grub file again. Is there something that needs to be in these configs to cause the grub menu to appear from every reboot, from when I’m logged in to Rocky or not? I have secure boot set in the bios. The rocky mount is booting /boot/efi/EFI/rocky/shimx64.efi

```auto
GRUB_TIMEOUT=120
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="resume=UUID=7101ee64-4965-41e1-9e3e-affad0737949 rd.lvm.lv=rockydesk/root rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

```

---

<div class="post-metadata">

### Author: ![jbkt23](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jbkt23](https://forums.rockylinux.org/u/jbkt23)
#### Post date: [January 30, 2024, 11:51pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/22 "2024-01-30T23:51:31Z")

</div>

```auto
sudo grub2-editenv - unset menu_auto_hide

```

Will expose the menu on reboot. Please note that the dash preceding “unset” is bracketed by spaces.  
You could have pressed F8 or SHIFT to expose the menu prior to unsetting it.  
How did you set up your sudo environment. Typically you have to issue a password to proceed with the initial command though subsequent sudo invokations within the next 5 minutes do not.

---

<div class="post-metadata">

### Author: ![johnquest](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@johnquest](https://forums.rockylinux.org/u/johnquest)
#### Post date: [January 31, 2024, 2:25am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/23 "2024-01-31T02:25:21Z")

</div>

The user I use sudo with is a member of the wheel group and in sudo config I remove the need for a password for that group. I either run commands directly with sudo or I do sudo -i interaction to become root and then run commands. I’ll try this command gub2-editenv and then reboot.

---

<div class="post-metadata">

### Author: ![johnquest](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@johnquest](https://forums.rockylinux.org/u/johnquest)
#### Post date: [January 31, 2024, 2:34am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/24 "2024-01-31T02:34:39Z")

</div>

Yes, thank you. the grub2-editenv unset command did the trick. Now I’m presented the grub menu on all reboots.

---

<div class="post-metadata">

### Author: ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)
#### Post date: [January 31, 2024, 8:01am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/25 "2024-01-31T08:01:42Z")

</div>

The _(note Simple configuration)_ in `info grub2-mkconfig` describes the content of `/etc/default/grub`

Apparently `GRUB_TIMEOUT_STYLE=menu` should make the menu visible, although the `menu_auto_hide` can rule. There might be a way to avoid that, according to `/etc/grub.d/12_menu_auto_hide`

What adds the `menu_auto_hide` to _grubenv_? The grub2-mkconfig can supposedly update the _grubenv_, so is it the “culprit”?

---

<div class="post-metadata">

### Author: ![jbkt23](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jbkt23](https://forums.rockylinux.org/u/jbkt23)
#### Post date: [February 1, 2024, 12:19am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/26 "2024-02-01T00:19:18Z")

</div>

> [@jlehtone](#):
>
> What adds the `menu_auto_hide` to _grubenv_? The grub2-mkconfig can supposedly update the _grubenv_, so is it the “culprit”?

It’s a default if no other OS is detected. I guess that RH does not consider win11 another OS or win11 is on a separate disk.  
On my vm that I installed RL9 there is a Fedora39 install on the same .vdi that I retained. The rl9 install did not see f39 because that instance uses the btrfs for the root fs but osprober fails to read that so I had no boot menu. I fixed it with the same command I furnished here.

---

<div class="post-metadata">

### Author: ![johnquest](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@johnquest](https://forums.rockylinux.org/u/johnquest)
#### Post date: [February 1, 2024, 3:00am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/27 "2024-02-01T03:00:11Z")

</div>

os prober doesn’t detect Win11 in my setup, but I didn’t inquire as to why. I’ve suspected it’s because of the location of the efi partition on the separate disk I have it installed on. It’s a middle partition on the drive. What’s interesting is that I also put in 2 additional ssd drives that were previously booting windows. The efi partition was still on those disks as the first partition. Windows wasn’t even installed on them and os prober detected both and added them to the grub menu, two “window boot loader” items for each disk. I of course deleted the partitions. But for Win11 I added a custom.cfg file to the /boot/grub2 directory:

```auto
menuentry "Windows 11 Enterprise" {
            insmod part_gpt
            insmod fat
            insmod chain
            search --no-floppy --fs-uuid --set=root FEBA-7422
            chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

```

---

<div class="post-metadata">

### Author: ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)
#### Post date: [February 1, 2024, 8:54am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/28 "2024-02-01T08:54:41Z")

</div>

Yes, the /etc/grub.d/30\_os-prober may add to grub.cfg:

```auto
# Other OS found, undo autohiding of menu unless menu_auto_hide=2
if ["\${orig_timeout_style}" -a "\${menu_auto_hide}" != "2"]; then
  set timeout_style=\${orig_timeout_style}
  set timeout=\${orig_timeout}
fi

```

I do use the `custom.cfg` too. One could override the `timeout_style` in it, because 41\_custom is the last section in grub.cfg.

* * *

> [@jbkt23](#):
>
> > [@jlehtone](#):
> >
> > What adds the `menu_auto_hide` to _grubenv_?
> 
> It’s a default if no other OS is detected.

Being default is not the crucial question. “Who writes the default to grubenv?” is.

Observation: Setting/changing GRUB\_TIMEOUT\_STYLE in /etc/default/grub does not make grub2-mkconfig to touch the menu\_auto\_hide.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)
#### Post date: [April 1, 2024, 8:55am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/29 "2024-04-01T08:55:39Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661.md?page=1)
