linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Steigerwald <Martin@lichtvoll.de>
To: linux-btrfs@vger.kernel.org
Cc: "Goffredo Baroncelli" <kreijack@gmail.com>,
	"Chris Mason" <chris.mason@fusionio.com>,
	"Hugo Mills" <hugo@carfax.org.uk>,
	"Roman Mamedov" <rm@romanrm.ru>,
	"Sébastien Maury" <sebastien.maury@inserm.fr>,
	"Ilya Dryomov" <idryomov@gmail.com>
Subject: Re: [PATCH][BTRFS-PROGS][V6] btrfs filesystem df
Date: Mon, 15 Oct 2012 13:51:55 +0200	[thread overview]
Message-ID: <201210151351.55680.Martin@lichtvoll.de> (raw)
In-Reply-To: <1350155699-14338-1-git-send-email-kreijack@gmail.com>

Am Samstag, 13. Oktober 2012 schrieb Goffredo Baroncelli:
> 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

Works nicely:

merkaba:/home/martin/[…]/btrfs-progs-unstable> ./btrfs fi df /
Path: /
Summary:
  Disk_size:                   18.62GB
  Disk_allocated:              18.62GB
  Disk_unallocated:               0.00
  Logical_size:                16.87GB
  Used:                        12.53GB
  Free_(Estimated):             4.34GB  (Max: 4.34GB, min: 4.34GB)
  Data_to_disk_ratio:             91 %

Allocated_area:
  Type        Mode       Size_(disk)    Size_(logical)          Used
  Data        Single         15.10GB           15.10GB       11.84GB
  System      DUP            16.00MB            8.00MB        4.00KB
  System      Single          4.00MB            4.00MB          0.00
  Metadata    DUP             3.50GB            1.75GB      696.70MB
  Metadata    Single          8.00MB            8.00MB          0.00

Tested-By: Martin Steigerwald <martin@lichtvoll.de>

Thanks,
Martin

> 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
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7

      parent reply	other threads:[~2012-10-15 11:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-13 19:14 [PATCH][BTRFS-PROGS][V6] btrfs filesystem df Goffredo Baroncelli
2012-10-13 19:14 ` [PATCH 1/2] Update btrfs filesystem df command Goffredo Baroncelli
2012-10-13 19:14 ` [PATCH 2/2] Update help page Goffredo Baroncelli
2012-10-15 11:51 ` Martin Steigerwald [this message]

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=201210151351.55680.Martin@lichtvoll.de \
    --to=martin@lichtvoll.de \
    --cc=chris.mason@fusionio.com \
    --cc=hugo@carfax.org.uk \
    --cc=idryomov@gmail.com \
    --cc=kreijack@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=rm@romanrm.ru \
    --cc=sebastien.maury@inserm.fr \
    /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 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).