From: Chris Murphy <lists@colorremedies.com>
To: Tomasz Chmielewski <mangoo@wpkg.org>,
Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: 100% disk usage reported by "df", 60% disk usage reported by "btrfs fi usage" - this breaks userspace behaviour
Date: Thu, 5 Dec 2019 20:54:10 -0700 [thread overview]
Message-ID: <CAJCQCtQ9Vg9VuT66diid6KdRMDqicxj9xLigTBF4sbMgqD=5jQ@mail.gmail.com> (raw)
In-Reply-To: <eb9cfb919176c239d864f78e5756f1db@wpkg.org>
On Thu, Dec 5, 2019 at 7:04 PM Tomasz Chmielewski <mangoo@wpkg.org> wrote:
>
> I know that "df -h" is not to be trusted with btrfs, but some userspace
> tools (i.e. apt, monitoring checks) rely on it.
>
> Sometimes, "df -h" will report 100% disk usage on a btrfs filesystem,
> while there is still space available and writes are possible.
>
> Linux 5.4.1, LXD containers located in /data:
>
> # df -h
> /dev/nvme1n1 1000G 571G 0 100% /data
>
> # btrfs fi usage /data
> Overall:
> Device size: 1000.00GiB
> Device allocated: 580.02GiB
> Device unallocated: 419.98GiB
> Device missing: 0.00B
> Used: 570.06GiB
> Free (estimated): 429.45GiB (min: 429.45GiB)
> Data ratio: 1.00
> Metadata ratio: 1.00
> Global reserve: 512.00MiB (used: 0.00B)
It does look like a bug. But I'm not sure if this is expected, I
thought such significant disagreements were long since fixed.
What version of coreutils?
Maybe attach a strace of df? (I'm not sure of the list attach size
limit but it's preferred, but something like a pastebin is OK also)
And maybe this will be useful for a dev?
# grep -r . /sys/fs/btrfs/<fs-uuid>/allocation/
You'll need to use the correct fs uuid for the btrfs in question.
> Data,single: Size:578.01GiB, Used:568.54GiB
> /dev/nvme1n1 578.01GiB
df seems to be treating only unallocated space as free, rather than
both unallocated and allocated that is unused. Color me surprised.
--
Chris Murphy
next prev parent reply other threads:[~2019-12-06 3:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-06 2:04 100% disk usage reported by "df", 60% disk usage reported by "btrfs fi usage" - this breaks userspace behaviour Tomasz Chmielewski
2019-12-06 3:54 ` Chris Murphy [this message]
2019-12-07 0:47 ` Tomasz Chmielewski
2019-12-07 1:05 ` Chris Murphy
2019-12-07 1:54 ` Tomasz Chmielewski
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='CAJCQCtQ9Vg9VuT66diid6KdRMDqicxj9xLigTBF4sbMgqD=5jQ@mail.gmail.com' \
--to=lists@colorremedies.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=mangoo@wpkg.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).