Bug 9046

Summary: df reports wrong sizes on some FUSE filesystems
Product: Busybox Reporter: Natanael Copa <ncopa>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.24.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

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