From: Josef Bacik <jbacik@fusionio.com>
To: Harald Glatt <mail@hachre.de>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: Space usage metering
Date: Fri, 29 Mar 2013 10:12:22 -0400 [thread overview]
Message-ID: <20130329141222.GF1876@localhost.localdomain> (raw)
In-Reply-To: <CAFWF=an6K-qa0krj_PKA-QvBV-Wv21Na0C1Pc3r4eP1_9-MNCg@mail.gmail.com>
On Fri, Mar 29, 2013 at 07:58:40AM -0600, Harald Glatt wrote:
> Hi,
>
> I'm somewhat confused with who is right on what when it comes to
> showing disk usage and space free.
>
> I have a file system that I'm using for testing with a full linux
> installed as well as X and a desktop. I've created a good amount of
> snapshots and I've also done a lot of changes to the system throuhgout
> the process.
>
> I've run a balance before taking these meassurements:
>
> -> df -h reports 59G total space, 18G used, 7G free.
> -> btrfs fi df / reports the following:
> Data, RAID0: total=16.00GB, used=15.58GB
> System, RAID1: total=32.00MB, used=4.00KB
> System: total=4.00MB, used=0.00
> Metadata, RAID1: total=6.00GB, used=974.36MB
>
> So from what I garther the df reports used space somewhat correctly.
> Is it true that my total disk usage should only be around 16.6G now?
> Does that include all space required to store the snapshots as well?
> I'd be pretty amazed at that number because I've changed A LOT between
> snapshots.
>
> Why is df reporting only 7G free? Wouldn't it be possible to make it
> report the sum of total minus used instead which would be at least a
> lot closer to the truth?
>
So you need to include btrfs fi show to get at why df -h reports what it
reports. Basically df does this
total = total bytes
used = total data used * raid multiplier + total system used * raid multiplier +
metadata used * raid multiplier
avail (or free) = (data total - data used) + (total bytes - allocated)
where allocated is the sum of all the data chunks * their raid multipliers. How
many disks do you have in this array? Take whatever that number is and multiply
it by the numbers for the RAID1 chunks and thats how much real space is used.
Thanks,
Josef
next prev parent reply other threads:[~2013-03-29 14:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-29 13:58 Space usage metering Harald Glatt
2013-03-29 14:12 ` Josef Bacik [this message]
2013-03-29 14:18 ` Harald Glatt
2013-03-29 14:27 ` Hugo Mills
2013-03-29 14:31 ` Harald Glatt
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=20130329141222.GF1876@localhost.localdomain \
--to=jbacik@fusionio.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=mail@hachre.de \
/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