Unable to delete timeshift snapshot from system

Hello!

I am on a btrfs fs and upon installing updates, timeshift is creating snapshots.
One of those snaphots I cannot delete for some reason.

Is anyone able to help me identify if i am currently on a clean state and how to delete that snapshot ?

sudo timeshift --delete --snapshot '2024-05-21_22-14-41' --debug
D: Main()
D:
D: Running Timeshift v24.06.3
D:
D: Session log file: /var/log/timeshift/2024-10-15_21-54-24_delete.log
D: Distribution: EndeavourOS rolling (rolling)
D: DIST_ID: EndeavourOS
D: Main: check_dependencies()
D: Main: add_default_exclude_entries()
D: Main: add_default_exclude_entries(): exit
D: update_partitions()
D: df -T -B1
D: Device: get_disk_space_using_df(): 6
D: Device: get_mounted_filesystems_using_mtab(): 3
D: Device: get_filesystems(): 7
D: partition list updated
D: detect_system_devices()
D: /boot/efi is mapped to device: /dev/nvme0n1p1, UUID=0EFA-0180
D: /home is mapped to device: /dev/nvme0n1p2, UUID=317d6071-2258-4318-b5a9-b1291713852a, subvol=@home
D: / is mapped to device: /dev/nvme0n1p2, UUID=317d6071-2258-4318-b5a9-b1291713852a, subvol=@
D: Searching subvolume for system at path: /
D: Found subvolume: @, on device: /dev/nvme0n1p2
D: Found subvolume: @home, on device: /dev/nvme0n1p2
D: Found subvolume: @cache, on device: /dev/nvme0n1p2
D: Found subvolume: @log, on device: /dev/nvme0n1p2
D: Users: paco root
D: Encrypted home users:
D: Encrypted home dirs:

D: Encrypted private dirs:

D: Main: load_app_config()
App config loaded: /etc/timeshift/timeshift.json
D: IconManager: init()
D: found images directory: /usr/share/timeshift/images
D: Main(): ok
D: AppConsole: parse_arguments()
D: Main: initialize_repo()
D: backup_uuid=317d6071-2258-4318-b5a9-b1291713852a
D: backup_parent_uuid=
D: Setting snapshot device from config file
D: repo: creating from uuid
D: SnapshotRepo: from_uuid(): BTRFS
D: uuid=317d6071-2258-4318-b5a9-b1291713852a
D: SnapshotRepo: init_from_device()
D:
D: SnapshotRepo: unlock_and_mount_devices()
D: device=/dev/nvme0n1p2
D: SnapshotRepo: unlock_and_mount_device()
D: device=/dev/nvme0n1p2
D: Device: get_mounted_filesystems_using_mtab(): 3
D: ------------------
D: arg=317d6071-2258-4318-b5a9-b1291713852a, device=/dev/nvme0n1p2
D: /var/log
D: /var/cache
D: /home
D: /
D: ------------------
D: Device: get_mounted_filesystems_using_mtab(): 3
Mounted '/dev/nvme0n1p2' at '/run/timeshift/50083/backup'
D: Searching subvolume for system at path: /run/timeshift/50083/backup/@
D: Found subvolume: @, on device: /dev/nvme0n1p2
D: Found subvolume: @home, on device: /dev/nvme0n1p2
D: Found subvolume: @cache, on device: /dev/nvme0n1p2
D: Found subvolume: @log, on device: /dev/nvme0n1p2
D: SnapshotRepo: load_snapshots()
D: Querying subvolume info...
D: query_subvolume_id():@
D: btrfs subvolume list '/run/timeshift/50083/backup'
D: query_subvolume_quota():@
D: btrfs qgroup show --raw '/run/timeshift/50083/backup'
D: btrfs qgroup show '/run/timeshift/50083/backup'
btrfs: Quotas are not enabled
D: Query completed
D: loading snapshots from '/run/timeshift/50083/backup/timeshift-btrfs/snapshots': 10 found
D: SnapshotRepo: unlock_and_mount_device(): exit
D: Selected snapshot device: /dev/nvme0n1p2
D: Free space: 80.1 GB
D: SnapshotRepo: check_status()
D: SnapshotRepo: available()
D: SnapshotRepo: has_btrfs_system()
D: root_path=/run/timeshift/50083/backup/@
D: btrfs_mode=true
D: is_available: ok
D: SnapshotRepo: has_snapshots()
D: SnapshotRepo: has_space() - 0 required (0 B)
D: df -T -B1 '/dev/nvme0n1p2'
D: Device: get_disk_space_using_df(): 1
D: SnapshotRepo: check_status(): exit
D: SnapshotRepo: init_from_device(): exit
D: SnapshotRepo: from_uuid(): exit
D: Main: initialize_repo(): exit
D: AppConsole: start_application()
D: AppConsole: select_snapshot()
------------------------------------------------------------------------------
Removing snapshot: 2024-05-21_22-14-41
Deleting subvolume: @ (Id:256)
D: btrfs subvolume delete  '/run/timeshift/50083/backup/timeshift-btrfs/snapshots/2024-05-21_22-14-41/@'
E: ERROR: Could not destroy subvolume/snapshot: Directory not empty

E: Failed to delete snapshot subvolume: '/run/timeshift/50083/backup/timeshift-btrfs/snapshots/2024-05-21_22-14-41/@'
E: Failed to remove snapshot: 2024-05-21_22-14-41
------------------------------------------------------------------------------
D: exit_app()
D: crontab -l
D: Failed to read cron tab
D: crontab -l
D: Failed to read cron tab
D: Cron task exists: /etc/cron.d/timeshift-hourly
D: Cron task exists: /etc/cron.d/timeshift-boot
D: unmount_target_device()
D: clean_logs()
D: rm -rf '/tmp/4h4SUrUc'
D: cleanup_unmount_devices()
D: df -T -B1
D: Device: get_disk_space_using_df(): 7
D: Device: get_mounted_filesystems_using_mtab(): 3
D: Device: get_filesystems(): 7
D:
Found stale mount for device '/dev/nvme0n1p2' at path '/run/timeshift/50083/backup'
D: Unmounted successfully
cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=0EFA-0180                            /boot/efi      	vfat    fmask=0137,dmask=0027 0 2
UUID=317d6071-2258-4318-b5a9-b1291713852a /              	btrfs   subvol=/@,noatime,compress=zstd 0 0
UUID=317d6071-2258-4318-b5a9-b1291713852a /home          	btrfs   subvol=/@home,noatime,compress=zstd 0 0
UUID=317d6071-2258-4318-b5a9-b1291713852a /var/cache     	btrfs   subvol=/@cache,noatime,compress=zstd 0 0
UUID=317d6071-2258-4318-b5a9-b1291713852a /var/log       	btrfs   subvol=/@log,noatime,compress=zstd 0 0
tmpfs                                     /tmp           	tmpfs   defaults,noatime,mode=1777 0 0

Thanks!

Check for a nested subvolume preventing the snapshot from being deleted.

sudo btrfs subvolume list -o /run/timeshift/50083/backup/timeshift-btrfs/snapshots/2024-05-21_22-14-41/@

Use btrfs subvolume delete on whatever subvolumes that command outputs.

sudo btrfs subvolume delete /run/timeshift/50083/backup/timeshift-btrfs/snapshots/2024-05-21_22-14-41/@/[some_nested_subvolume]
sudo btrfs subvolume delete /run/timeshift/50083/backup/timeshift-btrfs/snapshots/2024-05-21_22-14-41/@/[another_nested_subvolume]

Hi,

output of subvolume list

sudo btrfs subvolume list -o /run/timeshift/262878/backup/timeshift-btrfs/snapshots/2024-05-21_22-14-41/@/
ID 260 gen 222683 top level 256 path timeshift-btrfs/snapshots/2024-05-21_22-14-41/@/var/lib/portables
ID 261 gen 222683 top level 256 path timeshift-btrfs/snapshots/2024-05-21_22-14-41/@/var/lib/machines

and then deletion:

sudo btrfs subvolume delete /run/timeshift/262878/backup/timeshift-btrfs/snapshots/2024-05-21_22-14-41/@/var/lib/portables/
Delete subvolume 260 (no-commit): '/run/timeshift/262878/backup/timeshift-btrfs/snapshots/2024-05-21_22-14-41/@/var/lib/portables'
sudo btrfs subvolume delete /run/timeshift/262878/backup/timeshift-btrfs/snapshots/2024-05-21_22-14-41/@/var/lib/machines/
Delete subvolume 261 (no-commit): '/run/timeshift/262878/backup/timeshift-btrfs/snapshots/2024-05-21_22-14-41/@/var/lib/machines'

then I could remove that snapshot.

Thanks!

1 Like

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