Hi,

On 3/17/19 9:52 PM, Jakub Husák wrote:
> This is a great tool Hans!  This kind of overview should be a part of
> btrfs-progs.

Thing is... this seems super useful because it's super useful for the
exact thing you are currently doing and trying to find out.

Fun thing is, there are a thousand other things in other scenarios that
are interesting to know. Should btrfs-progs implement hardcoded
solutions for all of them? Or cover 80% of what's needed with 20% of effort?

The main reason why I started writing the python-btrfs library is that
it allows me to just quickly write a few lines of code to get some
information, exactly for what I want to know at that point.

In the previous example, writing the table with output is already more
than three times as many lines of code than getting the actual info,
which is a simple 'for chunk in fs.chunks()' and then boom, you have a
lot of info to do something with.

https://python-btrfs.readthedocs.io/en/stable/btrfs.html#btrfs.ctree.Chunk

> Mine looks currently like this, I have a few more days to go with
> rebalancing :)
> 
> flags            num_stripes     physical      virtual
> -----            -----------     --------      -------
> DATA|RAID5                 3      5.29TiB      3.53TiB
> DATA|RAID5                 4    980.00GiB    735.00GiB
> SYSTEM|RAID1               2    128.00MiB     64.00MiB
> METADATA|RAID1             2    314.00GiB    157.00GiB

Ha, nice!

> Btw, I checked the other utils in your python-btrfs and it seems that
> they are, sadly, not installed with simple pip install, which would be
> great. Maybe it needs a few lines in setup.py (i'm not too familiar with
> python packaging)?

Can you share how you're using this?

Personally, I never use pip for anything, so I might not be putting in
there what users expect. My latest thought about this was that users use
pip to have some library dependency for something else, so they don't
need standalone programs and example scripts?

I mainly have debian packages installed everywhere, and otherwise I'm
doing a git clone of the project from github and mess around in there,
with added benefit that I can view history on all files.

Hans

Reply via email to