Unable to delete a timeshift snapshot

  1. I have two snapshots
$ sudo timeshift --list                                                                                  1 ✘ 

/dev/nvme0n1p4 is mounted at: /run/timeshift/backup, options: rw,relatime,compress=zstd:3,ssd,space_cache=v2,autodefrag,subvolid=5,subvol=/

Device : /dev/nvme0n1p4
UUID   : 7950add4-aa04-4570-aeaf-3e7a238eb02f
Path   : /run/timeshift/backup
Mode   : BTRFS
Status : OK
Num     Name                 Tags  Description                             
------------------------------------------------------------------------------
0    >  2021-12-31_17-32-14  O     Before restoring '2021-12-31 15:38:06'  
1    >  2022-01-03_00-37-11  O                                             

  1. Now, when I try to delete the older one, like so:
$ sudo timeshift --delete --snapshot '2021-12-31_17-32-14'                                            

/dev/nvme0n1p4 is mounted at: /run/timeshift/backup, options: rw,relatime,compress=zstd:3,ssd,space_cache=v2,autodefrag,subvolid=5,subvol=/

------------------------------------------------------------------------------
Removing snapshot: 2021-12-31_17-32-14
Deleting subvolume: @ (Id:256)
E: ERROR: Could not destroy subvolume/snapshot: Directory not empty

E: Failed to delete snapshot subvolume: '/run/timeshift/backup/timeshift-btrfs/snapshots/2021-12-31_17-32-14/@'
E: Failed to remove snapshot: 2021-12-31_17-32-14
------------------------------------------------------------------------------

Pls guide me through troubleshooting and help fix the error.

@ is your btrfs root subvolume ─ the one that contains all other subvolumes. You cannot delete the root subvolume.

Sorry neither did I understood the question nor do I know anything about Btrfs :embarrased:

What I notice is this snapshot (the one that fails to delete) is not listed in Grub

Num     Name                 Tags  Description                             
------------------------------------------------------------------------------
0    >  2021-12-31_17-32-14  O     Before restoring '2021-12-31 15:38:06'

Maybe this will help you understand things better. :wink:

:arrow_down:

btrfs Wiki at kernel.org

btrfs at the Arch Wiki

1 Like

Thanks, that helped. It created multiple subvolumes as noted in the upstream bug report Some snapshots cannot be deleted · Issue #141 · teejee2008/timeshift · GitHub (Has to do something with docker).

$ sudo btrfs subvolume list / | grep '2021-12-31_17-32-14'  
                                                                   
ID 256 gen 8164 top level 5 path timeshift-btrfs/snapshots/2021-12-31_17-32-14/@
ID 262 gen 7879 top level 256 path timeshift-btrfs/snapshots/2021-12-31_17-32-14/@/var/lib/docker/btrfs/subvolumes/7367454dfee50dbad526426ba1b5e9bec17464faf79ccf3594ab171f341ac3ec
ID 263 gen 596 top level 256 path timeshift-btrfs/snapshots/2021-12-31_17-32-14/@/var/lib/docker/btrfs/subvolumes/d10c930984c37bcf47e5a4564ae5c2371c05ab855431f7eb3e74f9c7b7ceca3f
ID 264 gen 597 top level 256 path timeshift-btrfs/snapshots/2021-12-31_17-32-14/@/var/lib/docker/btrfs/subvolumes/ce18bc383e11e0be12745c6f6d6301c643c97deca740f4d7433c66e7b09a3f7d
ID 265 gen 598 top level 256 path timeshift-btrfs/snapshots/2021-12-31_17-32-14/@/var/lib/docker/btrfs/subvolumes/c990142a63b11977b69bf630e7dd98eb8f53602b2177e2facb5eb6c8bd075f29
ID 266 gen 599 top level 256 path timeshift-btrfs/snapshots/2021-12-31_17-32-14/@/var/lib/docker/btrfs/subvolumes/07e304e78cc5f60f1a9ff93a4a2e3e53c222372d0779b5fccde883ba1e438484
ID 267 gen 600 top level 256 path timeshift-btrfs/snapshots/2021-12-31_17-32-14/@/var/lib/docker/btrfs/subvolumes/fa13ba4fb629791d6b5d1e930ef93b407a94e4175b63016bc3f86a2a9c1fbcdd
ID 268 gen 601 top level 256 path timeshift-btrfs/snapshots/2021-12-31_17-32-14/@/var/lib/docker/btrfs/subvolumes/52afdde2dd5995aaa56cca79d90ba49a439c5ec3da07b791d036c6515ad1ebdd
ID 269 gen 602 top level 256 path timeshift-btrfs/snapshots/2021-12-31_17-32-14/@/var/lib/docker/btrfs/subvolumes/6943589922caba74e379199f8945dfec9e27a2d3db1217616a6be21576673884
ID 270 gen 603 top level 256 path timeshift-btrfs/snapshots/2021-12-31_17-32-14/@/var/lib/docker/btrfs/subvolumes/356f31df9bf85d2151472ab8acc08cb42045b8d77e73ec3f708028b8e91fb1e1
ID 271 gen 604 top level 256 path timeshift-btrfs/snapshots/2021-12-31_17-32-14/@/var/lib/docker/btrfs/subvolumes/c2b42c211ea3425acd7308a8a7f6e8359d6085f3d0c703e2fc9835470d274729
ID 272 gen 605 top level 256 path timeshift-btrfs/snapshots/2021-12-31_17-32-14/@/var/lib/docker/btrfs/subvolumes/6ff9d6b79ec6b8a4ddeb66754a483e28f5581188e60e32a723d891b72544a826-init
ID 273 gen 2092 top level 256 path timeshift-btrfs/snapshots/2021-12-31_17-32-14/@/var/lib/docker/btrfs/subvolumes/6ff9d6b79ec6b8a4ddeb66754a483e28f5581188e60e32a723d891b72544a826

As suggested, I removed each one of the subvolumes and then Timeshift was able to remove the snapshot.

Eg:

sudo btrfs subvolume delete /run/timeshift/backup/timeshift-btrfs/snapshots/2021-12-31_17-32-14/@/var/lib/docker/btrfs/subvolumes/7367454dfee50dbad526426ba1b5e9bec17464faf79ccf3594ab171f341ac3ec

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.