You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Debian Trixie "Error during grub menu creation (grub/ grub-btrfs error)" when using systemd due to incorrect reference of "grub2-mkconfig" #442
I'm having an issue with the systemd service on Debian Trixie. Whenever a new snapshot is created or deleted I receive the message "Error during grub menu creation". This error does not happen when running the daemon manually (for reasons described below). I enabled verbose logging in the systemd service and after restarting I get this full set of logs:
Aug 02 23:00:01 mail grub-btrfsd[35073]: /.snapshots/ CREATE,ISDIR 48
Aug 02 23:00:01 mail grub-btrfsd[35044]: 35044: Detected snapshot creation/ deletion, recreating Grub menu
Aug 02 23:00:01 mail grub-btrfsd[35099]: 35044: Detected snapshot creation/ deletion, recreating Grub menu
Aug 02 23:00:06 mail grub-btrfsd[35102]: grep: /boot/grub2/grub.cfg: No such file or directory
Aug 02 23:00:06 mail grub-btrfsd[35103]: /usr/bin/grub-btrfsd: line 216: grub2-mkconfig: command not found
Aug 02 23:00:06 mail grub-btrfsd[35044]: [!] Error during grub menu creation (grub/ grub-btrfs error)
Aug 02 23:00:07 mail grub-btrfsd[35044]: 35044: Watching /.snapshots for new snapshots...
Aug 02 23:00:07 mail grub-btrfsd[35107]: Setting up watches.
Aug 02 23:00:07 mail grub-btrfsd[35107]: Watches established.
Only when running via the systemd unit, the script is attempting to access /boot/grub2 and grub2-mkconfig which do not exist. This seems to be caused by the changes in #428. The 'config' file is referenced in the systemd unit as the 'EnvironmentFile'. It seems like systemd is not actually evaluating the if and is just setting the values inside the if body. This behavior seems to align with the docs for EnvironmentFile. I have tested that commenting the whole if block out of the config and restarting the service fixes the issue. It also seems like removing the EnvironmentFile line from the systemd unit also works fine as the config gets sourced by the daemon on start and properly evaluates the IF block.
Activity
vanye-mx commentedon Aug 3, 2026
I have experienced the same issue in MX-Linux.
Distribution: MX Linux 25.2 / Debian 13
grub-btrfs version: master-2026-05-31
Snapshot tool: Snapper
Service: grub-btrfsd.service
Workaround:
Add a systemd drop-in:
[Service]
EnvironmentFile=
After daemon-reload and restart, grub-btrfsd automatically updates
/boot/grub/grub-btrfs.cfg correctly.
mrahawkins commentedon Aug 4, 2026
I have experienced the same issue in debian.
Distribution Debian 13
grub-btrfs version: master-2026-05-31
snapshot tool: timeshift
Service: grub-btrfsd.service
Workaround:
Revert changes in #428, re-make and restart grub-btrfsd service
Antynea commentedon Aug 5, 2026
I performed a revert, that should solve the problem.
mrahawkins commentedon Aug 5, 2026
Thank you @Antynea 😄
Amazing that 3 of us came to report the same bug within 2 days, when the merge that caused it was 3 months ago!
Just wanted to say that grub-btfrfs is an awesome tool and thanks for all your work on it
vanye-mx commentedon Aug 5, 2026
Thank you @Antynea from me, as well. grub-btrfs is a great tool! Thank you for your hard work!