Little Things Doth Crabby Make – Part XI. Gigabyte or Gibibyte? Apparently Both!

It’s been a while since I’ve posted an installment in my Little Things Doth Crabby Make series. While I’m not feeling particularly crabby, I have to admit that this one just got under my skin today.

Giga, Gibi, Giggly
I’m like most of you when it comes to computer capacity nomenclature. In spite of standards bodies I just can’t bring myself to think of a gigabyte as 10^9 bytes. The guys that sell memory still sell 2^30 bytes and processor caches are still sized in multiples of 2^20 bytes (a.k.a. old school Megabytes). But, according to standards bodies a gigabyte is 1000000000 bytes and what I refer to as a gigabyte is actually a gibibyte or 1073741824 bytes.

Network technology has always used the decimal nomenclature (e.g., megabit, gigabit) and since about the late 1990s hard drive manufactures switched to decimal. So, usually when we install something like a 600GB (gigabyte) drive and partition it we see 558 gibibytes such as this drive in the Sun Oracle Exadata Storage Server:

# cat /proc/partitions | grep sdh
   8   112  585531392 sdh
# bc -l
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
(585531392 * 1024) / (2^30)
558.40625000000000000000

Help Me Please, He’s Boring Me To Death!
I know, and I apologize. But let me just take one more moment of your time to show you what little thing hath crabby made. It’s all about the content in the following box. I tell dd(1) to write to disk exactly 1GB (a.k.a. “Kevin gigabyte”). That is, I want dd(1) to use a single call to LibC write to fill out 2^30 bytes. That works you know as long as you have address space and physical memory. Anyway, back to the topic. So, I set dd(1) out to create a 2^30 bytes, er, I mean 1GB file and so it did. But, it reported its success to me as if it was a real strict IEEE or networking sort of guy. In the box you’ll see that it reported it wrote 1.1GB and it did—1.1 gigabytes.

Sorry, I’m still boring you to death.

So the thing that made me crabby was the fact that I followed up the dd(1) command with an ls(1) command using the Linux –h option which, according to the manpage, reports sizes to me in “human readable” form. That’s OK with me since to me K,M,G are all powers of two and I’m a human. But I thought we were supposed to start rethinking our way to the decimal nomenclature. Hmmm. See for yourself:

# dd if=/dev/zero of=GB bs=1073741824 count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 2.4089 seconds, 446 MB/s
# ls -lh GB
-rw-r--r-- 1 root root 1.0G Jan  6 14:48 GB

Nah, that didn’t really make me that crabby. I do get tired of the decimal thing though. But worse than that is the schizophrenia dd(1) exhibits. The following is what really made me crabby:

$ dd if=/dev/zero of=1G bs=1G count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 1.19684 seconds, 897 MB/s

Now that is a good one! It’s sadly schizophrenic but entertaining.

12 Responses to “Little Things Doth Crabby Make – Part XI. Gigabyte or Gibibyte? Apparently Both!”


  1. 1 Curtis Ruck January 7, 2010 at 2:28 pm

    It despises me when dealing with various storage devices that a vendor’s management application will use different forms of 1GB depending on location. Or, asking for 4GB of ram in VMware actually gives you 3.7GB.

  2. 2 Doug Burns January 7, 2010 at 4:27 pm

    Not boring me. I vaguely remember asking if you’d clarify some of this stuff for people 😉

  3. 5 DvE January 8, 2010 at 5:51 am

    Well, in G actually means Gibibyte in dd and GB means Gigabyte.
    Maybe it’s all just BS or did they change that too? 🙂

  4. 6 glennfawcett January 8, 2010 at 6:31 am

    You need to switch to a more refined Operating System 🙂 Guess the OS below and I will buy you a beer….

    $ dd if=/dev/zero of=GB bs=1073741824 count=1
    1+0 records in
    1+0 records out

    $ ls -lh GB
    -rw-r–r– 1 oracle dba 1.0G Jan 3 05:56 GB


  1. 1 Little Things Doth Crabby Make – Part XII. Please, DD, Lose My Data! I Didn’t Need That Other 4K Anyway. « Kevin Closson’s Oracle Blog: Platform, Storage & Clustering Topics Related to Oracle Databases Trackback on June 17, 2010 at 12:51 am

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




DISCLAIMER

I work for Amazon Web Services. The opinions I share in this blog are my own. I'm *not* communicating as a spokesperson for Amazon. In other words, I work at Amazon, but this is my own opinion.

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 2,976 other followers

Oracle ACE Program Status

Click It

website metrics

Fond Memories

Copyright

All content is © Kevin Closson and "Kevin Closson's Blog: Platforms, Databases, and Storage", 2006-2015. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Kevin Closson and Kevin Closson's Blog: Platforms, Databases, and Storage with appropriate and specific direction to the original content.

%d bloggers like this: