How do I fix the error "`/EFI/fedora/grubenv' not found."

I have set the menu to be hidden and if called up enabled the GFX mode.

Whenever I start the computer, I get the error:

error: …/…/grub-core/fs/fshelp.c:257:file `/EFI/fedora/grubenv’ not found.

This does not hamper anything, but I feel this is not necessary and tells me that something is not quite right. While the exact message may have slightly changed over the time (e.g. the given line number), I think I got this since Fedora 28 or something. So, I would like to finally get it fixed.

My “/etc/default/grub” looks like this (omitting any commented-out lines):

GRUB_DISTRIBUTOR="$(sed ‘s, release .*$,g’ /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_TIMEOUT=2
GRUB_TIMEOUT_STYLE=countdown
GRUB_SAVEDEFAULT=true
GRUB_DISABLE_SUBMENU=false
GRUB_TERMINAL_OUTPUT="gfxterm"
GRUB_GFXMODE=800x600x32,800x600x24,800x600x16,800x600x8
GRUB_DISABLE_OS_PROBER=true
GRUB_CMDLINE_LINUX=“rd.lvm.lv=Samsung_SSD_860_PRO_1TB/system rhgb quiet intel_iommu=on rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1”
GRUB_DISABLE_RECOVERY=“true”
GRUB_ENABLE_BLSCFG=true

The bold sections are the ones I manually added/changed. The remainder, I believe, is either default or came from driver installations.

Is there anything in there causing this behavior?

1 Like

Try this way:

sudo dnf -y reinstall grub2-common
sudo grub2-editenv create
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo dracut -f --regenerate-all
1 Like

Thanks! However, unfortunately this did not do anything to the error message.

When I run all four commands in order, only two produce any output. These are:

sudo dnf -y reinstall grub2-common
Last metadata expiration check: 0:49:27 ago on Wed 23 Jun 2021 04:20:25 PM CEST.
Installed package grub2-common-1:2.06~rc1-4.fc34.noarch (from updates) not available.
Error: No packages marked for reinstall.

sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file …
Adding boot menu entry for UEFI Firmware Settings …
done

When I run sudo dnf list grub2-common, I get:

Last metadata expiration check: 0:52:43 ago on Wed 23 Jun 2021 04:20:25 PM CEST.
Installed Packages
grub2-common.noarch                                                               1:2.06~rc1-4.fc34                                                               @updates
Available Packages
grub2-common.noarch                                                               1:2.06-2.fc34                                                                   updates

While I was not aware that I had a release candidate installed before running this command, this is likely not tied to the issue due to the long history of this error message.

Also of note:
Many cases when Fedora gets updated, I fresh-install instead of upgrading it, to make sure I do not carry over anything from the previous versions. All I keep is my data partition holding my user and other non-system-related information.
After the installation, I then run a script to adjust the settings I always want to have, including GRUB. Considering GRUB, all this script does is really just the above, commenting out any lines it replaces (so I have some lines starting with #, e.g. #GRUB_TIMEOUT=5).

It is important to reinstall the package to restore the configuration generated by the RPM script:
https://src.fedoraproject.org/rpms/grub2/blob/f34/f/grub2.spec#_351-389
So, install the relevant system updates and proceed with the method mentioned above.

1 Like

Usually the first thing I do before asking for help, I totally forgot that I still had pending updates.

I applied them and redid the steps you outlined. This time it worked… and the error is gone as well.

Thank you very much!

1 Like

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