linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@libero.it>
To: "Sébastien Maury" <sebastien.maury@inserm.fr>
Cc: linux-btrfs@vger.kernel.org, Hugo Mills <hugo@carfax.org.uk>
Subject: [RFC] btrfs fi df output [Was Re: BTRF - Storage Usage]
Date: Thu, 27 Sep 2012 22:39:07 +0200	[thread overview]
Message-ID: <5064B96B.7060502@libero.it> (raw)
In-Reply-To: <20120927124427.6014ddq7wg88cc0o@imp.inserm.fr>

On 09/27/2012 12:44 PM, Sébastien Maury wrote:
> Hi,
>
> I've installed a new server using btrfs for my root partition ("/").
>
> It uses snapper for snapshots management and all seems to work pretty fine.
>
> My problem is to be able to know the remaining REAL free space in my
> partition.
>
> Using different commands, i have different results, and i don't know how
> to interpret them correctly :
> poivron:~ # btrfs filesystem df /
> Data: total=4.01GB, used=2.16GB
> System, DUP: total=8.00MB, used=4.00KB
> System: total=4.00MB, used=0.00
> Metadata, DUP: total=3.00GB, used=429.16MB
> Metadata: total=8.00MB, used=0.00

In effect the output of "btrfs filesystem df /" is not very friendly. 
What about changing the output as below:

$ btrfs filesystem disk-free /
Summary:
   Total: 			135.00GB
   Allocated:			 10.51GB
   Unallocated:			124.49GB
   Free_(Estimated)	   	 86.56GB
   Average_disk_efficiency:  	    62 %

Details:
   Chunk-type      Mode       Allocated        Used        Free
   ----------      ----       ---------    --------   ---------
   Data		  Single        4.01GB	    2.16GB      1.87GB
   System	  DUP	       16.00MB	    4.00KB      7.99MB
   System	  Single	4.00MB	      0.00      4.00MB
   Metadata	  DUP	        6.00GB    429.16MB      2.57GB
   Metadata	  Single        8.00MB        0.00      8.00MB



Where the "Free_(Estimated)" and "Average_disk_efficency" are computed as:
   Average_disk_efficency = ratio of average disk usage =
	(sum(ChunkUsed)+sum(ChunkFree))/sum(ChunkAllocated)

   Estimated_available = Average_disk_efficency *
				Unallocated+sum(ChunkFree)

I am open to suggestion about the terms: Used vs Allocated and Free vs 
Available, or a better description of "Average disk efficiency"


BR
G.Baroncelli

P.S. the source could be find at

	http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git

branch
	disk_free

  parent reply	other threads:[~2012-09-27 20:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-27 10:44 BTRF - Storage Usage Sébastien Maury
2012-09-27 11:09 ` Hugo Mills
2012-09-27 11:25   ` Sébastien Maury
2012-09-27 11:43     ` Hugo Mills
2012-09-27 11:52       ` Sébastien Maury
2012-09-27 20:39 ` Goffredo Baroncelli [this message]
2012-09-27 21:02   ` [RFC] btrfs fi df output [Was Re: BTRF - Storage Usage] Goffredo Baroncelli
2012-09-28  3:17     ` Roman Mamedov
2012-09-28  8:58       ` Hugo Mills
2012-09-28 17:27         ` Goffredo Baroncelli
2012-09-28 20:13           ` Hugo Mills
2012-09-28 21:26             ` Goffredo Baroncelli
2012-09-29  7:19             ` Goffredo Baroncelli
2012-09-29  9:59               ` Sébastien Maury
2012-09-29 11:51                 ` Goffredo Baroncelli
2012-11-12 18:16         ` Jan Engelhardt
2012-09-28 16:44       ` Goffredo Baroncelli
2012-09-28 18:02         ` Roman Mamedov
2012-09-28 19:38           ` Goffredo Baroncelli
2012-09-28 20:20           ` Hugo Mills
2012-09-28 21:26             ` Wade Cline

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=5064B96B.7060502@libero.it \
    --to=kreijack@libero.it \
    --cc=hugo@carfax.org.uk \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    --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).