Bug 2372973

Summary: GRUB is unable to use bootloader header space for grubenv on btrfs (patch available)
Product: [Fedora] Fedora Reporter: Neal Gompa <ngompa13>
Component: grub2Assignee: Nicolas Frayer <nfrayer>
Status: POST --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: agurenko, bmr, btrfs-sig, bugzilla, davdunc, davide, hadichokr, lkundrak, lsandova, lx, michel, mlewando, nfrayer, pjones, samuel-rhbugs, zilexa
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Neal Gompa 2025-06-16 07:16:14 UTC
Currently, if you set up /boot as a btrfs subvolume, you wind up with a situation where the GRUB Hidden Menu feature does not work since grubenv is a file on the volume and cannot be written to since the Btrfs driver is read-only.

The correct fix is to write grubenv in the Btrfs header space allocated specifically for bootloaders. The folks at SUSE have a patch for this that we should import into our grub2 package to resolve this: https://build.opensuse.org/projects/Base:System/packages/grub2/files/grub2-grubenv-in-btrfs-header.patch

Reproducible: Always

Comment 1 Marta Lewandowska 2025-06-16 09:01:55 UTC
Hi Neal,
I can't find this patch upstream... could you please encourage SUSE to send it upstream first?
thanks!

Comment 2 Neal Gompa 2025-06-16 09:13:26 UTC
I will try.

Comment 3 Neal Gompa 2025-06-18 17:24:49 UTC
Michael Chang notified me that he'll be able to look into this within the first two weeks of July.

Comment 4 Marta Lewandowska 2025-06-19 09:43:32 UTC
Great. Thank you for that :)

Comment 5 Hadi Chokr 2025-07-18 08:18:15 UTC
Any Updates from SUSE on upstreaming their patch?

Comment 6 Marta Lewandowska 2025-07-18 09:50:43 UTC
As promised, patch was sent upstream last week: https://lists.gnu.org/archive/html/grub-devel/2025-07/msg00129.html

Comment 7 Neal Gompa 2025-09-16 12:00:26 UTC
There's now a v2 series that needs people to review it: https://lists.gnu.org/archive/html/grub-devel/2025-09/msg00127.html

Comment 8 Neal Gompa 2025-10-07 03:04:17 UTC
The patch series has been revised to version 3: https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00009.html

Comment 9 Neal Gompa 2025-10-10 22:05:11 UTC
The patch series has been revised to version 4: https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00172.html

Comment 10 Marta Lewandowska 2025-10-15 07:24:54 UTC
Thank you for being patient, Neal. I know this is taking a long time, but we've heard from upstream that this patch set is almost there... We hope to be able to get it into fedora for you within the next week.

Comment 11 Neal Gompa 2025-10-16 08:16:46 UTC
The patch series has been revised to version 5: https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00261.html

I believe this is the version that will land upstream.

Comment 12 Neal Gompa 2025-10-17 12:51:33 UTC
The patch series has been revised to version 6: https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00292.html

Comment 13 Marta Lewandowska 2025-10-20 15:28:00 UTC
v6 has been accepted upstream https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00292.html

Comment 14 Marta Lewandowska 2025-10-21 11:53:36 UTC
And this commit is also needed for it to work https://cgit.git.savannah.gnu.org/cgit/grub.git/commit/?id=4f6c4609174d92c8b881bc5adb7fe971dd5cee0b

Comment 15 Neal Gompa 2025-10-23 00:53:58 UTC
(In reply to Marta Lewandowska from comment #13)
> v6 has been accepted upstream
> https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00292.html

Actual link of acceptance: https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00315.html

Comment 16 Leo Sandoval 2025-10-27 18:22:53 UTC
Neal,

I have appended all related patches [1,2] into the dist-git spec file but I would like some testing before merge. 

Can you please test using the scratch build from pull-request [3]? 

Let me know if it works or some other pac

[1] Add support for external environment block on Btrfs
    https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00292.html

[2] kern/fs: Honour file->read_hook() in grub_fs_blocklist_read()
    https://cgit.git.savannah.gnu.org/cgit/grub.git/commit/?id=4f6c4609174d92c8b881bc5adb7fe971dd5cee0b

[3] https://src.fedoraproject.org/rpms/grub2/pull-request/196

Comment 17 zilexa 2026-01-13 13:46:36 UTC
Would be great to see this patch make its way to Grub2.

Comment 18 Leo Sandoval 2026-01-13 16:31:05 UTC
(In reply to zilexa from comment #17)
> Would be great to see this patch make its way to Grub2.

You mean grub2 upstream? Anyway, it is already on fedora (and I believe upstream), see [3] above.