# 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:** 20
**Page:** 1

<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 28, 2024, 4:26am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/1 "2024-01-28T04:26:28Z")

</div>

I’m running RL 9.3 fully updated. When I increase the grub\_timeout setting in the default grub file, the change isn’t applied when I run grub2-mkconfig -o /etc/grub2.cfg. I’m not sure why. Rebooting just gives the same 5 second timeout. I’d like it to be 60 seconds.

Thanks, all

---

<div class="post-metadata">

### Author: ![ElNinijo](https://avatars.discourse-cdn.com/v4/letter/e/46a35a/32.png) [@ElNinijo](https://forums.rockylinux.org/u/ElNinijo)
#### Post date: [January 28, 2024, 6:48am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/2 "2024-01-28T06:48:39Z")

</div>

Try this:

> **grub2-mkconfig -o /boot/grub2/grub.cfg**

---

<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 28, 2024, 12:24pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/3 "2024-01-28T12:24:04Z")

</div>

First, there _is_ a thing about GRUB that is new in 9.3, although it is not about the timeout but kernel options: [https://access.redhat.com/documentation/en-us/red\_hat\_enterprise\_linux/9/html/9.3\_release\_notes/new-features#new-features-boot-loader](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/9.3_release_notes/new-features#new-features-boot-loader)

* * *

The /etc has mere symlinks to grub.cfg. On all el9:

```plaintext
$ ls -l /etc/grub2*
lrwxrwxrwx. 1 root root 22 Oct 9 11:05 /etc/grub2-efi.cfg -> ../boot/grub2/grub.cfg
lrwxrwxrwx. 1 root root 22 Oct 9 11:05 /etc/grub2.cfg -> ../boot/grub2/grub.cfg

```

Logically, the grub2-mkconfig _should_ detect whether is given a symlink, because it will write not only to the grub.cfg but also to files relative to its true location.

---

<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 28, 2024, 4:07pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/4 "2024-01-28T16:07:11Z")

</div>

Well running grub2-mkconfig -o /etc/grub2.cfg as root does update /boot/grub2/grub.cfg for me. It should also work for user with sudo privileges with the command prefaced with sudo.

```auto
sudo grub2-mkconfig -o /etc/grub2.cfg

```

So there is the possibility of user error in typing the command.  
Is RL9.3 the only OS on the machine? Assuming it is posting the contents of these two files may shed some light if no typo’s are involved.

```auto
sudo less /etc/default/grub
GRUB_TIMEOUT=8
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=0
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="resume=UUID=71da8f2b-df89-4d45-b763-9768884fea6f selinux=0 crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true
/etc/default/grub (END)

```

```auto
sudo less /boot/grub2/grubenv
# GRUB Environment Block
# WARNING: Do not edit this file by tools other than grub-editenv!!!
saved_entry=ba3fd5ffa1514c2bb468fa289f69faa0-5.14.0-362.18.1.el9_3.x86_64
menu_auto_hide=1
boot_success=1
boot_indeterminate=0
selinux=0
#########################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
/boot/grub2/grubenv (END)

```

You can copy and paste highlighted text from a terminal using the mouse right click menu. In the forum use the \</\> code block menu option at the top of the editor field to post your output 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: [January 28, 2024, 4:07pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/5 "2024-01-28T16:07:36Z")

</div>

I get the same result either using the -0 parameter or writing to the /etc location. The file is just not written. I’m running the command after using sudo to login. Do I have to actually be logged in as root instead of using sudo? It doesn’t matter what I change in /etc/default/grub. the cfg files isn’t updated at all.

---

<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 28, 2024, 4:14pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/6 "2024-01-28T16:14:28Z")

</div>

See my post above. Use sudo to preface the command and not to logn.

---

<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 28, 2024, 4:15pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/7 "2024-01-28T16:15:39Z")

</div>

Here is contents of both on my system. It’s dual booting Windows 11 and RL 9.3:

```auto
GRUB_TIMEOUT=90
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

# GRUB Environment Block
# WARNING: Do not edit this file by tools other than grub-editenv!!!
saved_entry=1c2f459700c24f9fb6144322a120149f-5.14.0-362.18.1.el9_3.x86_64
menu_auto_hide=1
boot_success=1
boot_indeterminate=0
###############

```

---

<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 28, 2024, 4:30pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/8 "2024-01-28T16:30:15Z")

</div>

I presume you truncated the “#” marks in your post of the grubenv file. If you did not then that file is invalid. Other than that those file contents are not the issue. I suspect you issue is at the command line either a typo or lack of sudo preface.

---

<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 28, 2024, 7:04pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/9 "2024-01-28T19:04:10Z")

</div>

I’m running the command correctly with sudo preface and the grubenv file is truncated. Could there be any other explanation for why the settings in the /etc/defatult/grub file aren’t applied with the command?

---

<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 28, 2024, 8:59pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/10 "2024-01-28T20:59:47Z")

</div>

So, deleting both /boot/grub2/grub.cfg and /boot/efi/EFI/rocky/grub.cfg and then running dnf reinstall grub2-efi\* grub2-common did the trick. My changes in /etc/default/grub were applied, but now changes aren’t applied again if I run the grub-mkconfig command. I would say this is a bug. I’ll have to reinstall grub2-efi and grub2-common each time I want to update the default grub config file.

---

<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 29, 2024, 1:30am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/11 "2024-01-29T01:30:08Z")

</div>

What is the size of the grub.cfg in /boot/efi/EFI/rocky/

Mine is 149 bytes. It is just a stub file pointing to your /boot partition where the real grub.cfg is

```auto
sudo ll /boot/efi/EFI/rocky/grub.cfg
-rwx------ 1 root root 149 Dec 22 2022 /boot/efi/EFI/rocky/grub.cfg

```

If it is 8000 bytes then I know what the problem is.  
I can’t duplicate your issue on my rl9 system. When I change the timeout it is changed in /boot/grub2/grub.cfg.  
If in the past you ran

```auto
sudo grub2-mkconfig -o /boot/efi/EFI/rocky/grub.cfg

```

then you would have overwritten the stub file and made it the author of the boot menu. Your subsequent efforts editing the /boot/grub2/grub.cfg are no longer seen on boot because that file is nolonger read.

---

<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 29, 2024, 3:15am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/12 "2024-01-29T03:15:25Z")

</div>

Mine is 159 bytes:

```auto
ll /boot/efi/EFI/rocky/grub.cfg
-rwx------ 1 root root 159 Jan 28 13:44 /boot/efi/EFI/rocky/grub.cfg

```

What you’re describing isn’t the issue, especially since I reinstalled grub and still get the same thing. It’s also happening on my laptop single booting RL 9.3.

Here is the contents of the /boot/efi/EFI/rocky/grub.cfg file:

```auto
search --no-floppy --root-dev-only --fs-uuid --set=dev 9e81e5dc-7e40-46e9-91c2-92681168f07a
set prefix=($dev)/grub2
export $prefix
configfile $prefix/grub.cfg

```

The fs-uuid is correct based on lsblk -f

---

<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 29, 2024, 9:23am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/13 "2024-01-29T09:23:24Z")

</div>

> [@jbkt23](#):
>
> `sudo grub2-mkconfig -o `

The place, where the value of GRUB\_TIMEOUT from `/etc/default/grub` is used is the  
`/etc/grub.d/00_header` (which is called by `grub2-mkconfig`) and it creates content for the `grub.cfg`.

* * *

I do get:

```auto
$ sudo grub2-mkconfig | grep -3 timeout=10
Generating grub configuration file ...
terminal_output console
if [x$feature_timeout_style = xy] ; then
  set timeout_style=menu
  set timeout=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

Adding boot menu entry for UEFI Firmware Settings ...
done

```

based on:

```auto
$ cat /etc/default/grub
GRUB_TIMEOUT=10
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=af95..042 rd.driver.blacklist=nouveau"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true
GRUB_DISABLE_OS_PROBER=true

```

(but that is with `grub2-tools-2.06-70.el9_3.1.alma.1.x86_64`)

---

<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 29, 2024, 2:37pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/14 "2024-01-29T14:37:26Z")

</div>

I get the same output that you do. This is with `grub2-tools-2.06-70.el9_3.2.rocky.0.2.x86_64`. The variable for timeout is being read properly in the 00\_header script but it isn’t getting written info the /boot/grub2/grub.cfg file.

---

<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 29, 2024, 2:49pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/15 "2024-01-29T14:49:13Z")

</div>

> [@johnquest](#):
>
> /boot/grub2/grub.cfg

If grub2-mkconfig does write what one expects into stdout, but not to file specified with `-o`, then one could redirect the stdout to a file.

Then question remains, why the `-o` fails to write?

---

<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, 2:32am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/16 "2024-01-30T02:32:08Z")

</div>

Is there an official bug reporting location for Rocky where I could report it and have the Rocky team take a look at it?

---

<div class="post-metadata">

### Author: ![label](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@label](https://forums.rockylinux.org/u/label)
#### Post date: [January 30, 2024, 6:59am UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/17 "2024-01-30T06:59:16Z")

</div>

You can report it by reading [this link](https://wiki.rockylinux.org/rocky/bugs/), but as you can see other users are not exhibiting the problem you’re describing. Thus, this may be an isolated issue.

```auto
[root@xmpp01 grub2]# grep timeout= /boot/grub2/grub.cfg
  set timeout=5
  set timeout=5
    set timeout=60
    set orig_timeout=${timeout}
      # timeout_style=menu + timeout=0 avoids the countdown code keypress check
      set timeout=0
      set timeout=1
    set timeout="${menu_show_once_timeout}"
[root@xmpp01 grub2]# grep TIMEOUT /etc/default/grub
GRUB_TIMEOUT=10
[root@xmpp01 grub2]# grub2-mkconfig -o /etc/grub2.cfg
Generating grub configuration file ...
Adding boot menu entry for UEFI Firmware Settings ...
done
[root@xmpp01 grub2]# grep timeout= /boot/grub2/grub.cfg
  set timeout=10
  set timeout=10
    set timeout=60
    set orig_timeout=${timeout}
      # timeout_style=menu + timeout=0 avoids the countdown code keypress check
      set timeout=0
      set timeout=1
    set timeout="${menu_show_once_timeout}"

```

You will need to verify that /etc/grub2.cfg is indeed a symlink to /boot/grub2/grub.cfg.

---

<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, 7:29pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/18 "2024-01-30T19:29:32Z")

</div>

Yes, /etc/grub2.cfg is an active symlink, but only to the root user.

---

<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, 10:41pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/19 "2024-01-30T22:41:37Z")

</div>

It would really help to see the command input you typed in the terminal as well as the following lines of output, for example:

```auto
$ sudo grub2-mkconfig -o /etc/grub2.cfg 
[sudo] password for jbk: 
Generating grub configuration file ...
Found Rocky Linux 8.7 (Green Obsidian) on /dev/sdc2
Adding boot menu entry for UEFI Firmware Settings ...
done

```

and then check the modification time on grub.cfg and post:

```auto
$ sudo ls -la /boot/grub2/
total 48
drwx------. 5 root root 4096 Jan 30 17:13 .
dr-xr-xr-x. 5 root root 4096 Jan 26 07:07 ..
-rw-r--r--. 1 root root 64 Dec 15 2022 device.map
drwx------. 2 root root 4096 Jan 26 07:07 fonts
-rw------- 1 root root 8567 Jan 30 17:15 grub.cfg

```

This might help in diagnosing why you are not succeeding. Today I created a new instance of rl9 in a vm using a boot install image so I would download the latest 9.3 files. I then changed the timeout with the means discussed here to 12 seconds. I rebooted and was shown a menu screen with a 12 second countdown. The default was 5 seconds.

---

<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:32pm UTC](https://forums.rockylinux.org/t/grub2-mkconfig-isnt-applying-settings-in-etc-default-grub/12661/20 "2024-01-30T23:32:44Z")

</div>

```auto
ROCKY-DESK ddev-projects]$ sudo grub2-mkconfig -o /etc/grub2.cfg
Generating grub configuration file ...
Adding boot menu entry for UEFI Firmware Settings ...
done
[stalkert@ROCKY-DESK ddev-projects]$ sudo ls -la /boot/grub2/
total 20
drwx------. 3 root root 68 Jan 30 16:22 .
dr-xr-xr-x. 5 root root 4096 Jan 26 16:12 ..
-rwx------ 1 root root 232 Jan 29 15:33 custom.cfg
drwx------. 2 root root 25 Jan 30 14:58 fonts
-rwx------ 1 root root 6544 Jan 30 16:24 grub.cfg
-rw------- 1 root root 1024 Jan 30 16:17 grubenv

```

Great, so now it’s updating after several reinstalls. I was also running the output to /boot/grub2/grub.cfg. This boot directory has never had a device.map file, if that matters. Another issue is that when I reboot after logging into Rocky, I just boot right back to the OS, The grub menu never appears. I can’t select Windows that I add with the custom.cfg file you see in the directory. grubenv doesn’t get updated. What triggers that to update?

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