public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: jim owens <jowens@hp.com>
To: Leszek Ciesielski <skolima@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Reporting free space to userspace programs
Date: Fri, 30 Oct 2009 09:21:14 -0400	[thread overview]
Message-ID: <4AEAE84A.5080003@hp.com> (raw)
In-Reply-To: <23a15590910300458y677692bbua62d2b41e9141bc7@mail.gmail.com>

Leszek Ciesielski wrote:
> Hi,
> 
> the results of running 'df' against a btrfs volume are somewhat
> unintuitive from a user point of view. On a single drive btrfs volume,
> created with 'mkfs.btrfs -m raid1 -d raid1 /dev/sda6', I am getting
> the following result:
> 
> /dev/sda6             1.4T  594G  804G  43% /mnt
> 
> while 'btrfs-show' displays much more expected result:
> 
> Label: none  uuid: 46e2f2b6-e3a6-4b02-8fdc-f9d0fb0882e0
>         Total devices 1 FS bytes used 593.15GB
>         devid    1 size 1.36TB used 1.26TB path /dev/sda6
> 
> IMHO it would be more intuitive for df in this case to show 699GB
> total capacity (based on the fact that data is mirrored, and users
> probably are not concerned with metadata handling during normal
> usage), the 'used space' probably should include the space taken up by
> metadata in addition to data usage (after all, this space is not
> available for user data) and free space should report only data space
> available (because this is what the user is usually expecting). Or, in
> other words: the result of 'df' should not concern the user with the
> details of raid0/raid1/raid10 used either for data or metadata.

I agree that df output sucks... but I've been there before with
another filesystem on another OS.  The sad fact is df output is
too simplistic for the features of modern (last 20 years) systems.

There is no way to make df report a value other than "raw space"
(which is what btrfs reports today) that will be accurate under
all possible raid conditions.  The problem is each file can be
stored in a different raid (OK not done now, but permitted) and
different COW state.  That means space_used_per_user_file_block
is not constant.

So btrfs can only report "best case" or "worst case", but neither
will be true.

jim


  reply	other threads:[~2009-10-30 13:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-30 11:58 Reporting free space to userspace programs Leszek Ciesielski
2009-10-30 13:21 ` jim owens [this message]
2010-02-23 22:27   ` Leszek Ciesielski
2010-02-25 23:59     ` Mitch Harder

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=4AEAE84A.5080003@hp.com \
    --to=jowens@hp.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=skolima@gmail.com \
    /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