Bug 9046 - df reports wrong sizes on some FUSE filesystems
Summary: df reports wrong sizes on some FUSE filesystems
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.24.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-23 08:32 UTC by Natanael Copa
Modified: 2016-08-03 13:35 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Natanael Copa 2016-06-23 08:32:15 UTC
On docker for mac the `df` utility reports wrong sizes due to use of the statfs f_bsize instead of f_frsize:

OSX reports the following correct sizes:

$ df -h /tmp
Filesystem   Size   Used  Avail Capacity  iused    ifree %iused  Mounted on
/dev/disk1  233Gi  145Gi   88Gi    63% 38064107 22976051   62%   /


While busybox in docker reports on a FUSE mounted filesystem (mapping /tmp on osx host to /tmp in alpine linux container):

$ docker run --rm -it -v /tmp:/tmp alpine df -h /tmp
Filesystem                Size      Used Available Use% Mounted on
osxfs                    58.2T     36.2T     21.9T  62% /tmp


With coreutils it reports correct size:

$ docker run --rm -it -v /tmp:/tmp alpine sh -c "apk add --no-progress -U coreutils && df -h /tmp"
...
Filesystem      Size  Used Avail Use% Mounted on
osxfs           233G  145G   88G  63% /tmp

This thread from coreutils discusses the issue:
https://lists.gnu.org/archive/html/bug-coreutils/2012-05/msg00017.html
Comment 1 Natanael Copa 2016-08-03 13:35:57 UTC
fixed with commit 8f4faa1e3db91fc7b50d633e6f9b2f04bf978bb2