Error with grub-btrfsd

Hi you all!

I have updated my grub2 and install grub-btrfs from instruction [GUIDE] Setting up grub-btrfs with timeshift for bootable snapshots BUT it doesnt work for me and I have changed
GRUB_BTRFS_GRUB_DIRNAME="/boot/grub2" to GRUB_BTRFS_GRUB_DIRNAME="/boot/efi/EFI/fedora" and ran sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg against sudo grub2-mkconfig -o /boot/grub2/grub.cfg And it works for me, I see snapshots in my Grub2. But I cannot see there my new snapshots that I have done after these steps, and if I check systemctl status grub-btrfsd I see:

Ă— grub-btrfsd.service - Regenerate grub-btrfs.cfg
     Loaded: loaded (/usr/lib/systemd/system/grub-btrfsd.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Wed 2023-03-15 00:46:47 MSK; 10s ago
   Duration: 40ms
    Process: 6036 ExecStart=/usr/bin/grub-btrfsd --syslog /.snapshots (code=exited, status=1/FAILURE)
   Main PID: 6036 (code=exited, status=1/FAILURE)
        CPU: 34ms

Mar 15 00:46:47 pc-name-fedora systemd[1]: grub-btrfsd.service: Main process exited, code=exited, status=1/FAILURE
Mar 15 00:46:47 pc-name-fedora systemd[1]: grub-btrfsd.service: Failed with result 'exit-code'.

So, I need help. what am I doing wrong?

By default it is configured for snapper. You need to change the arguments to match timeshift instead.

Read here in the section on grub-btrfsd:

That will have overwritten the stub pointer file that redirects grub to the real grub.cfg located at /boot/grub2/grub.cfg.

From this point forward unless you restore the proper file content there you will not see any automatic updates to kernels in your boot process, and may lose the ability to boot unless you manually run grub2-mkconfig in the future.

The fix for that error is simple

  1. sudo rm /boot/efi/EFI/fedora/grub.cfg /boot/grub2/grub.cfg
  2. sudo dnf reinstall grub2-efi* grub2-common
    The reinstall will properly rebuild both those files and normal booting and normal updates should be the result.

During boot grub looks for the file /boot/efi/EFI/fedora/grub.cfg which redirects grub to the other file.
Updates only write to /boot/grub2/grub.cfg. If you overwrite the pointer file then the actual updates are never seen with future boots…

Thanks! But you forgot about generate new file via sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Thanks! Now service works:

â—Ź grub-btrfsd.service - Regenerate grub-btrfs.cfg
     Loaded: loaded (/etc/systemd/system/grub-btrfsd.service; enabled; preset: >
     Active: active (running) since Wed 2023-03-15 20:15:16 MSK; 2min 17s ago
   Main PID: 800 (bash)
      Tasks: 2 (limit: 8195)
     Memory: 1.2M
        CPU: 100ms
     CGroup: /system.slice/grub-btrfsd.service
             ├─800 bash /usr/bin/grub-btrfsd --syslog --timeshift-auto
             └─902 inotifywait -q -q -e create -e delete /run/timeshift

But after I replaced GRUB_BTRFS_GRUB_DIRNAME="/boot/efi/EFI/fedora" with GRUB_BTRFS_GRUB_DIRNAME="/boot/grub2" at the grub-btrfs/config and sudo make install I cannot see fresh snapshots even after sudo grub2-mkconfig -o /boot/grub2/grub.cfg

1 Like

Reinstalling those packages builds both those files new. I cannot speak to how it is managed by grub-btrfs as you are attempting. My method is for a vanilla workstation install and is documented here.

1 Like