On Fri, 8 Mar 2024 at 23:42, Kent Overstreet <[email protected]> wrote:
>
> On Fri, Mar 08, 2024 at 11:37:13PM +0000, Mike Fleetwood wrote:
> > On Fri, 8 Mar 2024 at 01:23, Kent Overstreet <[email protected]> 
> > wrote:
> > >
> > > On Wed, Mar 06, 2024 at 11:14:45AM +0000, Mike Fleetwood wrote:
> > > > On 2024-03-02 04:14, Kent Overstreet wrote:
> > > > > I'm currently updating the 'bcachefs fs usage' command for the disk
> > > > > accounting rewrite, and looking for suggestions on any improements we
> > > > > could make - ways to present the output that would be clearer and more
> > > > > useful, possibly ideas on on new things to count...
> > > >
> > > > [Sorry for any email thread butchering.  I've only just subscribed to
> > > > the list and seen this in the archive.]
> > > >
> > > > Background:
> > > > I'm working on adding some level of support for bcachefs into GParted.
> > > > It wants to be able to report the FS usage (per device) of a file system
> > > > to (1) display in the UI, and (2) to limit how small it allows a
> > > > partition to be shrunk.  (I understand that bcachefs doesn't currently
> > > > support shrinking devices).
> > > >
> > > > What I would like from bcache fs usage is:
> > > > 1. To be able to get free and capacity figures for a device in an
> > > >    unmounted bcachefs file system.
> > > >    EG:
> > > >    bcachefs fs usage /dev/$PTN
> > >
> > > that'll take some work, but should be doable
> > >
> > > > 2. To continue to be able to get free and capacity figures in bytes.
> > > >    Using a command line switch is okay.
> > >
> > > json output?
> >
> > Json output is not required.  Plain human readable text will do.
>
> But it'll be a lot less fragile as things change and are added. We
> really should be getting away from machine parsing of output intended
> for humans.

Okay I'll read json output from bcachefs fs usage when available.

> >
> > None of the other file system tools provide json output so GParted just
> > parses the plain text output they do provide.  These are the commands
> > GParted runs and parses the output from to get usage figures for a few
> > of the file systems it supports:
> >   btrfs inspect-internal dump-super /dev/$PTN
> >   dumpe2fs -h /dev/$PTN
> >   xfs_db -r -c 'sb 0' -c 'print blocksize' -c 'print dblocks' \
> >   -c 'print fdblocks' /dev/$PTN

Reply via email to