From: Qu Wenruo <wqu@suse.com>
To: Leszek Dubiel <leszek@dubiel.pl>,
Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: 97% full system, dusage didn't help, musage strange
Date: Tue, 17 Dec 2024 07:31:36 +1030 [thread overview]
Message-ID: <a6a641f6-b0a1-4915-912a-638cc07eba88@suse.com> (raw)
In-Reply-To: <ea8eb95c-e64a-4589-b302-23eb1fc6bd5c@dubiel.pl>
在 2024/12/17 03:42, Leszek Dubiel 写道:
>
>>>
>>> It failed now — there is 258 GB free, but balancing didn't help to
>>> restore unallocated space.
>>
>> Because there isn't that much free space to reclaim in the first place.
>>
>> Your data and metadata chunks are already very highly utilized, you can
>> increase the dusage/musage and retry, but they will only bring marginal
>> gain if any.
>>
>> The only way to go next is start deleting more
>> snapshots/subvolumes/files/etc.
>>
>> With more data/metadata space released, then try musage/dusage again
>> which can free up some space.
>
> This helped.
> Thank you.
>
>
>
> My system was deleting shapshots automatically if there was less then
> 250 GB free space.
> This procedure worked fine — 258 GB was free.
>
> Second procedure was balancing system if there was less then 8GB of
> Unallocated space.
> This procedure couldn't reclaim free space to makie it unallocated.
>
>
>
>
> How to improve?
>
> Tell the first procedure to keep 500GB free space? 800GB?
Increasing the free space will definitely increase the chance of
reclaiming space using balance.
But that's only increasing the chance, never to ensure that.
As you can keep 800GiB free space, but since your fs have 8TiB data
space, for the worst case scenario where all space are freed evenly
among all chunks, it means each 1GiB chunk will only have around 100MiB
(10%) freed.
That is not really going to chance the result of balance.
But that's for the worst case scenario.
>
> Or change the procedure to look at percentage of free disk space?
> What is optimal? 90% should be maximum of occupied?
>
> This is system for backups, so this could be almost full.
If you want to be extra safe, the best solution is to use tools that can
report the usage percentage of each block group.
You need something procedure like this:
start:
if (unallocated space >= 8GiB)
return;
check_usage_percentage:
if (no block group has usage percentage < 30%) {
delete_files;
goto check_usage_percentage;
}
balance dusage=30
goto start;
Although there are some concerns, firstly the tool, sorry I didn't
remember the name but there is an out-of-btrfs-progs tool can do exactly
that.
Secondly the tool may need to go through all 8000+ block groups, thus
just checking the block group usage itself will take some time.
(IIRC if it's using the tree search ioctl and the fs doesn't have
block-group-tree feature, it may spend one or two minutes, just like
mounting a large fs)
Third, since you have no control where the data is, at file deleting
stage, for the worst case you may have to delete 70% of your data so
that all block groups reach 30% free space...
But at least that should be the most precious way to keep your
unallocated safe...
Thanks,
Qu
next prev parent reply other threads:[~2024-12-16 21:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-14 17:55 97% full system, dusage didn't help, musage strange Leszek Dubiel
2024-12-14 18:35 ` Roman Mamedov
2024-12-14 18:47 ` Andrei Borzenkov
2024-12-14 20:13 ` Leszek Dubiel
2024-12-14 21:14 ` Qu Wenruo
2024-12-16 17:12 ` Leszek Dubiel
2024-12-16 21:01 ` Qu Wenruo [this message]
2024-12-17 21:44 ` Leszek Dubiel
2025-01-03 22:52 ` Leszek Dubiel
2025-01-04 5:32 ` Andrei Borzenkov
2025-01-04 7:11 ` Leszek Dubiel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a6a641f6-b0a1-4915-912a-638cc07eba88@suse.com \
--to=wqu@suse.com \
--cc=leszek@dubiel.pl \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox