Subject: bug#50940: how df utility displays sizes - GB vs GiB

From: Glenn Golden <[email-masked]>
Date: Fri, 1 Oct 2021 10:28:04 -0600

Danie de Jager <[email-masked]> [2021-10-01 15:28:10 +0200]:
> 
> The output from df -h and df -H is always G or M. Depending on who sends me
> usage stats I have to ask how the command was run to make sure I calculate
> usage correctly. Systems like Amazon EC2 use the explicit GiB suffix.
> Making it easier to know what sizes you are looking at.
> 
> Can a future release of df not be improved to print out the GB or GiB?
> 

A patchset submitted last year

    https://lists.gnu.org/archive/html/coreutils/2020-09/msg00001.html

would partially address this (for df, du, and ls) by consistently enforcing
the semantics given in Section 2.3 of coreutils.info (8.32): If that patch
were adopted, units suffixed with "B" (e.g. kB, MB, GB, etc.) would always
imply base-2 units, and B-less suffixes (e.g. k, M, G) would always imply
base-10 units, with no exceptions. ("iB" suffixes would not be used.)

However, the overall issue is more complicated than this, because those
semantics in Section 2.3 are directly contradicted by statements appearing
elsewhere in 8.32 coreutils.info that invert the 2.3 semantics. 

See the above posting (and follow-ups in that thread) for all the gory
details and historical background.

NOTE: I do not know whether the program behavior and documentation described
in the above post is still extant in coreutils release 9.

Glenn Golden