Re: btrfs thinks fs is full, though 11GB should be still free

Christoph Anton Mitterer
2023-12-21T22:25:19Z

On Thu, 2023-12-21 at 19:03 +0100, Goffredo Baroncelli wrote:
> > # lsof --
> > /data/main/prometheus/metrics2/01HHFEZPJ8TPFVYTXV11R7ZH4X/chunks/00
> > 0001
>
> Here you should do a defrag, after the stop of prometheus.

No difference. Even after syncing, and even after unmount/mountig.

btw: I did that:

/data/main# compsize /data/main/prometheus/metrics2/01HHFEZPJ8TPFVYTXV11R7ZH4X/chunks/000001
Processed 1 file, 1 regular extents (1 refs), 0 inline.
Type Perc Disk Usage Uncompressed Referenced
TOTAL 100% 256M 256M 15M
none 100% 256M 256M 15M

/data/main# cat /data/main/prometheus/metrics2/01HHFEZPJ8TPFVYTXV11R7ZH4X/chunks/000001 > foo
/data/main# compsize -b foo
Processed 1 file, 1 regular extents (1 refs), 0 inline.
Type Perc Disk Usage Uncompressed Referenced
TOTAL 100% 268435456 268435456 15781888
none 100% 268435456 268435456 15781888
/data/main# ls -al foo
-rw-r--r-- 1 root root 15781418 Dec 21 23:02 foo

=> Wouldn't have expected that, not only the discrepancy between
referenced and ls.
But even the freshly cat'ed file has that space waste. There should
be no holes, or any other monkey business involved?

# du --apparent-size --total -s --block-size=1 /data/main/
22112706625 /data/main/
22112706625 total

# compsize -b /data/main/
Processed 463 files, 865 regular extents (874 refs), 224 inline.
Type Perc Disk Usage Uncompressed Referenced
TOTAL 100% 35752870045 35752870045 22097375389
none 100% 35752870045 35752870045 22097375389

>
> I am trying to write a tool that walks the backref to find the
> owners.
> I hope for tomorrow to have a prototype to test.

Thanks!

Cheers,
Chris.