Skip to contentSkip to conversation

how to delete a (hidden) snapshot from timeshift?

DISCUSSION Ulli Horlacher 2 participants 3 messages Sep 3, 2024 – Sep 4, 2024 Btrfs file system

lore
Share & tools
lore
#0 lore raw

I have upgraded Mint 21 to Mint 22 with "mintupgrade" (Ubuntu 22 based). This calls timeshift and creates a btrfs snapshot which I wanted to delete afterwards:

root@mux21:~# btrfs subvolume list /
ID 256 gen 102469 top level 5 path @
ID 257 gen 102467 top level 5 path @home
ID 367 gen 102260 top level 256 path local/home
ID 667 gen 102466 top level 256 path tmp
ID 682 gen 102445 top level 5 path timeshift-btrfs/snapshots/2024-09-03_13-00-02/@
root@mux21:~# btrfs subvolume del timeshift-btrfs/snapshots/2024-09-03_13-00-02/@
ERROR: Could not statfs: No such file or directory
root@mux21:~# btrfs subvolume del -i 682 timeshift-btrfs/snapshots/2024-09-03_13-00-02/@
ERROR: Could not open: No such file or directory

I have had to mount the / filesystem directly (no subvol) to remove this timeshift snapshot:

root@mux21:~# lshd
Device    Size Type      Label           Mountpoint
sda        30G ATA:GPT   "VBOX_HARDDISK"  
 sda1       0G vfat                      /boot/efi
 sda2       0G BIOS boot                  
 sda3      29G btrfs                     /
root@mux21:~# mount /dev/sda3 /mnt/tmp
root@mux21:~# l /mnt/tmp/
dRWX - 2024-06-21 11:45 /mnt/tmp/@
dRWX - 2024-03-07 13:00 /mnt/tmp/@home
dRWX - 2024-09-03 13:00 /mnt/tmp/timeshift-btrfs
root@mux21:~# btrfs subvolume list /mnt/tmp
ID 256 gen 102473 top level 5 path @
ID 257 gen 102471 top level 5 path @home
ID 367 gen 102260 top level 256 path @/local/home
ID 667 gen 102471 top level 256 path @/tmp
ID 682 gen 102445 top level 5 path timeshift-btrfs/snapshots/2024-09-03_13-00-02/@
ID 684 gen 102470 top level 257 path @home/.snapshot/2024-09-03_1500.hourly
root@mux21:~# btrfs subvolume del /mnt/tmp/timeshift-btrfs/snapshots/2024-09-03_13-00-02/@
Delete subvolume 682 (no-commit): '/mnt/tmp/timeshift-btrfs/snapshots/2024-09-03_13-00-02/@'

Is there an easier way to remove hidden snapshots/subvolumes?

Signature · 6 lines
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK
Universitaet Stuttgart         E-Mail: [email protected]
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    https://www.tik.uni-stuttgart.de/
REF:<[email protected]>
#1 lore raw
Quoted 12 lines · Ulli Horlacher

I have upgraded Mint 21 to Mint 22 with "mintupgrade" (Ubuntu 22 based). This calls timeshift and creates a btrfs snapshot which I wanted to delete afterwards:

root@mux21:~# btrfs subvolume list /
ID 256 gen 102469 top level 5 path @
ID 257 gen 102467 top level 5 path @home
ID 367 gen 102260 top level 256 path local/home
ID 667 gen 102466 top level 256 path tmp
ID 682 gen 102445 top level 5 path timeshift-btrfs/snapshots/2024-09-03_13-00-02/@
Quoted 6 lines
root@mux21:~# btrfs subvolume del timeshift-btrfs/snapshots/2024-09-03_13-00-02/@
ERROR: Could not statfs: No such file or directory
root@mux21:~# btrfs subvolume del -i 682 timeshift-btrfs/snapshots/2024-09-03_13-00-02/@
ERROR: Could not open: No such file or directory

The path should be path to the filesystem mount point (probably any visible path), not path to the subvolume you are going to delete. The latter is given by -i option.

Quoted 26 lines

I have had to mount the / filesystem directly (no subvol) to remove this timeshift snapshot:

root@mux21:~# lshd
Device    Size Type      Label           Mountpoint
sda        30G ATA:GPT   "VBOX_HARDDISK"
  sda1       0G vfat                      /boot/efi
  sda2       0G BIOS boot
  sda3      29G btrfs                     /
root@mux21:~# mount /dev/sda3 /mnt/tmp
root@mux21:~# l /mnt/tmp/
dRWX - 2024-06-21 11:45 /mnt/tmp/@
dRWX - 2024-03-07 13:00 /mnt/tmp/@home
dRWX - 2024-09-03 13:00 /mnt/tmp/timeshift-btrfs
root@mux21:~# btrfs subvolume list /mnt/tmp
ID 256 gen 102473 top level 5 path @
ID 257 gen 102471 top level 5 path @home
ID 367 gen 102260 top level 256 path @/local/home
ID 667 gen 102471 top level 256 path @/tmp
ID 682 gen 102445 top level 5 path timeshift-btrfs/snapshots/2024-09-03_13-00-02/@
ID 684 gen 102470 top level 257 path @home/.snapshot/2024-09-03_1500.hourly
Quoted 6 lines
root@mux21:~# btrfs subvolume del /mnt/tmp/timeshift-btrfs/snapshots/2024-09-03_13-00-02/@
Delete subvolume 682 (no-commit): '/mnt/tmp/timeshift-btrfs/snapshots/2024-09-03_13-00-02/@'

Is there an easier way to remove hidden snapshots/subvolumes?

What so hard with it? But yes, "btrfs subvolume delete -i" will work when used correctly.

#2 lore raw
In reply to Ulli Horlacher
Quoted 12 lines · Ulli Horlacher

I have upgraded Mint 21 to Mint 22 with "mintupgrade" (Ubuntu 22 based). This calls timeshift and creates a btrfs snapshot which I wanted to delete afterwards:

root@mux21:~# btrfs subvolume list /
ID 256 gen 102469 top level 5 path @
ID 257 gen 102467 top level 5 path @home
ID 367 gen 102260 top level 256 path local/home
ID 667 gen 102466 top level 256 path tmp
ID 682 gen 102445 top level 5 path timeshift-btrfs/snapshots/2024-09-03_13-00-02/@
Quoted 5 lines
root@mux21:~# btrfs subvolume del timeshift-btrfs/snapshots/2024-09-03_13-00-02/@
ERROR: Could not statfs: No such file or directory
root@mux21:~# btrfs subvolume del -i 682 timeshift-btrfs/snapshots/2024-09-03_13-00-02/@
ERROR: Could not open: No such file or directory

Found my mistake. Correct is:

btrfs subvolume del -i 682 /

Signature · 6 lines
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK
Universitaet Stuttgart         E-Mail: [email protected]
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    https://www.tik.uni-stuttgart.de/
REF:<[email protected]>