Re: file size output mismatch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/24/07, Michael Cashwell <mboards@xxxxxxxxxxxx> wrote:
> On Sep 24, 2007, at 11:53 AM, Greg Freemyer wrote:
>
> > On 9/24/07, Adil Mujeeb <mujeeb.adil@xxxxxxxxx> wrote:
> > <snip>
> >> adil@test:~> ls -lh test
> >> -rw-r--r-- 1 adil group 2.0G 2007-09-24 23:51 test
> >> adil@test:~> du -h test
> >> 2.1G    test   <--------------------- why it is showing 2.1 GB
> >>
> >> I could not understand this difference. Could anybody explain this
> >> behavioour?
> >
> > <snip>
> > ie. "ls" is reporting Gibibytes and "du" is reporting Gigabytes.
>
> That does seem to be the case:
>
> 2147483648 / 1024^3 = 2.000
> 2147483648 / 1000^3 = 2.14748... Which rounds to 2.1.
>
> It's unfortunate that ls in this case doesn't use the new unit's
> abbreviation. It does its math so as to return Gibibytes but then
> fails to use the "GiB" unit so the user knows it did that.
>
> This whole issue really gets interesting when you start looking at
> prices for data-center-class storage. You have big numbers for both
> money and bytes. No one would think to say $1M is really $1,048,576
> but programmers and users disagree on whether 1MB is 1,048,576 or
> 1,000,000 bytes.
>
> Fun!
>
> -Mike

And it gets worse as data sizes grow.  iirc:

KB v. KiB  = 2.4% error
MB v. MiB = 4.8% error
GB v. GiB = 7% error
TB v. TiB = 11% error
PB v. PiB = 15% error

The disk drive manufactures have been using GB as 1,000,000,000
consistently for many years.  It is the software teams that have not
made the change (or are changing very slowly).

Given that you can buy a TB size drive for under $500, it really is
time for all this to get straightened out.  An 11% unknown is just too
much to ignore.

Greg
-- 
Greg Freemyer
Litigation Triage Solutions Specialist
http://www.linkedin.com/in/gregfreemyer

The Norcross Group
The Intersection of Evidence & Technology
http://www.norcrossgroup.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux