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

From: Pádraig Brady <[email-masked]>
Date: Fri, 1 Oct 2021 17:18:04 +0100

On 01/10/2021 14:28, Danie de Jager wrote:
> Hi,
> 
> 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?

So you're suggesting that `df -h` changes to using IEC suffixes like Gi, Ti etc.
and -H would use the current suffix format to indicate SI units.
That would be the right thing to do if we were adding these options now,
but at this stage I'm not sure it's worth it, because you wouldn't
be sure which version of df you were getting the output from.

For completeness one can get unambiguous output using numfmt like:

   $ df -B1 | numfmt --field - --invalid=ignore --to=iec-i
   Filesystem        1B-blocks        Used  Available Use% Mounted on
   devtmpfs              3.9Gi           0      3.9Gi   0% /dev

cheers,
Pádraig