Re: [PATCH][BTRFS-PROGS] btrfs filesystem disk-usage

2012-10-03 Thread Goffredo Baroncelli
On Wed, Oct 3, 2012 at 1:46 AM, Chris Mason chris.ma...@fusionio.com wrote:
[...]
 I like it, thanks.  Could you please update btrfs fi df to show this
 instead of adding a new command though?

Hi Chris,
no problem to update the patches, however I have one suggestion:
- leave btrfs fi df as is to no break any script (if any) which
would uses it. Hide it from the help and deprecating it in the man
page. This because the output is very different.
- renaming btrfs fi disk-usage in btrfs fi disk-free, which make sense.

Let me know which choiche you prefer.

BR
G.Baroncelli







 -chris
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][BTRFS-PROGS] btrfs filesystem disk-usage

2012-10-03 Thread Roman Mamedov
On Wed, 3 Oct 2012 08:22:06 +0200
Goffredo Baroncelli kreij...@gmail.com wrote:

 On Wed, Oct 3, 2012 at 1:46 AM, Chris Mason chris.ma...@fusionio.com wrote:
 [...]
  I like it, thanks.  Could you please update btrfs fi df to show this
  instead of adding a new command though?
 
 Hi Chris,
 no problem to update the patches, however I have one suggestion:
 - leave btrfs fi df as is to no break any script (if any) which
 would uses it. Hide it from the help and deprecating it in the man
 page. This because the output is very different.
 - renaming btrfs fi disk-usage in btrfs fi disk-free, which make sense.

1) btrfs is still labeled experimental, so no script author should have
seriously relied on utilities text output to stay unchanged long-term;
personally I don't see modifying it (especially not in some superficial way,
but as a part of major improvement) to be a problem;

2) disk-usage and disk-free are both way too awkward and too long to type,
compared to fi df, and df is the expected shorthand for disk free in the
UNIX land.

-- 
With respect,
Roman

~~~
Stallman had a printer,
with code he could not see.
So he began to tinker,
and set the software free.


signature.asc
Description: PGP signature


Re: [PATCH][BTRFS-PROGS] btrfs filesystem disk-usage

2012-10-03 Thread Sébastien Maury

Hi,

Thanks for this patch.

Personally, i don't mind any of the propositions as the developpement  
is still in progress and may be adapted.

Furthermore, as Roman said, df is more well known for unix users.

Thanks to your work on that, i've started developing a bunch of  
scripts for monitoring btrfs disk usage (and also for monitoring  
snapper if anyone use it) through nagios.


Regards.
Sébastien

Roman Mamedov r...@romanrm.ru a écrit :


On Wed, 3 Oct 2012 08:22:06 +0200
Goffredo Baroncelli kreij...@gmail.com wrote:

On Wed, Oct 3, 2012 at 1:46 AM, Chris Mason   
chris.ma...@fusionio.com wrote:

[...]
 I like it, thanks.  Could you please update btrfs fi df to show this
 instead of adding a new command though?

Hi Chris,
no problem to update the patches, however I have one suggestion:
- leave btrfs fi df as is to no break any script (if any) which
would uses it. Hide it from the help and deprecating it in the man
page. This because the output is very different.
- renaming btrfs fi disk-usage in btrfs fi disk-free, which make sense.


1) btrfs is still labeled experimental, so no script author should have
seriously relied on utilities text output to stay unchanged long-term;
personally I don't see modifying it (especially not in some superficial way,
but as a part of major improvement) to be a problem;

2) disk-usage and disk-free are both way too awkward and too   
long to type,
compared to fi df, and df is the expected shorthand for disk   
free in the

UNIX land.

--
With respect,
Roman

~~~
Stallman had a printer,
with code he could not see.
So he began to tinker,
and set the software free.




This message was sent using IMP, the Internet Messaging Program.


--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][BTRFS-PROGS] btrfs filesystem disk-usage

2012-10-03 Thread Martin Steigerwald
Am Mittwoch, 3. Oktober 2012 schrieb Roman Mamedov:
 On Wed, 3 Oct 2012 08:22:06 +0200
 
 Goffredo Baroncelli kreij...@gmail.com wrote:
  On Wed, Oct 3, 2012 at 1:46 AM, Chris Mason
  chris.ma...@fusionio.com wrote: [...]
  
   I like it, thanks.  Could you please update btrfs fi df to show
   this instead of adding a new command though?
  
  Hi Chris,
  no problem to update the patches, however I have one suggestion:
  - leave btrfs fi df as is to no break any script (if any) which
  would uses it. Hide it from the help and deprecating it in the man
  page. This because the output is very different.
  - renaming btrfs fi disk-usage in btrfs fi disk-free, which make
  sense.
 
 1) btrfs is still labeled experimental, so no script author should have
 seriously relied on utilities text output to stay unchanged long-term;
 personally I don't see modifying it (especially not in some superficial
 way, but as a part of major improvement) to be a problem;

I am not fond of parsing command output unless using specific options that 
some commands provide to just provide one value. I.e. if the command 
provides options specifically for scripts parsing output. And if I do it 
nonetheless, I am not surprised when it breaks at a time, like with find -
ls which now reports decimal part of file modification timestamps.

I think having a library with a function to get those values via a defined 
API would be way to go. Or querying such stuff via udisks or whatever.

I am very happy to see better size reporting.

-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][BTRFS-PROGS] btrfs filesystem disk-usage

2012-10-03 Thread Chris Mason
On Wed, Oct 03, 2012 at 12:22:06AM -0600, Goffredo Baroncelli wrote:
 On Wed, Oct 3, 2012 at 1:46 AM, Chris Mason chris.ma...@fusionio.com wrote:
 [...]
  I like it, thanks.  Could you please update btrfs fi df to show this
  instead of adding a new command though?
 
 Hi Chris,
 no problem to update the patches, however I have one suggestion:
 - leave btrfs fi df as is to no break any script (if any) which
 would uses it. Hide it from the help and deprecating it in the man
 page. This because the output is very different.
 - renaming btrfs fi disk-usage in btrfs fi disk-free, which make sense.
 
 Let me know which choiche you prefer.

I think it is better to replace btrfs fi df.  There should not be many
scripts relying on it yet.

-chris
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH][BTRFS-PROGS] btrfs filesystem disk-usage

2012-10-02 Thread Goffredo Baroncelli
Hi all,

This serie of patches adds a new command called btrfs filesystem
disk-usage. I added this command because it is not so easy to get
the information about the disk usage from the command fi df and fi show.

From the man page (see 2nd patch):

[...]
The  command  btrfs  filesystem  disk-usage is used to query the
status of the chunks, how many space on the disk(s) are used  by
the  chunks,  how many space are available in the chunks, and an
estimation of the free space of the filesystem.
[...]

$ ./btrfs filesystem disk-usage --help
usage: btrfs filesystem disk-usage [-d][-s][-k] path [path..]

Show space usage information for a mount point(s).

-k  Set KB (1024 bytes) as unit
-s  Don't show the summary section
-d  Don't show the detail section

$ ./btrfs filesystem disk-usage /
Path: /
Summary:
  Disk_size: 72.57GB
  Disk_allocated:25.10GB
  Disk_unallocated:  47.48GB
  Logical_size:  23.06GB
  Used:  11.01GB
  Free_(Estimated):  55.66GB(Max: 59.52GB, Min: 35.78GB)
  Data_to_disk_ratio:   92 %

Details:
  Chunk-type  Mode  Chunk-size Logical-sizeUsed
  DataSingle   21.01GB  21.01GB 10.34GB
  System  DUP  80.00MB  40.00MB  4.00KB
  System  Single4.00MB   4.00MB0.00
  MetadataDUP   4.00GB   2.00GB686.93MB
  MetadataSingle8.00MB   8.00MB0.00

Where:
Disk_size   - sum of sizes of teh disks
Disk_allocated  - sum of chunk sizes
Disk_unallocated- Disk_size - Disk_allocated
Logical_size- sum of logical area sizes
Used- logical area used
Free_(Estimated)- on the basis of allocated
   chunk, an estrapolation of
   the free space
Data_to_disk_ratio  - ration between the space occuped
   by a chunk and the real space
   available ( due to duplication
   and/or RAID level)
Chunk-type  - kind of chunk
Mode- allocation policy of a chunk
Chunk-size  - area of disk(s) occuped by the
   chunk (see it as raw space used)
Logical-size- logical area size of the chunk
Used- portion of the logical area
   used by the filesystem



You can pull this change from 
   http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git
branch
   disk_free

Comments are welcome.

BR
Goffredo Baroncelli

Signed-off-by: Goffredo Baroncelli kreij...@inwind.it


--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][BTRFS-PROGS] btrfs filesystem disk-usage

2012-10-02 Thread Chris Mason
On Tue, Oct 02, 2012 at 12:36:08PM -0600, Goffredo Baroncelli wrote:
 Hi all,
 
 This serie of patches adds a new command called btrfs filesystem
 disk-usage. I added this command because it is not so easy to get
 the information about the disk usage from the command fi df and fi show.
 
 From the man page (see 2nd patch):

I like it, thanks.  Could you please update btrfs fi df to show this
instead of adding a new command though?

-chris
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html