Bug 1965800
| Summary: | when booting windows error displayed: /EFI/fedora/grubenv not found | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Matt Gillard <matt-redhat> | ||||
| Component: | grub2 | Assignee: | Javier Martinez Canillas <fmartine> | ||||
| Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 34 | CC: | bgsf42, fmartine, lkundrak, pjones, renie, theo148, thepiguy0, tmvolin | ||||
| Target Milestone: | --- | Keywords: | Reopened | ||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2022-06-07 21:11:06 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
also i appear to still have a grub.cfg in the efi dir $ sudo ls -l /boot/efi/EFI/fedora/ total 12224 -rwx------ 1 root root 112 Apr 21 20:51 BOOTIA32.CSV -rwx------ 1 root root 110 Apr 21 20:51 BOOTX64.CSV drwx------ 2 root root 4096 May 30 10:14 fonts drwx------ 2 root root 4096 May 30 10:47 fw -rwx------ 1 root root 62073 Apr 18 06:00 fwupdx64.efi -rwx------ 1 root root 1598728 Apr 12 09:14 gcdia32.efi -rwx------ 1 root root 2536712 Apr 12 09:14 gcdx64.efi -rwx------ 1 root root 7023 May 30 11:44 grub.cfg -rwx------ 1 root root 7136 Oct 31 2020 grub.cfg.rpmsave -rwx------ 1 root root 1024 May 16 10:44 grubenv -rwx------ 1 root root 1598728 Apr 12 09:14 grubia32.efi -rwx------ 1 root root 2536712 Apr 12 09:14 grubx64.efi -rwx------ 1 root root 676040 Apr 21 20:51 mmia32.efi -rwx------ 1 root root 850032 Apr 21 20:51 mmx64.efi -rwx------ 1 root root 928592 Apr 21 20:51 shim.efi -rwx------ 1 root root 740344 Apr 21 20:51 shimia32.efi -rwx------ 1 root root 928592 Apr 21 20:51 shimx64.efi The grub.cfg in the efi dir should be a minimal config that just loads the one in the /boot directory. Can you please share that file? Also dnf reinstall grub2-common should fix your GRUB config if isn't correct. I also experience this issue on a fresh Fedora 34 install. Having tested a few things, it appears specifically the line "GRUB_SAVEDEFAULT=true" is causing the issue, without this my PC boots without any errors (but of course does not then save which OS was last booted).
I don't believe I have a grubenv file inside /boot/efi/EFI/fedora at all, which is where my PC is looking when the error shows. I have reinstalled the entire grub2 set of packages ("sudo dnf reinstall grub2-*") and the issue disappears (along with my customisations of /etc/default/grub) but comes straight back when I re-run "sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg".
Re-reading your comment, should I be running "sudo grub2-mkconfig -o /boot/grub2/grub.cfg" instead (that is the location of the only other grub.cfg within my /boot folder)? Same problem here on a fresh Fedora 34 install. Immediately after installing Fedora, Windows boots up just fine, but the error appears when: 1) Edit /etc/default/grub to add "GRUB_SAVEDEFAULT=true"; 2) Run "sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg" to apply the option above; While writing this, I came across this link: https://fedoraproject.org/wiki/Changes/UnifyGrubConfig So, I believe the problem is caused by running the grub2-mkconfig with the wrong grub.cfg path. I'll try to reinstall grub try again with the correct path. Yes, I think all these are due re-generating the GRUB config using the old path. I'm closing this but feel free to re-open if there's data that shows isn't this issue. I hope this comment reopens the bug. I believe this was introduced with one of the 2.06-rc1-X updates. It is a bug. prior to this release, grubenv was apparently known (by grubby as well, I assume) to live at /boot/efi/EFI/fedora/grubenv . Whichever update removed that file (owned by package grub2-efi-x64) would tell us when it was introduced. It is clear that grubby and grub2 itself, during boot, know to look for and maintain grubenv at /boot/grub2/grubenv . However, the "savedefault" action in grub2 at runtime is still trying to update a file at /boot/efi/EFI/fedora/grubenv . So the error is somewhere in the neighborhood of savedefault. That logic is still looking in the old location. I need to reboot now to capture the exact error. I think it is assuming a path relative to /boot/efi, which might be part of the problem. I hope savedefault is able to write to a grubenv on a different filesystem (/boot/grub2 is in the /boot partition not the EFI partition mounted at /boot/efi) I now see that the error message is in the subject of this defect :)
It is issued by "grub-core/fs/fshelp.c" or something (the message only displays briefly)
And it is writing to a filename relative to the EFI filesystem. I hope that's not a problem (meaning, I hope "savedefault" is able to write to /boot filesystem where /boot/grub2/grub.cfg and /boot/grub2/grubenv live)
Maintainer: you should be able to recreate this bug pretty easily, just by adding into your /etc/grub.d/40_custom the same content we have on our dual-boot systems, that gets created by os-prober (at bottom of this comment). Your boot will fail of course, but not before you see the error output from "savedefault".
@matt-redhat can you please REOPEN this bug? Apparently I'm not empowered to do that.
Add the following to /etc/grub.d/40_custom
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/nvme0n1p1)' --class windows --class os $menuentry_id_option 'osprober-efi-0AC3-54CC'
{
savedefault
insmod part_gpt
insmod fat
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root 0AC3-54CC
else
search --no-floppy --fs-uuid --set=root 0AC3-54CC
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
# 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
### END /etc/grub.d/30_os-prober ###
Upgraded to Fedora 35. Problem is gone. Please close (as long as the OP agrees) This message is a reminder that Fedora Linux 34 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '34'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 34 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed. Fedora Linux 34 entered end-of-life (EOL) status on 2022-06-07. Fedora Linux 34 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. Thank you for reporting this bug and we are sorry it could not be fixed. I am seeing this exact same behavior after updating from Fedora 37 to Fedora 38. I used both sudo grub2-mkconfig -o /boot/grub2/grub.cfg sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg I still see the error message "grubenv not found" before Windows boots. |
Created attachment 1788054 [details] boot error when selecting windows Description of problem: I upgraded from Fedora 33 -> 34 on a dual boot system with Windows 10 using EFI. Post upgrade when booting to my Windows partition by selecting the appropriate entry in the grub2 boot menu, I got the error that grubenv was not found - however Windows continued to boot successfully afterwards. Also - grub did not remember my last boot selection, even when I have this in my /etc/default/grub: GRUB_DEFAULT=saved GRUB_SAVEDEFAULT=true grubenv appeared to be renamed: /boot/efi/EFI/fedora/grubenv.rpmsave I renamed it back and the error disappeared + Grub remembered my last boot selection as expected. This confuses me as I thought this got moved as of fedora 34 to here: $ sudo ls -l /boot/grub2/ total 16 -rwx------. 1 root root 7033 May 30 11:20 grub.cfg -rw------- 1 root root 1024 May 30 13:40 grubenv drwxr-xr-x. 3 root root 4096 Oct 20 2020 themes Version-Release number of selected component (if applicable): How reproducible: Unsure if I can reproduce. I only upgraded the system once. Steps to Reproduce: 1. Upgrade from fedora 33 -> fedora 34 on UEFI laptop dual booting with windows 2. Boot system 3. Select windows at bootloader 4. Error should display Actual results: Error attached displayed but pressing enter continued windows boot. Expected results: No error be displayed. Additional info: