Open madsherlock opened 6 years ago
I came across this issue with Manjaro KDE 21.1.5 with brtfs and docker. I was subsequently able to reproduce the same issue in a VM with Manjaro xfce 21.1.5 with btrfs and docker, Here are the steps to reproduce:
sudo pamac install docker
sudo timeshift --create --comments "First"
sudo systemctl start docker.service
sudo docker run -it hello-world
sudo timeshift --list --snapshot-device /dev/vda1
sudo btrfs subvolume list /
sudo timeshift --restore --snapshot '2021-10-09_14-57-17' --target /dev/sda1
sudo reboot
sudo timeshift --create --comments "Second"
sudo timeshift --list --snapshot-device /dev/vda1
sudo timeshift --delete --snapshot '2021-10-09_15-11-23'
sudo btrfs subvolume list /
Hope this helps track this issue down.
ID 271 gen 48 top level 257 path var/lib/docker/btrfs/subvolumes/db90b52273bda561111638c9a673097dec5435374335df5f204d1cc6ac7933f2
The problem is that inside the subvolume "@" has nested snapshots [1], to avoid this problem, create a subvolume on the toplevel (ID5).
[1] ID 271 gen 48 top level 257 path timeshift-btrfs/snapshots/2021-10-09_15-11-23/@/var/lib/docker/btrfs/subvolumes/db90b52273bda561111638c9a673097dec5435374335df5f204d1cc6ac7933f2
For more information: https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Layout
One solution is to create a top level subvolume named @docker and mount it at /var/lib/docker using /etc/fstab. By doing this the nested subvolumes created by docker will remain outside of @
Hello! Experiencing the same issue on Fedora 36.
sudo timeshift --delete --snapshot 2022-07-01_22-49-38
Output
/dev/sda3 is mounted at: /run/timeshift/backup, options: rw,seclabel,relatime,compress=zstd:1,ssd,space_cache=v2,subvolid=5,subvol=/
Removing snapshot: 2022-07-01_22-49-38 Deleting subvolume: @ (Id:257) E: ERROR: Could not destroy subvolume/snapshot: Directory not empty
E: Failed to delete snapshot subvolume: '/run/timeshift/backup/timeshift-btrfs/snapshots/2022-07-01_22-49-38/@' E: Failed to remove snapshot: 2022-07-01_22-49-38
As a workaround managed to remove the snapshot
cd /run/timeshift/backup/timeshift-btrfs/snapshots/
sudo rm -rf 2022-07-01_22-49-38/
We'll see what might be the consequences.
I am trying to free up disk space by deleting old btrfs snapshots. However, deleting them from within the Timeshift GUI is impossible. They are greyed out.
The following text describes my process to force delete these snapshots, and hopefully someone will be able to find the error (if any) within Timeshift causing the problem. For a quick summary of my findings, see bottom of this post.
Here is an excerpt from the latest log of the Timeshift GUI trying to remove the oldest snapshot (already greyed out in GUI).
I tried running the btrfs command directly as root, and got the following output:
So, the "directory is not empty". I am no btrfs expert, and don't know what this means. Next, I tried listing snapshots from the corresponding date:
It seems there are nested snapshots eg. "/@home/@home" where there should only be "/@home". I guess that is what caused the "Directory not empty" error. I delete the nested snapshots manually:
(and same for "/@")
It seems to have worked.
Within Timeshift GUI, the snapshot seems to exist (greyed out still). When I hit "Delete", the snapshot disappears from the list.
I guess this is a success for me, but a cumbersome workaround!
Timeshift seems to create nested snapshots occasionally. When deleting from GUI, the top level snapshot is selected, and so cannot be deleted (due to a sub-snapshot residing within). This is the issue I'm reporting here, as it is making snapshot deletion impossible from within the Timeshift GUI. I don't know if the fix should be in the snapshot creation, or in the snapshot deletion.
Best regards, Mikael