linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Steigerwald <Martin@lichtvoll.de>
To: Goffredo Baroncelli <kreijack@gmail.com>
Cc: linux-btrfs@vger.kernel.org, "Hugo Mills" <hugo@carfax.org.uk>,
	"Michael Kjörling" <michael@kjorling.se>,
	cwillu <cwillu@cwillu.com>,
	"Chris Murphy" <lists@colorremedies.com>
Subject: Re: [PATCH][BTRFS-PROGS] Enhance btrfs fi df
Date: Fri, 2 Nov 2012 12:18:29 +0100	[thread overview]
Message-ID: <201211021218.29778.Martin@lichtvoll.de> (raw)
In-Reply-To: <1351851339-19150-1-git-send-email-kreijack@inwind.it>

Am Freitag, 2. November 2012 schrieb Goffredo Baroncelli:
> Hi all, on the basis of the discussion in the thread
> '[RFC] New attempt to a better "btrfs fi df"', I prepared the following
> set of patches.
> These patches update the btrfs fi df command and add two new commands:
> - btrfs filesystem disk-usage <path>
> - btrfs device disk-usage <path>
> 
> The command "btrfs filesystem df" now shows only the disk
> usage/available.
> 
> $ btrfs filesystem df /mnt/btrfs1/
> Disk size:		 109.00GB
> Disk allocated:		   5.90GB
> Disk unallocated:	 103.10GB
> Used:			 284.00KB
> Free (Estimated):	  63.00GB	(Max: 106.51GB, min: 54.96GB)
> Data to disk ratio:	     58 %

This is coming along nicely.

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

I can test on some other boxes next week, if you want to.

I just wonder about one thing:


merkaba:[…]/btrfs-progs-unstable> ./btrfs fi df /
Disk size:                18.62GB
Disk allocated:           18.62GB
Disk unallocated:            0.00
Used:                     11.26GB
Free (Estimated):          5.61GB       (Max: 5.61GB, min: 5.61GB)
Data to disk ratio:          91 %


merkaba:[…]/btrfs-progs-unstable> ./btrfs filesystem disk-usage /
Data,Single: Size:15.10GB, Used:10.65GB
   /dev/dm-0       15.10GB

Metadata,Single: Size:8.00MB, Used:0.00
   /dev/dm-0        8.00MB

Metadata,DUP: Size:1.75GB, Used:627.84MB
   /dev/dm-0        3.50GB

System,Single: Size:4.00MB, Used:0.00
   /dev/dm-0        4.00MB

System,DUP: Size:8.00MB, Used:4.00KB
   /dev/dm-0       16.00MB

Unallocated:
   /dev/dm-0          0.00


merkaba:[…]/btrfs-progs-unstable> ./btrfs filesystem disk-usage -t /
          Data    Metadata Metadata System System             
          Single  Single   DUP      Single DUP     Unallocated
                                                              
/dev/dm-0 15.10GB   8.00MB   3.50GB 4.00MB 16.00MB        0.00
          ======= ======== ======== ====== ======= ===========
Total     15.10GB   8.00MB   1.75GB 4.00MB  8.00MB        0.00
Used      10.65GB     0.00 627.84MB   0.00  4.00KB            


Metadata, DUP is displayed as 3,50GB on the device level and as 1,75GB
in total. I understand the logic behind this, but this could be a bit
confusing.

But it makes sense: Showing real allocation on device level makes sense,
cause thats what really allocated on disk. Total makes some sense, cause
thats what is being used from the tree by BTRFS.

It still looks confusing at first…

Maybe two sizes: One total with dup / raid1 / raid10 being accounted for
and one without?

Well maybe just leave as is for now. This output is for experienced
users.


merkaba:[…]/btrfs-progs-unstable> ./btrfs device disk-usage /   
/dev/dm-0          18.62GB
   Data,Single:             15.10GB
   Metadata,Single:          8.00MB
   Metadata,DUP:             3.50GB
   System,Single:            4.00MB
   System,DUP:              16.00MB
   Unallocated:                0.00


This is a nice view on the disk. I know its fully allocated by BTRFS,
and in order to make more free space for the data tree for example I´d
need to look at the tree usage and then if it makes sense do a balance
operation.

Well in that case, I plan to migrate metadata and system to single. And
remove the dup trees then.

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

  parent reply	other threads:[~2012-11-02 11:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-02 10:15 [PATCH][BTRFS-PROGS] Enhance btrfs fi df Goffredo Baroncelli
2012-11-02 10:15 ` [PATCH 1/8] Enhance the command btrfs filesystem df Goffredo Baroncelli
2012-11-02 10:15 ` [PATCH 2/8] Create the man page entry for the command btrfs fi df Goffredo Baroncelli
2012-11-02 10:15 ` [PATCH 3/8] Move open_file_or_dir() in utils.c Goffredo Baroncelli
2012-11-02 10:15 ` [PATCH 4/8] Move scrub_fs_info() and scrub_dev_info() " Goffredo Baroncelli
2012-11-02 10:15 ` [PATCH 5/8] Add command btrfs filesystem disk-usage Goffredo Baroncelli
2012-11-02 10:15 ` [PATCH 6/8] Create entry in man page for " Goffredo Baroncelli
2012-11-02 10:15 ` [PATCH 7/8] Add btrfs device disk-usage command Goffredo Baroncelli
2012-11-02 10:15 ` [PATCH 8/8] Create a new entry in btrfs man page for btrfs device disk-usage Goffredo Baroncelli
2012-11-02 11:18 ` Martin Steigerwald [this message]
2012-11-02 12:02   ` [PATCH][BTRFS-PROGS] Enhance btrfs fi df Goffredo Baroncelli
2012-11-02 19:05     ` Gabriel
2012-11-02 19:31       ` Goffredo Baroncelli
2012-11-02 20:40         ` Gabriel
2012-11-02 21:46           ` Michael Kjörling
2012-11-02 23:34             ` Gabriel
2012-11-02 22:06       ` Hugo Mills
2012-11-02 23:23         ` Gabriel
2012-11-02 23:44           ` Hugo Mills
2012-11-03  0:14             ` Gabriel
2012-11-03 12:28             ` Goffredo Baroncelli
2012-11-03 12:35         ` Goffredo Baroncelli
2012-11-03 22:04           ` cwillu
2012-11-03 12:11       ` Goffredo Baroncelli

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=201211021218.29778.Martin@lichtvoll.de \
    --to=martin@lichtvoll.de \
    --cc=cwillu@cwillu.com \
    --cc=hugo@carfax.org.uk \
    --cc=kreijack@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.com \
    --cc=michael@kjorling.se \
    /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).