linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][BTRFS-PROGS] btrfs filesystem disk-usage
@ 2012-10-02 18:36 Goffredo Baroncelli
  2012-10-02 18:36 ` [PATCH 1/2] Add btrfs filesystem disk-usage command Goffredo Baroncelli
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Goffredo Baroncelli @ 2012-10-02 18:36 UTC (permalink / raw)
  To: linux-btrfs
  Cc: Hugo Mills, Roman Mamedov, Sébastien Maury,
	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-size        Used
  Data        Single       21.01GB      21.01GB     10.34GB
  System      DUP          80.00MB      40.00MB      4.00KB
  System      Single        4.00MB       4.00MB        0.00
  Metadata    DUP           4.00GB       2.00GB    686.93MB
  Metadata    Single        8.00MB       8.00MB        0.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 <kreijack@inwind.it>
	


^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH][BTRFS-PROGS][V1] btrfs filesystem df
@ 2012-10-03 11:43 Goffredo Baroncelli
  2012-10-03 11:43 ` [PATCH 2/2] Update help page Goffredo Baroncelli
  0 siblings, 1 reply; 14+ messages in thread
From: Goffredo Baroncelli @ 2012-10-03 11:43 UTC (permalink / raw)
  To: Chris Mason; +Cc: linux-btrfs@vger.kernel.org, Goffredo Baroncelli

This serie of patches updated the command "btrfs filesystem
df". I update 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  df 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 df --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 df /
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-size        Used
  Data        Single       21.01GB      21.01GB     10.34GB
  System      DUP          80.00MB      40.00MB      4.00KB
  System      Single        4.00MB       4.00MB        0.00
  Metadata    DUP           4.00GB       2.00GB    686.93MB
  Metadata    Single        8.00MB       8.00MB        0.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

Changelog:
V0->V1          Change the name of command from disk-usage to df

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH][BTRFS-PROGS][V2] btrfs filesystem df
@ 2012-10-03 17:22 Goffredo Baroncelli
  2012-10-03 17:22 ` [PATCH 2/2] Update help page Goffredo Baroncelli
  0 siblings, 1 reply; 14+ messages in thread
From: Goffredo Baroncelli @ 2012-10-03 17:22 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Hugo Mills, Roman Mamedov, Sébastien Maury, Ilya Dryomov

>From the man page (see 2nd patch):

[...]
The  command  btrfs  filesystem  df 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 df --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  Show the summary section only
    -d  Show the detail section only

$ ./btrfs filesystem df /
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_size        Used
  Data        Single       21.01GB      21.01GB     10.34GB
  System      DUP          80.00MB      40.00MB      4.00KB
  System      Single        4.00MB       4.00MB        0.00
  Metadata    DUP           4.00GB       2.00GB    686.93MB
  Metadata    Single        8.00MB       8.00MB        0.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

Please pull.

BR
Goffredo Baroncelli

Changelog:
V0->V1          Change the name of command from disk-usage to df
V1->V2		Uses getopt(); replace "-" with "_"; change the behaviour
		of the switches '-s' and '-d'.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH][BTRFS-PROGS][V3] btrfs filesystem df
@ 2012-10-04 17:27 Goffredo Baroncelli
  2012-10-04 17:27 ` [PATCH 2/2] Update help page Goffredo Baroncelli
  0 siblings, 1 reply; 14+ messages in thread
From: Goffredo Baroncelli @ 2012-10-04 17:27 UTC (permalink / raw)
  To: Chris Mason
  Cc: Hugo Mills, Roman Mamedov, Sébastien Maury, Ilya Dryomov,
	linux-btrfs

Hi Chris,

this serie of patches updated the command "btrfs filesystem
df". I update this command because it is not so easy to get
the information about the disk usage from the command "fi df" and "fi show".
This patch was the result of some discussions on the btrfs 
mailing list. Many thanks to all the contributors.

>From the man page (see 2nd patch):

[...]
The  command  btrfs  filesystem  df 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 df --help
usage: btrfs filesystem disk-usage [-k] <path> [<path>..]

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

    -k  Set KB (1024 bytes) as unit

$ ./btrfs filesystem df /
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     Size_(disk) Size_(logical)     Used
  Data        Single       21.01GB      21.01GB     10.34GB
  System      DUP          80.00MB      40.00MB      4.00KB
  System      Single        4.00MB       4.00MB        0.00
  Metadata    DUP           4.00GB       2.00GB    686.93MB
  Metadata    Single        8.00MB       8.00MB        0.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
        Size_(disk)                     -> area of disk(s) occuped by the
                                           chunk (see it as raw space used)
        Size_(logical)                  -> 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

Please pull.

BR
Goffredo Baroncelli

Changelog:
V0->V1          Change the name of command from disk-usage to df
V1->V2          Uses getopt(); replace "-" with "_"; change the behaviour
                of the switches '-s' and '-d'.
V2->V3		Removed the options '-s' and '-d'; replaced Chunk-size 
                and Logical-size with Size_(disk) and Size_(logical).
		Update the man page.


^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH][BTRFS-PROGS][V4] btrfs filesystem df
@ 2012-10-13 17:47 Goffredo Baroncelli
  2012-10-13 17:47 ` [PATCH 2/2] Update help page Goffredo Baroncelli
  0 siblings, 1 reply; 14+ messages in thread
From: Goffredo Baroncelli @ 2012-10-13 17:47 UTC (permalink / raw)
  To: Chris Mason
  Cc: Hugo Mills, Roman Mamedov, Sébastien Maury, Ilya Dryomov,
	linux-btrfs, Martin Steigerwald

Hi Chris,

this serie of patches updated the command "btrfs filesystem
df". I update this command because it is not so easy to get
the information about the disk usage from the command "fi df" and "fi show".
This patch was the result of some discussions on the btrfs 
mailing list. Many thanks to all the contributors.

from the man page (see 2nd patch):

[...]
The  command  btrfs  filesystem  df 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 df --help
usage: btrfs filesystem disk-usage [-k] <path> [<path>..]

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

    -k  Set KB (1024 bytes) as unit

$ ./btrfs filesystem df /
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 %

Allocated_area:
  Type        Mode       Size_(disk)    Size_(logical)          Used
  Data        Single         21.01GB           21.01GB       12.77GB
  System      DUP            80.00MB           40.00MB        4.00KB
  System      Single          4.00MB            4.00MB          0.00
  Metadata    DUP             4.00GB            2.00GB      709.63MB
  Metadata    Single          8.00MB            8.00MB          0.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)
        Type				-> kind of chunk
        Mode                            -> allocation policy of a chunk
        Size_(disk)                     -> area of disk(s) occuped by the
                                           chunk (see it as raw space used)
        Size_(logical)                  -> 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

Please pull.

BR
Goffredo Baroncelli

Changelog:
V3->V4		Removed the switch -d -s from getopt(), aligned the
		column Size_(logical), renamed the fields:
		- Details -> Allocated_area
		- Chunk_type -> Type
V2->V3          Removed the options '-s' and '-d'; replaced Chunk-size 
                and Logical-size with Size_(disk) and Size_(logical).
                Update the man page.
V1->V2          Uses getopt(); replace "-" with "_"; change the behaviour
                of the switches '-s' and '-d'.
V0->V1          Change the name of command from disk-usage to df


^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH][BTRFS-PROGS][V6] btrfs filesystem df
@ 2012-10-13 19:14 Goffredo Baroncelli
  2012-10-13 19:14 ` [PATCH 2/2] Update help page Goffredo Baroncelli
  0 siblings, 1 reply; 14+ messages in thread
From: Goffredo Baroncelli @ 2012-10-13 19:14 UTC (permalink / raw)
  To: Chris Mason
  Cc: Goffredo Baroncelli, Hugo Mills, Roman Mamedov,
	Sébastien Maury, Ilya Dryomov, linux-btrfs,
	Martin Steigerwald

Hi Chris,

this serie of patches updated the command "btrfs filesystem
df". I update this command because it is not so easy to get
the information about the disk usage from the command "fi df" and "fi show".
This patch was the result of some discussions on the btrfs 
mailing list. Many thanks to all the contributors.

from the man page (see 2nd patch):

[...]
The  command  btrfs  filesystem  df 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 df --help
usage: btrfs filesystem disk-usage [-k] <path> [<path>..]

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

    -k  Set KB (1024 bytes) as unit

$ ./btrfs filesystem df /
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 %

Allocated_area:
  Type        Mode       Size_(disk)    Size_(logical)          Used
  Data        Single         21.01GB           21.01GB       12.77GB
  System      DUP            80.00MB           40.00MB        4.00KB
  System      Single          4.00MB            4.00MB          0.00
  Metadata    DUP             4.00GB            2.00GB      709.63MB
  Metadata    Single          8.00MB            8.00MB          0.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)
        Type				-> kind of chunk
        Mode                            -> allocation policy of a chunk
        Size_(disk)                     -> area of disk(s) occuped by the
                                           chunk (see it as raw space used)
        Size_(logical)                  -> 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

Please pull.

Signed-off-by: Goffredo Baroncelli <kreijack@gmail.com>

BR
Goffredo Baroncelli

Changelog:
V5->V6		Th V5 was a wrong patch, please discard it.
V4->V5		Add a close(fd) to avoid file descriptor leaking
V3->V4		Removed the switch -d -s from getopt(), aligned the
		column Size_(logical), renamed the fields:
		- Details -> Allocated_area
		- Chunk_type -> Type
V2->V3          Removed the options '-s' and '-d'; replaced Chunk-size 
                and Logical-size with Size_(disk) and Size_(logical).
                Update the man page.
V1->V2          Uses getopt(); replace "-" with "_"; change the behaviour
                of the switches '-s' and '-d'.
V0->V1          Change the name of command from disk-usage to df


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-10-13 19:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02 18:36 [PATCH][BTRFS-PROGS] btrfs filesystem disk-usage Goffredo Baroncelli
2012-10-02 18:36 ` [PATCH 1/2] Add btrfs filesystem disk-usage command Goffredo Baroncelli
2012-10-02 18:36 ` [PATCH 2/2] Update help page Goffredo Baroncelli
2012-10-02 23:46 ` [PATCH][BTRFS-PROGS] btrfs filesystem disk-usage Chris Mason
2012-10-03  6:22   ` Goffredo Baroncelli
2012-10-03  6:34     ` Roman Mamedov
2012-10-03  6:40       ` Sébastien Maury
2012-10-03  9:14       ` Martin Steigerwald
2012-10-03 11:22     ` Chris Mason
  -- strict thread matches above, loose matches on Subject: below --
2012-10-03 11:43 [PATCH][BTRFS-PROGS][V1] btrfs filesystem df Goffredo Baroncelli
2012-10-03 11:43 ` [PATCH 2/2] Update help page Goffredo Baroncelli
2012-10-03 17:22 [PATCH][BTRFS-PROGS][V2] btrfs filesystem df Goffredo Baroncelli
2012-10-03 17:22 ` [PATCH 2/2] Update help page Goffredo Baroncelli
2012-10-04 17:27 [PATCH][BTRFS-PROGS][V3] btrfs filesystem df Goffredo Baroncelli
2012-10-04 17:27 ` [PATCH 2/2] Update help page Goffredo Baroncelli
2012-10-13 17:47 [PATCH][BTRFS-PROGS][V4] btrfs filesystem df Goffredo Baroncelli
2012-10-13 17:47 ` [PATCH 2/2] Update help page Goffredo Baroncelli
2012-10-13 19:14 [PATCH][BTRFS-PROGS][V6] btrfs filesystem df Goffredo Baroncelli
2012-10-13 19:14 ` [PATCH 2/2] Update help page Goffredo Baroncelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).