-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Hey.
Right now, check_btrfs allows to check for allocated/unallocated space.
btw: The option names and their descriptions may be a bit ambiguous with respect to allocated vs. unallocated.
First:
I'm not an expert, but is it (still) necessarily a problem if btrfs runs out of unallocated space?
I mean it has the global reserve... and if there is plenty of free space left in data respectively meta block groups, not having any unallocated space may not mean much, unless perhaps that balance will no longer be possible (which may however not be an issue).
And if there's still enough free space in the already allocated data respectively meta data block groups, ... most other things should continue to run just fine?
At the university here I run a large data centre for the LHC at CERN, and recently stumbled into the following situation:
https://lore.kernel.org/linux-btrfs/CAHzMYBR9dFVTw5kJ9_DfkcuvdrO4x+koicfiWgVNndh8qU2aEw@mail.gmail.com/T/#t
which I would like to be detectable by check_btrfs.
What happened there is basically that unallocated space was completely used up, quite some space (~800GB) was still free in the data block groups, but nothing (usable) was free in the meta-data block groups.
So while there would have been space for the file data itself, nothing was left for new file metadata, so one got ENOSPC.
Of course, just checking for low unallocated space would also detect it, but would also ring the bell too often (namely when there's still enough left in the meta-data block groups.
So not sure how one could detect this better... maybe a check when unallocated space is below some threshold (or even 0) and free metadata space is also below some other threshold, while free data space is still above some threshold (otherwise, it would also report a fs, that's simply full).
Any ideas?
Cheers,
Chris.