From: Calvin Walton <calvin.walton@kepstin.ca>
To: helmut@hullen.de
Cc: linux-btrfs@vger.kernel.org
Subject: Re: wrong values in "df" and "btrfs filesystem df"
Date: Sat, 09 Apr 2011 13:26:38 -0400 [thread overview]
Message-ID: <1302370000.23240.10.camel@nayuki> (raw)
In-Reply-To: <BjX0k26y1uB@helmut.hullen.de>
On Sat, 2011-04-09 at 19:05 +0200, Helmut Hullen wrote:
> >>> Then I work on it, copy some new files, delete some old files - all
> >>> works well. Only
> >>>
> >>> df /srv/MM
> >>> btrfs filesystem df /srv/MM
> >>>
> >>> show some completely wrong values:
> > And I just drew up a picture which I think should help explain it a
> > bit, too: http://www.kepstin.ca/dump/btrfs-alloc.png
>
> Nice picture. But it doesn't solve the problem that I need a reliable
> information about the free/available space. And I prefer asking with
> "df" for this information - "df" should work in the same way for all
> filesystems.
The problem is that the answer to the seemingly simple question: "How
much more data can I put onto this filesystem?" gets pretty hard with
btrfs.
Your case is one of the simpler ones - To calculate the remaining space
for files, you take the unused allocated data space (light blue on my
picture), add the unallocated space (white), divide by the raid mode
redundancy, and subtract some percentage (this is only an estimate, of
course...) of that unallocated space for the additional metadata
overhead.
Now imagine the case where your btrfs filesystem has files stored in
multiple raid modes: e.g. some files are raid5, others raid0.
The amount of data you can write to the filesystem then depends on how
you write the data!
You might be able to fit 64gb if you use raid0, but only 48gb with
raid5; and only 16gb with raid1!
There isn't a single number that btrfs can report which does what you
want.
--
Calvin Walton <calvin.walton@kepstin.ca>
next prev parent reply other threads:[~2011-04-09 17:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-09 6:25 wrong values in "df" and "btrfs filesystem df" Helmut Hullen
2011-04-09 9:11 ` Hugo Mills
2011-04-09 9:46 ` Stephane Chazelas
2011-04-09 12:28 ` Helmut Hullen
2011-04-09 16:36 ` Calvin Walton
2011-04-09 17:05 ` Helmut Hullen
2011-04-09 17:26 ` Calvin Walton [this message]
2011-04-09 18:15 ` Helmut Hullen
2011-04-09 19:35 ` Peter Stuge
2011-04-09 20:38 ` Hugo Mills
2011-04-10 10:13 ` Miao Xie
2011-04-11 7:29 ` Stephane Chazelas
2011-04-11 7:56 ` Arne Jansen
2011-04-11 9:06 ` Helmut Hullen
2011-04-12 7:22 ` Miao Xie
2011-04-12 8:17 ` Stephane Chazelas
2011-04-13 5:35 ` Miao Xie
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=1302370000.23240.10.camel@nayuki \
--to=calvin.walton@kepstin.ca \
--cc=helmut@hullen.de \
--cc=linux-btrfs@vger.kernel.org \
/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).