Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* how to delete a (hidden) snapshot from timeshift?
@ 2024-09-03 13:23 Ulli Horlacher
  2024-09-03 17:16 ` Andrei Borzenkov
  2024-09-04 10:10 ` Ulli Horlacher
  0 siblings, 2 replies; 3+ messages in thread
From: Ulli Horlacher @ 2024-09-03 13:23 UTC (permalink / raw)
  To: linux-btrfs


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?

-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK
Universitaet Stuttgart         E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    https://www.tik.uni-stuttgart.de/
REF:<20240903132316.GA20488@tik.uni-stuttgart.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to delete a (hidden) snapshot from timeshift?
  2024-09-03 13:23 how to delete a (hidden) snapshot from timeshift? Ulli Horlacher
@ 2024-09-03 17:16 ` Andrei Borzenkov
  2024-09-04 10:10 ` Ulli Horlacher
  1 sibling, 0 replies; 3+ messages in thread
From: Andrei Borzenkov @ 2024-09-03 17:16 UTC (permalink / raw)
  To: linux-btrfs

On 03.09.2024 16:23, Ulli Horlacher wrote:
> 
> 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
> 

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.

> 
> 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?
> 

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to delete a (hidden) snapshot from timeshift?
  2024-09-03 13:23 how to delete a (hidden) snapshot from timeshift? Ulli Horlacher
  2024-09-03 17:16 ` Andrei Borzenkov
@ 2024-09-04 10:10 ` Ulli Horlacher
  1 sibling, 0 replies; 3+ messages in thread
From: Ulli Horlacher @ 2024-09-04 10:10 UTC (permalink / raw)
  To: linux-btrfs

On Tue 2024-09-03 (15:23), Ulli Horlacher wrote:
> 
> 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

Found my mistake. Correct is:

btrfs subvolume del -i 682 /


-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK
Universitaet Stuttgart         E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    https://www.tik.uni-stuttgart.de/
REF:<20240903132316.GA20488@tik.uni-stuttgart.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-04 10:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-03 13:23 how to delete a (hidden) snapshot from timeshift? Ulli Horlacher
2024-09-03 17:16 ` Andrei Borzenkov
2024-09-04 10:10 ` Ulli Horlacher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox