Re: btrfs metadata has reserved 1T of extra space and balances don't reclaim it
From: Forza <hidden>
Date: 2021-09-29 16:39:53
---- From: Andrea Gelmini [off-list ref] -- Sent: 2021-09-29 - 17:18 ----
Il giorno mer 29 set 2021 alle ore 04:41 Brandon Heisner [off-list ref] ha scritto:quoted
I have a server running CentOS 7 on 4.9.5-1.el7.elrepo.x86_64 #1 SMP Fri Jan 20 11:34:13 EST 2017 x86_64 x86_64 x86_64 GNU/Linux. It is version locked to that kernel. The metadata has reserved a full 1T of disk space, while only using ~38G. I've tried to balance the metadata to reclaim that so it can be used for data, but it doesn't work and gives no errors. It just says it balanced the chunks but the size doesn't change. The metadata total is still growing as well, as it used to be 1.04 and now it is 1.08 with only about 10G more of metadata used. I've tried doing balances up to 70 or 80 musage I think, andSimilar situation here. A 18TB single disk with one big snapraid parity file, and a lot of metadata allocated. I solved with: btrfs filesystem defrag -v -r -clzo . (useless the compression, in my case) So, just after a little bit from start I saw already space reclaming. In the end I fallback to exfat to avoid to keep re-reading/re-writing all data just to avoid "metadata waste". Ciao, Gelma
Maybe autodefrag mount option might be helpful? Your problem sounds like partially filled extents and not metadata related. Typical scenarios where that happens is with some databases and vm images. A file could allocate much more space than actuall data due to this. Use 'compsize' to determine this.