Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I don't know how useful you will find this to be. Feel free to close if you think it does not add value. I only made this because I wanted to learn more about btrfs
When running device remove, the difference is pretty extreme compared to
btrfs device usage
(2.70TiB vs 10.75TiB). So it could be useful in that situation, to get a better understanding of thebtrfs device remove
process which people complain about being slow but in reality it seems to be pretty fast;de usage
is just not showing the whole picture:The default mode is pretty quick and it only prints number of device extents which can be useful for planning the order of
device remove
commands; but for more thorough device introspection I added a--usage
flag to iterate over all the device extentsThis is what the output looks like with the
--usage
flag (this part is slow, takes between 20 seconds to 5 mins to run):You can compare this to the output of the fs usage-report:
I'm not sure why there are slightly more device blockgroups than fs chunks: