Deleting files doesn't free up disk space

Whenever I delete files it won’t free up disk space. I’m on btrfs. In Gnome’s Disk Space Analyser, I can see that /home and the rest of the system use only about 400G of my 500G partition.

I don’t want to restart because last time this happened, it wouldn’t boot. Last time it was fixed by going into a live environment and manually deleting some of my timeshift backups and deleting my swap partition for extra space. Timeshift is now no longer installed, so I don’t know how to fix this.

My output of df -Th is:

Filesystem     Type      Size  Used Avail Use% Mounted on
dev            devtmpfs  7.8G     0  7.8G   0% /dev
run            tmpfs     7.8G  2.1M  7.8G   1% /run
/dev/nvme0n1p2 btrfs     477G  474G  2.6G 100% /
tmpfs          tmpfs     7.8G  454M  7.3G   6% /dev/shm
tmpfs          tmpfs     7.8G   62M  7.7G   1% /tmp
/dev/nvme0n1p2 btrfs     477G  474G  2.6G 100% /var/cache
/dev/nvme0n1p2 btrfs     477G  474G  2.6G 100% /var/log
/dev/nvme0n1p2 btrfs     477G  474G  2.6G 100% /home
/dev/nvme0n1p1 vfat      300M  568K  299M   1% /boot/efi
tmpfs          tmpfs     1.6G  180K  1.6G   1% /run/user/1000

I’d be very grateful for any support.

Old BTRFS snapshots that haven’t been pruned? That would be my first guess.

1 Like

SSD? Is trim not enabled or not run?
ex:

sudo fstrim -v /
1 Like

idk. I deleted /run/timeshift

/: 11.1 GiB (11952898048 bytes) trimmed

was the output

Timeshift is not the same as BTRFS … BTRFS, as a filesystem/service creates snapshots. Nothing to do with timeshift the application.

Mk, So it trimmed 11 G of data you had ‘deleted’ but not yet ‘trimmed’.
(to see more about this: Solid state drive - ArchWiki)

I can’t see anything there that seems to fix the issue (on the arch wiki). @cscs

I did not say there would be … it is simply an explanation of what TRIM is and how to manage it.
I agree with @winnie that (especially after we checked and cleared trim) your issue is likely BTRFS snapshots, especially as you seem to not know what those are.
This page will likely have the information you are looking for:
https://wiki.archlinux.org/title/Btrfs
Specifically, the section Btrfs - ArchWiki, will at least show if you have a bunch of snapshots.
( example, assuming they are mounted at /btrfs: btrfs subvolume list /btrfs )

1 Like

not mounted there. cant find the location @cscs

@cscs my output for
sudo btrfs subvolume list -p /home

ID 256 gen 300100 parent 5 top level 5 path @
ID 257 gen 300104 parent 5 top level 5 path @home
ID 258 gen 299466 parent 5 top level 5 path @cache
ID 259 gen 300104 parent 5 top level 5 path @log
ID 684 gen 255163 parent 256 top level 256 path @/var/lib/docker/btrfs/subvolumes/92a62b8ebd4f74037f7080c819d4d0ad9912d19f3cf2638285e0febc2bc2228a
ID 685 gen 255163 parent 256 top level 256 path @/var/lib/docker/btrfs/subvolumes/90c260730e75f58947a72765e10cf4da8766afdee9ae615c5f5c195a8784e193
ID 686 gen 255163 parent 256 top level 256 path @/var/lib/docker/btrfs/subvolumes/e5cd5bbc4d30d02fed213b9954bbc627912e3001ffbdf7ad0233a2302324fb22
ID 687 gen 255163 parent 256 top level 256 path @/var/lib/docker/btrfs/subvolumes/09b4bca6f3c5a35f8277dc1405d5f6db823ed66bc9778b97cfc75bb6181311f8
ID 688 gen 255163 parent 256 top level 256 path @/var/lib/docker/btrfs/subvolumes/dbf3b5d56ee4148443855ad1af3b099b1e180658971bc55bbfab855584cf0024
ID 689 gen 255163 parent 256 top level 256 path @/var/lib/docker/btrfs/subvolumes/ef65b71e0174f6a15e8c10732161315ca0720456b03ea1cdd64cefd27b9ffaba
ID 690 gen 255163 parent 256 top level 256 path @/var/lib/docker/btrfs/subvolumes/82fc0341e4dfa6d5f775f8e187024e443908c0b393b401b73748421a1ce6b23e-init
ID 691 gen 255164 parent 256 top level 256 path @/var/lib/docker/btrfs/subvolumes/82fc0341e4dfa6d5f775f8e187024e443908c0b393b401b73748421a1ce6b23e
ID 781 gen 60268 parent 5 top level 5 path timeshift-btrfs/snapshots/2021-10-06_19-00-01/@
ID 782 gen 60269 parent 5 top level 5 path timeshift-btrfs/snapshots/2021-10-06_19-00-01/@home
ID 789 gen 61493 parent 5 top level 5 path timeshift-btrfs/snapshots/2021-10-08_17-24-23/@
ID 790 gen 61495 parent 5 top level 5 path timeshift-btrfs/snapshots/2021-10-08_17-24-23/@home
ID 791 gen 63188 parent 5 top level 5 path timeshift-btrfs/snapshots/2021-10-09_12-27-04/@
ID 792 gen 63190 parent 5 top level 5 path timeshift-btrfs/snapshots/2021-10-09_12-27-04/@home
ID 793 gen 255275 parent 5 top level 5 path timeshift-btrfs/snapshots/2021-10-12_17-08-51/@
ID 794 gen 255409 parent 5 top level 5 path timeshift-btrfs/snapshots/2021-10-12_17-08-51/@home

doing
sudo btrfs subvolume delete /timeshift-btrfs/snapshots/2021-10-06_19-00-01/@~
or
sudo btrfs subvolume delete timeshift-btrfs/snapshots/2021-10-06_19-00-01/@~

just returns with
ERROR: Could not statfs: No such file or directory

Solution:

sudo btrfs subvolume list /

I looked for the ID’s of the ones labelled timeshift

then ran:

btrfs subvolume delete --subvolid ID /

for each

for example:

btrfs subvolume delete --subvolid 790 /

Thanks for the help everyone!

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