Skip to content

Debian Trixie "Error during grub menu creation (grub/ grub-btrfs error)" when using systemd due to incorrect reference of "grub2-mkconfig" #442

Closed

Description

@shanebrowncs

Hi,

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.

Happy to provide more detail if needed. Thanks.

Activity

  1. vanye-mx commented on Aug 3, 2026

    @vanye-mx

    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.

  2. mrahawkins commented on Aug 4, 2026

    @mrahawkins

    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

  3. Antynea commented on Aug 5, 2026

    @Antynea
    Owner

    I performed a revert, that should solve the problem.

  4. mrahawkins commented on Aug 5, 2026

    @mrahawkins

    I performed a revert, that should solve the problem.

    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

  5. vanye-mx commented on Aug 5, 2026

    @vanye-mx

    Thank you @Antynea from me, as well. grub-btrfs is a great tool! Thank you for your hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions