Units reported by ifconfig

Scott James Remnant scott at canonical.com
Mon Jul 14 10:53:05 BST 2008


On Tue, 2008-07-08 at 10:22 -0700, Brian Murray wrote:

> I recently ran across a bug[0] regarding ifconfig being contradictory
> regarding units used.  The manpage implies that units should be KiB to
> EiB.  However, when actually executing ifconfig the output uses KB to
> EB.  The bug in question is linked to both a Debian bug (still New) and
> a Fedora bug (patched for *iB).  I am bringing this up because it could
> be a design decision as to what units will be displayed.
> 
Our policy is to use the most appropriate unit that might be expected.

For disk sizes and partitioning, we use thousands of bytes since that is
what disk manufacturers use.  This means that a drive that is termed by
the manufacturer as 80 GB will be shown as 80 GB.

For memory sizes and RAM, we use multiples of 1,024 bytes, since that is
what RAM manufacturers use.  This means that a computer with 2 GB of RAM
will be shown as 2 GB.

Since ifconfig deals with bytes streamed, you can arguably claim it
should be multiples of 1,024 or multiples of 1,000.  Someone just needs
to decide.

I would argue that we should use 1,024 since that is congruous with the
power-of-2 relationship between Bytes and bits (and Bytes-per-second and
bits-per-second).  But I'm willing to debate that with someone with a
better argument.

We absolutely _do_not_ use the "KiB", "MiB" or "GiB" forms anywhere!
These should never be displayed, they are wrong for many reasons[0],
have never been adopted outside of the pedant community, and simply
confuse users.

Scott

[0] not in the least that a Byte *CANNOT* be an SI unit, because
    dividing it by 10 is a nonsense value.
-- 
Scott James Remnant
scott at canonical.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/ubuntu-devel/attachments/20080714/c12a19e6/attachment.pgp 


More information about the ubuntu-devel mailing list