Gigabytes Vs gibibyte – How Infrastructure displays Disk Data
You may have noticed in the Infrastructure UI when looking at disk metrics that the numbers may not “add up" when faced with common interpretations of disk data. This is because Infrastructure will display the “textbook” conversion rather than the common one.
There are two different number systems which are used to express units of storage capacity: binary, which says that a kilobyte is equal to 1024 bytes, and decimal, which says that a KB is equal to 1000 bytes.
Back when tech folks first started referring to 1024-byte blocks as ‘1 kilobyte’, storage sizes were not very large, and there was not very much difference between a 64 KB memory stick measured in 1024-byte blocks vs. 1000-byte blocks. However, when we start talking about much larger sizes, so that we have 1024 KBs equaling a MB, 1024 MBs equaling a GB, and 1024 GBs equaling a TB, the numbers start to get very skewed when comparing against the decimal interpretations. These days, it’s useful to differentiate between kibibyte (which uses the binary interpretation of 1024 bytes = 1 KB) and kilobytes (which uses the decimal interpretation of 1000 bytes = 1 KB).
There isn’t any inherently wrong data being displayed, it’s just different interpretations of the same data. For example, if you run
df -h on a storage device, you’ll get a representation in gibibyte. The output of this command will display a how many 1 kibibyte(1024) blocks are available on that device. Whereas, with Infrastructure, all the storage data will be displayed in kilobyte (1000 bytes) so there will be a discrepancy, but the fundamental number of bytes will be the same.
A good article from Seagate explaining this is here: http://knowledge.seagate.com/articles/en_US/FAQ/194563en
Here’s an example from a test system:
df -h / Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 41251136 2211576 37303648 6% / 41251136 * 1024 = 42,241,163,264
If you look at the same data in insights, it will show total bytes as =
The Infrastructure UI for this same data will show
42.2 GB (42,241,163,264/1,000,000,000).
Looking at the host, a
df -h / shows 40G which is a gibibyte representation of the same data.
As you can see here, broken down to the byte level, it is the same number of bytes.