Why your 1TB hard drive doesn't have 1TB space.

 I was recently on the market for a new thumb drive to create a portable Linux machine. I was looking for the fastest available thumb drives, and one of the most recommended thumb drives for this type of application is the SanDisk Extreme Pro. The specs look pretty good for a portable Linux drive, since this is basically an SSD in a USB thumb drive. However, if you're anything like me, the first thing you do when you're thinking about buying anything is to go read the reviews and look for any common complaints that may indicate a common issue with whatever your buying. 
The very top review for the SanDisk Extreme Pro right now reads:

"I paid for 1 TERABYTE. I need to use 1 TERABYTE. Why on Earth does the drive only actually come wih (sic) 920 GB? And, WHY ARE CUSTOMERS NOT INFORMED? *Eighty gigabytes* is an enormous amount of storage to lose."



Being around computers for as long as I can remember, I already know that a 1TB drive doesn't show up on my computer as 1TB. If you're reading an article like this one, you probably knew that too.  I only recall that it has something to do with the fact that computers are binary and someone is using 1024 instead of 1000. However, for the life of me I can't remember why this is or exactly what's going on. I decided to investigate. 

What it boils down to, is that math isn't lying. 
The definition of 1 bit is a space that can hold a 1 or a 0. 

A byte is most commonly considered to be 8 bits in a PC.

A kilobyte is 1x10^3 bytes = 1000 bytes

A megabyte is 1x10^6 bytes = 1000000 bytes

A gigabyte is 1x10^9 bytes = 1,000,000,000 bytes

So if you buy a 1 gigabyte hard drive, there will be 1,000,000,000 bytes available on that drive.  

 
Now when you plug it into your computer, because your computer is binary it calculates a byte using binary space. 

A byte is still 8 bits which is  2^0 bytes = 1 byte

a "kilobyte" is calculated as 2^10 bytes = 1024 bytes

a "megabyte" is calculated as 2^20 bytes =  1048576 bytes

a "gigabyte" is calculated as 2^30 bytes = 103741824 bytes

a "terabyte" is calculated 2^40 bytes, and so on. 

And that's where the discrepancy shows up. Your computer is using 1024 bytes and calling that a kilobyte, and your hard drive manufacturer is using 1000 bytes and calling that a kilobyte. By definition, the hard drive manufacturer is correct since all of these prefixes have a mathematically defined meaning that corresponds to the hard drive manufacturers numbers. 

However, since the traditional definition of each of these units turns out to be larger in base 2 than in base 10, the PC will see less space available than your hard drive actually contains . That means if you wanted to store 1 TB of data as your PC calculated it, you'll actually need ~1.24TB of real storage to store it. 

Comments

Popular posts from this blog

Using GIT with Arduino

Programming Arduino with Regular Expressions

Organize your Arduino code with header and class files