Timeshift: Unable to start grub-btrfs.path

Hello! I have a strange problem with timeshift and grub-btrfs. When I have open timeshift-gtk, mount unit should looks like
run-timeshift-backup.mount loaded active mounted /run/timeshift/backup But I have something like that:

run-timeshift-7388-backup.mount                       loaded active mounted /run/timeshift/7388/backup
``` where 7388 is pidof timeshift-gtk.

This pidof in name and mount path caused to:
``` systemctl enable --now grub-btrfs.path

Unit /etc/systemd/system/grub-btrfs.path is added as a dependency to a non-existent unit run-timeshift-backup.mount.

Failed to start grub-btrfs.path: Unit run-timeshift-backup.mount not found.

grub-btrfs.path unit looks like:

[Unit]
Description=Monitors for new timeshift snapshots
DefaultDependencies=no
Requires=run-timeshift-backup.mount
After=run-timeshift-backup.mount
BindsTo=run-timeshift-backup.mount
[Path]
PathModified=/run/timeshift/backup/timeshift-btrfs/snapshots
[Install]
WantedBy=run-timeshift-backup.mount

Because of that, grub-btrfs.path is not able to check the location of snapshots and upgrade my grub entries. I have observed this behavior on my laptop and on fresh installation in VM.
Please advise.

I dropped grub-btrfs.path with 22.06.2-2, I’ll push it to the stable branch.

Do you mean timeshift 22.06.2-2? :slight_smile:

Yes, that’s why I mentioned it. :wink:

After upgrade I have a different error:

[lukasz-virtualbox ~]# systemctl enable --now grub-btrfs.path
Unit /usr/lib/systemd/system/grub-btrfs.path is added as a dependency to a non-existent unit \x2esnapshots.mount.
Failed to start grub-btrfs.path: Unit \x2esnapshots.mount not found.
[lukasz-virtualbox ~]# systemctl -t mount
  UNIT                                              LOAD   ACTIVE SUB     DESCRIPTION                              
  -.mount                                           loaded active mounted Root Mount
  dev-hugepages.mount                               loaded active mounted Huge Pages File System
  dev-mqueue.mount                                  loaded active mounted POSIX Message Queue File System
  home.mount                                        loaded active mounted /home
  run-credentials-systemd\x2dsysusers.service.mount loaded active mounted /run/credentials/systemd-sysusers.service
  run-timeshift-6219-backup.mount                   loaded active mounted /run/timeshift/6219/backup
  run-user-1000-doc.mount                           loaded active mounted /run/user/1000/doc
  run-user-1000-gvfs.mount                          loaded active mounted /run/user/1000/gvfs
  run-user-1000.mount                               loaded active mounted /run/user/1000
  swap.mount                                        loaded active mounted /swap
  sys-fs-fuse-connections.mount                     loaded active mounted FUSE Control File System
  sys-kernel-config.mount                           loaded active mounted Kernel Configuration File System
  sys-kernel-debug.mount                            loaded active mounted Kernel Debug File System
  sys-kernel-tracing.mount                          loaded active mounted Kernel Trace File System
  tmp.mount                                         loaded active mounted Temporary Directory /tmp
  var-cache.mount                                   loaded active mounted /var/cache
  var-log.mount                                     loaded active mounted /var/log

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
17 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

[lukasz-virtualbox ~]# cat /etc/systemd/system/\\x2esnapshots.mount.wants/grub-btrfs.path 
[Unit]
Description=Monitors for new snapshots
DefaultDependencies=no
Requires=\x2esnapshots.mount
After=\x2esnapshots.mount
BindsTo=\x2esnapshots.mount

[Path]
PathModified=/.snapshots

[Install]
WantedBy=\x2esnapshots.mount

So the problem is with Timeshift snapshots location. How Can I change it to /.snapshots ?

No, do not change Timeshift snapshots location!
You should only change grub-btrfs.path for Timeshift, Its configuration was default for snapper

  1. Run sudo systemctl edit --full grub-btrfs.path to edit
[Unit]
Description=Monitors for new snapshots
DefaultDependencies=no
Requires=run-timeshift-backup.mount
After=run-timeshift-backup.mount
BindsTo=run-timeshift-backup.mount

[Path]
PathModified=/run/timeshift/backup/timeshift-btrfs/snapshots

[Install]
WantedBy=run-timeshift-backup.mount
  1. Enable it now: sudo systemctl reenable --now grub-btrfs.path

Ok I did it, but path unit still does not recognize changes inside

/run/timeshift/backup/timeshift-btrfs/snapshots

Run-timeshift-backup-mount has still timeshift pid in the name and Path:

  run-timeshift-1061-backup.mount loaded active mounted /run/timeshift/1061/bac>

Unit /etc/systemd/system/grub-btrfs.path is added as a dependency to a non-existent unit run-timeshift-backup.mount.

I do not use Timeshift, but I guess it should be:

[Unit]
Description=Monitors for new snapshots
DefaultDependencies=no

[Path]
PathModified=/run/timeshift/backup/timeshift-btrfs/snapshots

[Install]
WantedBy=multi-user.target

There is ReadMe:

Still does not recognize changes, even I use something like:
[Path]
PathModified=/run/timeshift/*

or

[Path]
PathModified=/run/timeshift/

or
PathModified=/run/timeshift/*/backup/timeshift-btrfs/snapshots

Did you reinstall timeshift-autosnap-manjaro?


  • What is the output of lsblk -f?
  • What is the output of findmnt?

Yes I reinstalled timeshift-autosnap-manjaro.
It’s default installation with swap in swapfile, encrypted in LUKS.

[lukasz-virtualbox ~]# lsblk -f
NAME                                          FSTYPE      FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                                                       
└─sda1                                        crypto_LUKS 1           199e1698-dd2a-493f-bd1a-33bc5f656648                
  └─luks-199e1698-dd2a-493f-bd1a-33bc5f656648 btrfs                   d23e4d4e-36db-4de7-9161-028005c16e95   16,7G    37% /run/timeshift/2373/backup
                                                                                                                          /var/log
                                                                                                                          /var/cache
                                                                                                                          /swap
                                                                                                                          /home
                                                                                                                          /
sr0                                                                                                                       

[lukasz-virtualbox ~]# findmnt
TARGET                         SOURCE                                                         FSTYPE          OPTIONS
/                              /dev/mapper/luks-199e1698-dd2a-493f-bd1a-33bc5f656648[/@]      btrfs           rw,relatime,space_cache=v2,subvolid=256,subvol=/@
├─/proc                        proc                                                           proc            rw,nosuid,nodev,noexec,relatime
│ └─/proc/sys/fs/binfmt_misc   systemd-1                                                      autofs          rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=12326
├─/sys                         sys                                                            sysfs           rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/security       securityfs                                                     securityfs      rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/cgroup             cgroup2                                                        cgroup2         rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot
│ ├─/sys/fs/pstore             pstore                                                         pstore          rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/bpf                bpf                                                            bpf             rw,nosuid,nodev,noexec,relatime,mode=700
│ ├─/sys/kernel/debug          debugfs                                                        debugfs         rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/tracing        tracefs                                                        tracefs         rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/config         configfs                                                       configfs        rw,nosuid,nodev,noexec,relatime
│ └─/sys/fs/fuse/connections   fusectl                                                        fusectl         rw,nosuid,nodev,noexec,relatime
├─/dev                         dev                                                            devtmpfs        rw,nosuid,relatime,size=1515716k,nr_inodes=378929,mode=755,inode64
│ ├─/dev/pts                   devpts                                                         devpts          rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
│ ├─/dev/shm                   tmpfs                                                          tmpfs           rw,nosuid,nodev,inode64
│ ├─/dev/mqueue                mqueue                                                         mqueue          rw,nosuid,nodev,noexec,relatime
│ └─/dev/hugepages             hugetlbfs                                                      hugetlbfs       rw,relatime,pagesize=2M
├─/run                         run                                                            tmpfs           rw,nosuid,nodev,relatime,mode=755,inode64
│ ├─/run/user/1000             tmpfs                                                          tmpfs           rw,nosuid,nodev,relatime,size=305740k,nr_inodes=76435,mode=700,uid=1000,gid=1001,inode64
│ │ ├─/run/user/1000/doc       portal                                                         fuse.portal     rw,nosuid,nodev,relatime,user_id=1000,group_id=1001
│ │ └─/run/user/1000/gvfs      gvfsd-fuse                                                     fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1001
│ └─/run/timeshift/2373/backup /dev/mapper/luks-199e1698-dd2a-493f-bd1a-33bc5f656648          btrfs           rw,relatime,space_cache=v2,subvolid=5,subvol=/
├─/tmp                         tmpfs                                                          tmpfs           rw,nosuid,nodev,nr_inodes=1048576,inode64
├─/var/cache                   /dev/mapper/luks-199e1698-dd2a-493f-bd1a-33bc5f656648[/@cache] btrfs           rw,relatime,space_cache=v2,subvolid=258,subvol=/@cache
├─/home                        /dev/mapper/luks-199e1698-dd2a-493f-bd1a-33bc5f656648[/@home]  btrfs           rw,relatime,space_cache=v2,subvolid=257,subvol=/@home
├─/var/log                     /dev/mapper/luks-199e1698-dd2a-493f-bd1a-33bc5f656648[/@log]   btrfs           rw,relatime,space_cache=v2,subvolid=259,subvol=/@log
└─/swap                        /dev/mapper/luks-199e1698-dd2a-493f-bd1a-33bc5f656648[/@swap]  btrfs           rw,relatime,space_cache=v2,subvolid=260,subvol=/@swap

Those outputs are when timeshift is opened. When I close it, /run/timeshift/2373/backup disappear.

I never thought that it is not standard timesshift path like /run/timeshift/backup/timeshift-btrfs/snapshots/.

What is the output of sudo btrfs subvolume get-default /?

[lukasz-virtualbox ~]# btrfs subvolume get-default /
ID 5 (FS_TREE)

It looks fine.

Does creating a new snapshot work when using Timeshift?

Then check sudo btrfs subvolume list -p /

yes, it works.

[lukasz-virtualbox ~]# btrfs subvolume list -p /
ID 256 gen 1709 parent 5 top level 5 path @
ID 257 gen 1662 parent 5 top level 5 path @home
ID 258 gen 1642 parent 5 top level 5 path @cache
ID 259 gen 1709 parent 5 top level 5 path @log
ID 260 gen 1121 parent 5 top level 5 path @swap
ID 273 gen 1383 parent 5 top level 5 path timeshift-btrfs/snapshots/2022-06-30_11-34-53/@
ID 274 gen 1385 parent 5 top level 5 path timeshift-btrfs/snapshots/2022-06-30_11-34-53/@home
ID 275 gen 1506 parent 5 top level 5 path timeshift-btrfs/snapshots/2022-06-30_12-39-44/@
ID 276 gen 1508 parent 5 top level 5 path timeshift-btrfs/snapshots/2022-06-30_12-39-44/@home
ID 277 gen 1510 parent 5 top level 5 path timeshift-btrfs/snapshots/2022-06-30_12-41-00/@
ID 278 gen 1512 parent 5 top level 5 path timeshift-btrfs/snapshots/2022-06-30_12-41-00/@home
ID 279 gen 1532 parent 5 top level 5 path timeshift-btrfs/snapshots/2022-06-30_12-50-09/@
ID 280 gen 1533 parent 5 top level 5 path timeshift-btrfs/snapshots/2022-06-30_12-50-09/@home
ID 281 gen 1553 parent 5 top level 5 path timeshift-btrfs/snapshots/2022-06-30_12-58-13/@
ID 282 gen 1555 parent 5 top level 5 path timeshift-btrfs/snapshots/2022-06-30_12-58-13/@home
ID 283 gen 1637 parent 5 top level 5 path timeshift-btrfs/snapshots/2022-06-30_13-55-45/@
ID 284 gen 1638 parent 5 top level 5 path timeshift-btrfs/snapshots/2022-06-30_13-55-45/@home

Try to check using cd if it works. (You should open Timeshift that will mount at snapshot’s path)

cd /run/timeshift/backup/timeshift-btrfs/snapshots/2022-06-30_13-55-45/@home

If it does not work, then try:

cd /run/timeshift/2373/backup/timeshift-btrfs/snapshots/2022-06-30_13-55-45/@home

That is the known issue:
Timeshift generates random number in /run/timeshift/<number>/backup

Unfortunately, Grub-BTRFS doesn’t support it.

It looks like this Timeshift broke standard path for Grub-BTRFS.


Maybe downgrade timeshift, it will solve the problem.
Or using btrfs-assistant that supports snapper

Can’t, so tried with PID in this path:

[lukasz-virtualbox ~]# cd /run/timeshift/backup/timeshift-btrfs/snapshots/2022-06-30_13-55-45/@home
-bash: cd: /run/timeshift/backup/timeshift-btrfs/snapshots/2022-06-30_13-55-45/@home: Nie ma takiego pliku ani katalogu
[lukasz-virtualbox ~]# cd /run/timeshift/1166/backup/timeshift-btrfs/snapshots/2022-06-30_13-55-45/
[lukasz-virtualbox 2022-06-30_13-55-45]# 

As well can’t:

[lukasz-virtualbox 2022-06-30_13-55-45]# cd /run/timeshift/2373/backup/timeshift-btrfs/snapshots/2022-06-30_13-55-45/@home
-bash: cd: /run/timeshift/2373/backup/timeshift-btrfs/snapshots/2022-06-30_13-55-45/@home: Nie ma takiego pliku ani katalogu

I need to read about this btrfs-assistant.

That has been removed from timeshift as of 22.06.2-2.