python-btrfs icon indicating copy to clipboard operation
python-btrfs copied to clipboard

Request: subvolume qgroup stats

Open daviessm opened this issue 2 years ago • 1 comments

I have a script which lists all subvolumes for a filesystem and saves their usage referenced and exclusive values to a database for further analysis. Currently this calls btrfs subvolume show from btrfs-progs for each subvolume. It would be nice if I could use python-btrfs for this instead.

Ideally there would be an easy way to retrieve all the information provided by btrfs subvolume show.

daviessm avatar Mar 01 '22 10:03 daviessm

Hi! Yes, the qgroup related metadata objects are part of the collection (which is getting smaller \o/) of items that have not been implemented yet.

So, after getting scrub in a workable state, this seems to be the next thing we're going to have a look at.

What you already can do now to help is:

  • Start writing some program using python-btrfs that can do whatever the library already allows. So, basically, the end result you want, but without the qgroup information yet.
  • Have a look at the btrfs-progs code, to see in which way it's retrieving the qgroup data that you want to see. In the end, in the python code, you probably will have to do a similar thing. Iterate over subvolumes (tree root numbers), and then execute some other metadata search operation to get the relevant qgroup info for each of them.

Knorrie

knorrie avatar Mar 02 '22 21:03 knorrie