# How to modify boot menu, boot menu options, and kernel options?

**URL:** <https://forums.rockylinux.org/t/how-to-modify-boot-menu-boot-menu-options-and-kernel-options/9327>\
**Category:** Rocky Linux Help & Support\
**Created:** [March 23, 2023, 12:20pm UTC](https://forums.rockylinux.org/t/how-to-modify-boot-menu-boot-menu-options-and-kernel-options/9327 "2023-03-23T12:20:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![klausfiend](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/klausfiend/32/2377_2.png) [@klausfiend](https://forums.rockylinux.org/u/klausfiend)\
**Post date:** [March 23, 2023, 12:20pm UTC](https://forums.rockylinux.org/t/how-to-modify-boot-menu-boot-menu-options-and-kernel-options/9327/1 "2023-03-23T12:20:39Z")

</div>

Hi there,

I’ve been flailing a bit trying to figure out how Rocky 8.x does boot management, and after a few false starts trying to figure this out, it looks it’s `systemd-boot`.

I ended up way down a rabbit hole because `grubby` and the various `grub2` packages are also installed, but that looks like a red herring, so now what I’m trying to reconcile is how to get `bootctl` to recognize what’s in `/boot/loader/entries`, although I just copied the contents into `/boot/efi/loader/entries`. `bootctl` recognizes them (with errors) but can’t boot from them, and ends up failing through to GRUB, which can.

So I guess after multiple edits of this posting, I think my question is: what _is_ the default boot manager for Rocky?

And what about the default boot loader?

And when the boot manager is GRUB, is `/etc/default/grub` still the correct place to make changes?

And when using EFI, is `/etc/grub2-efi.cfg` the correct target when running `grub2-mkconfig`?

thanks,  
Klaus

---

<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:** [March 23, 2023, 9:16pm UTC](https://forums.rockylinux.org/t/how-to-modify-boot-menu-boot-menu-options-and-kernel-options/9327/2 "2023-03-23T21:16:49Z")

</div>

`grub.cfg` does control the basic behavior of grub and booting. Are you sure you are installed and booting via UEFI? Your `/boot/efi/EFI/rocky` directory does not appear normal.

```auto
[root@xmpp01 ~]# ls -l /boot/efi/EFI/rocky/
total 6100
-rwx------. 1 root root 130 Nov 17 22:29 BOOTX64.CSV
-rwx------. 1 root root 144 Jul 14 2022 grub.cfg
-rwx------. 1 root root 7028 Jul 14 2022 grub.cfg.rpmsave
-rwx------. 1 root root 2525120 Feb 14 12:06 grubx64.efi
-rwx------. 1 root root 856856 Nov 17 22:29 mmx64.efi
-rwx------. 1 root root 947216 Nov 17 22:29 shim.efi
-rwx------. 1 root root 947216 Nov 17 22:29 shimx64.efi
-rwx------. 1 root root 939648 Nov 17 22:29 shimx64-rocky.efi

```

You’re missing many efi files. You might want to check if `/sys/firmware/efi` exists, which will tell you if you are indeed booting via UEFI. You should also have an entirely separate `/boot/efi` partition, which is a requirement in UEFI scenarios.

---

<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:** [March 23, 2023, 10:24pm UTC](https://forums.rockylinux.org/t/how-to-modify-boot-menu-boot-menu-options-and-kernel-options/9327/3 "2023-03-23T22:24:24Z")

</div>

Given the contents of your EFI/rocky directory I can give a basic outline of how it should work.  
First in /etc there should be two grub links pointing to /boot/grub2/grub.cfg

```auto
lrwxrwxrwx. 1 root root 22 Feb 14 14:06 grub2.cfg -> ../boot/grub2/grub.cfg
lrwxrwxrwx 1 root root 22 Feb 14 14:06 grub2-efi.cfg -> ../boot/grub2/grub.cfg

```

The grub.cfg in rocky is a stub file pointing to the partition that contains your vmlinuz and boot loader files /boot/loader/entries

To update the grub menu parameter (not kernel parameters ) like the timeout the command is:

```auto
grub2-mkconfig -o /boot/grub2/grub.cfg

```

To change kernel parameters you have to use the grubby command. Read the man page. But, understand that to add parameters you have to state all the kernel commandline parameters as grubby can’t append. What that means in particular is that when adding parameters you have to state all of them including the “root=UUID=” portion of the commandline.

---

<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:** [March 23, 2023, 10:52pm UTC](https://forums.rockylinux.org/t/how-to-modify-boot-menu-boot-menu-options-and-kernel-options/9327/4 "2023-03-23T22:52:02Z")

</div>

If the /boot/efi was quite empty, then the system does not boot with EFI, but in legacy mode – how could you have booted?  
Therefore, adding files to /boot/efi does not help anything.

In legacy mode the grub.cfg and grubenv are in `/boot/grub2/`. The symlink “grubenv” in that location is confusing.

> [@jbkt23](#):
>
> First in /etc there should be two grub links pointing to /boot/grub2/grub.cfg
> 
> ```auto
> lrwxrwxrwx. 1 root root 22 Feb 14 14:06 grub2.cfg -> ../boot/grub2/grub.cfg
> lrwxrwxrwx 1 root root 22 Feb 14 14:06 grub2-efi.cfg -> ../boot/grub2/grub.cfg
> 
> ```
> 
> The grub.cfg in rocky is a stub file pointing to the partition that contains your vmlinuz and boot loader files /boot/loader/entries

You have Rocky 9, don’t you? Rocky 8 and 9 do differ.

---

<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:** [March 23, 2023, 11:50pm UTC](https://forums.rockylinux.org/t/how-to-modify-boot-menu-boot-menu-options-and-kernel-options/9327/5 "2023-03-23T23:50:48Z")

</div>

Yes I am on rocky 9. I guess the real test if the OP is booting efi or not is just to issue this command:  
efibootmgr  
So looks like they screwed up the links in /etc by installing the efi file system. But even so the command to update the grub.cfg is as I indicated.  
So the efi file system installed a grub.cfg stub file in /rocky which is counter intuitive if rocky 8 uses the old format where grub.cfg in EFI/ rocky is the real config. Confusing.

---

<div class="post-metadata">

**Author:** ![klausfiend](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/klausfiend/32/2377_2.png) [@klausfiend](https://forums.rockylinux.org/u/klausfiend)\
**Post date:** [March 24, 2023, 12:13am UTC](https://forums.rockylinux.org/t/how-to-modify-boot-menu-boot-menu-options-and-kernel-options/9327/6 "2023-03-24T00:13:51Z")

</div>

As it turned out, `/boot/efi` was going missing from `/etc/fstab` due to a bug in one of our in-house pieces of automation. Definitely Rocky 8, definitely using EFI to boot, just no mount of the EFI partition when the system was running.

I built a new VM where `/boot/efi` is once again present as expected, and lo and behold, expectations are now met when I modify `/etc/default/grub` and run `grub2-mkconfig /etc/grub2-efi.cfg`.

Sorry for the long, convoluted original post, and then the somewhat confusing edit, and thank you @label for your sanity check. Definitely LUSER error.

cheers,  
Klaus

---

<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:** [March 24, 2023, 11:10am UTC](https://forums.rockylinux.org/t/how-to-modify-boot-menu-boot-menu-options-and-kernel-options/9327/7 "2023-03-24T11:10:52Z")

</div>

> [@klausfiend](#):
>
> in-house pieces of automation

Automation is awesome (once it does the right thing). 🙂

* * *

> [@jbkt23](#):
>
> So looks like they screwed up the links in /etc by installing the efi file system. But even so the command to update the grub.cfg is as I indicated.  
> So the efi file system installed a grub.cfg stub file in /rocky which is counter intuitive if rocky 8 uses the old format where grub.cfg in EFI/ rocky is the real config. Confusing.

These are two AlmaLinux 8 systems; one with EFI, other with legacy:

```plaintext
[EFI ~]# ls /sys/firmware/efi
config_table efivars fw_platform_size fw_vendor mok-variables runtime runtime-map systab tables vars
[EFI ~]# ll /boot/grub2/
total 0
lrwxrwxrwx. 1 root root 28 Nov 8 20:54 grubenv -> ../efi/EFI/almalinux/grubenv
[EFI ~]# ll /boot/efi/EFI/almalinux/
total 4876
-rwx------. 1 root root 122 Aug 23 2022 BOOTX64.CSV
drwx------. 2 root root 4096 Nov 8 20:54 fonts
-rwx------. 1 root root 6484 Jul 31 2021 grub.cfg
-rwx------. 1 root root 1024 Nov 27 15:36 grubenv
-rwx------. 1 root root 2219312 Nov 8 20:54 grubx64.efi
-rwx------. 1 root root 859504 Aug 23 2022 mmx64.efi
-rwx------. 1 root root 944496 Aug 23 2022 shimx64-almalinux.efi
-rwx------. 1 root root 944576 Aug 23 2022 shimx64.efi

[legacy ~]# ls /sys/firmware/efi
ls: cannot access '/sys/firmware/efi': No such file or directory
[legacy ~]# ll /boot/grub2/
total 32
-rw-r--r--. 1 root root 84 Aug 4 2020 device.map
drwxr-xr-x. 2 root root 4096 Aug 4 2020 fonts
-rw-r--r--. 1 root root 6417 Jul 31 2021 grub.cfg
-rw-r--r--. 1 root root 1024 Nov 11 10:15 grubenv
drwxr-xr-x. 2 root root 12288 Aug 4 2020 i386-pc
[legacy ~]# ll /boot/efi/EFI/almalinux/
total 0

```

In other words, the path to grub.cfg on **el8** does depend on the EFI/legacy.  
The `grub2-mkconfig` does need that path.

* * *

Here are two AlmaLinux 9, legacy and EFI:

```plaintext
[legacy ~]# ls /sys/firmware/efi
ls: cannot access '/sys/firmware/efi': No such file or directory
[legacy ~]# ls -l /boot/grub2/grub.cfg 
-rwx------. 1 root root 6869 Nov 18 02:54 /boot/grub2/grub.cfg
[legacy ~]# ls -l /boot/efi/EFI/almalinux/grub.cfg
-rwx------. 1 root root 144 Nov 18 02:54 /boot/efi/EFI/almalinux/grub.cfg
[legacy ~]# cat /boot/efi/EFI/almalinux/grub.cfg
search --no-floppy --fs-uuid --set=dev 5f4e93f3-a45c-4dd7-82ff-99b6d88f77a4
set prefix=($dev)/grub2

export $prefix
configfile $prefix/grub.cfg

[EFI ~]# ls /sys/firmware/efi
config_table efivars esrt fw_platform_size fw_vendor mok-variables runtime runtime-map systab vars
[EFI ~]# ls -l /boot/grub2/grub.cfg
-rwx------. 1 root root 6370 May 23 2022 /boot/grub2/grub.cfg
[EFI ~]# ls -l /boot/efi/EFI/almalinux/grub.cfg
-rwx------. 1 root root 144 May 20 2022 /boot/efi/EFI/almalinux/grub.cfg

```

On **el9** the path to grub.cfg is always `/boot/grub2/grub.cfg`.  
(The legacy system has stub in `/boot/efi/EFI/*/` but does not use it.)

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:20am UTC](https://forums.rockylinux.org/t/how-to-modify-boot-menu-boot-menu-options-and-kernel-options/9327/8 "2023-08-25T03:20:12Z")

</div>


