All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kjörling" <michael@kjorling.se>
To: linux-btrfs@vger.kernel.org
Subject: Re: [RFC] New attempt to a better "btrfs fi df"
Date: Sat, 27 Oct 2012 19:55:13 +0000	[thread overview]
Message-ID: <20121027195513.GS2381@yeono.kjorling.se> (raw)
In-Reply-To: <201210271843.40540.Martin@lichtvoll.de>

On 27 Oct 2012 18:43 +0200, from Martin@lichtvoll.de (Martin Steigerwald):
> Possibly this could be done tabular as well, like:
> 
>                         vdb		vdc		vdd
> Data, RAID 0	307,25MB	307,25MB	307,25MB
> …
> System,RAID1	-		8MB		8MB
> …
> Unused		2,23GB	2,69GB	2,24GB
> 
> I like this. But what if the filesystem has 100 disks?

Maybe I'm just not familiar enough with btrfs yet to punch an
immediate hole in the idea, but how about pivoting that table? Columns
for data values ("data, raid 0", "system, raid 1", "unused", ...) and
rows for the underlying devices? Something like this, copying the
numbers from your example. And I'm using colon here rather than comma,
because I _believe_ that it better captures the intent.

           Data: RAID 0   System: RAID 1   Unused
/dev/vdb     307.25 MB                -        2.23 GB
/dev/vdc     307.25 MB             8 MB        2.69 GB
/dev/vdd     307.25 MB             8 MB        2.24 GB
           ============   ==============   ============
TOTAL        921.75 MB            16 MB        7.16 GB

This feels like it should work quite well as long as only 3-5 columns
plus the device specifier are needed (which would appear to be the
case), and it gives a quick run-down of the numbers at a glance. If
the filesystem consists of a large number of devices, the header could
possibly be repeated just before the "total" row (then something like
"btrfs fi df | tail -n2" will still work for getting the executive
summary). The risk would be if extremely long device names are used,
but that should be relatively trivial to solve. Maybe something like
this if the terminal width does not allow the data for each device to
fit on a single line?

           Data: RAID 0   System: RAID 1   Unused
/dev/disk/by-uuid/f72d74f4-206d-11e2-aa11-cb4348b38f9e
             307.25 MB                -      2.23 GB
/dev/disk/by-uuid/044e48de-206e-11e2-8a63-8366c6174d47
             307.25 MB             8 MB      2.69 GB
/dev/disk/by-uuid/0b1309a2-206e-11e2-aa21-234780dc3782
             307.25 MB             8 MB      2.24 GB
           ============   ==============   ==========
TOTAL        921.75 MB            16 MB      7.16 GB

Both of the above, as you will note, are very similar to how GNU df
solves the same problem. Line breaking could also be disabled if
standard output is not a TTY, which means that for example passing the
output to grep would still work like one would expect.

Any reason why such an output format wouldn't work for a summary view?

-- 
Michael Kjörling • http://michael.kjorling.se • michael@kjorling.se
                “People who think they know everything really annoy
                those of us who know we don’t.” (Bjarne Stroustrup)

  reply	other threads:[~2012-10-27 19:55 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25 19:21 [RFC] New attempt to a better "btrfs fi df" Goffredo Baroncelli
2012-10-25 19:40 ` cwillu
2012-10-25 19:59   ` Goffredo Baroncelli
2012-10-25 20:06     ` cwillu
2012-10-25 20:36   ` Chris Murphy
2012-10-25 20:49     ` cwillu
2012-10-25 20:52       ` Goffredo Baroncelli
2012-10-25 20:03 ` Chris Murphy
2012-10-25 20:11   ` cwillu
2012-10-25 20:41     ` Goffredo Baroncelli
2012-10-26  2:33     ` Chris Murphy
2012-10-26  3:36       ` cwillu
2012-10-26  4:03         ` Chris Murphy
2012-10-27 15:05         ` Chris Murphy
2012-10-27 16:43 ` Martin Steigerwald
2012-10-27 19:55   ` Michael Kjörling [this message]
2012-10-27 22:30     ` Martin Steigerwald
2012-10-27 22:38       ` Hugo Mills
2012-10-27 23:01         ` Michael Kjörling
2012-10-28 10:58           ` Martin Steigerwald
2012-10-28  8:45         ` Goffredo Baroncelli
2012-10-28 10:38           ` Martin Steigerwald
2012-10-28 10:59             ` Goffredo Baroncelli
2012-10-28 11:18               ` Michael Kjörling
2012-10-28 12:25                 ` Goffredo Baroncelli
2012-10-28 12:48                   ` Michael Kjörling
2012-10-28 13:22                   ` Martin Steigerwald
2012-10-27 23:35     ` Chris Murphy
2012-10-28 11:20       ` Michael Kjörling
2012-10-28  9:01 ` Goffredo Baroncelli
2012-10-28 10:33   ` Martin Steigerwald
2012-10-28 10:58     ` Goffredo Baroncelli
2012-10-28 11:16       ` Martin Steigerwald
2012-10-28 18:27         ` Chris Murphy
2012-10-28 19:06           ` Michael Kjörling
2012-10-28 19:42             ` Chris Murphy
2012-10-28 20:09               ` Michael Kjörling
2012-10-28 20:19                 ` Chris Murphy
2012-10-29  9:04                   ` Michael Kjörling
2012-10-30  4:41                     ` Chris Murphy
2012-10-28 19:42             ` Chris Murphy
2012-10-29 13:06             ` Randy Barlow
2012-10-29 22:21 ` [RFC][V2] " Goffredo Baroncelli
2012-10-30  9:42   ` Michael Kjörling
2012-10-30 18:15     ` Goffredo Baroncelli
2012-10-30 18:32       ` Michael Kjörling
2012-10-30 20:13         ` Chris Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121027195513.GS2381@yeono.kjorling.se \
    --to=michael@kjorling.se \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.