Avatar of brittonv
brittonv
Flag for United States of America asked on

Disk Space Calculation Formula

I would like to start by saying this, I think, is a complicated question.  I know that Disk manufactures base the stated disk size on kilo=1000 (decimal math) where computers see it as kilo=1024 (binary math).

However, I am looking for detailed information on how to calculate Formated Disk Space exactly.  How do I take the information that a drive manufacture gives me and figure out what my OS will see when it's formated and all is said and done.  I know how to guess close, but as an educational exercise I wanted to know how to figure it out Exactly (or damn near close).  

That being said if you have a good method for closely estimating the final formated size of a Drive, feel free to share.

For Example I have a 500 Gig Western Digital Hard Drive.  When I check the capacity of the drive in Vista Disk Mananger I see a Capacity of 476812 MB.  Explorer shows the capacity as 499,972,567,040 bytes or 465 GB.  So my formated disk space on my 500 GB Drive is @$465GB.  How how do we get there?

Looking at the Technical information for my drive (WD500KS-00MNB0) I am given the following information:
http://wdc.custhelp.com/cgi-bin/wdc.cfg/php/enduser/std_adp.php?p_faqid=1409
     Physical Specifications:
     Model Number WD5000KS, WD5000AAKS
     Formatted Capacity  500,107 MB
     Used Sectors Per Drive 976,773,168
     Bytes Per Sector 512

There is a foot note that states WD defines a MB as 1,000,000 bytes

So there real size of my drive is 500,107,000,000 bytes or for even more accuracy I can multiply the Sectors by the bytes per sector and get 976,773,168 * 512 = 500,107,862,016 bytes

Okay, my hardrive has 500,107,862,016 bytes.  I can convert that by dividing it by 1024/1024 for MB and 1024/1024/1024 for GB giving me what I presume is my actual disk size of 476,940.023 MB and 465.761742 GB respectively.

That is very close to what my OS says is my disk size.  Again Windows states that my disk capacity is 476,812 MB.  It shows I have 1 MB of unallocated Space giving me a volume of 476,811 MB, or more accurately as shown by my Volume Properties 499,972,567,040 bytes.

And that is as far as I can calculate with the information I have available to me.  My volume is 500,107,862,016 in actual bytes.  The OS formated it out to 499,972,567,040 bytes.  What happened to the 135,294,976 bytes (129 MB) that are missing?  

I assume that it is File System overhead, and NTFS is doing something, but how to I calculate it?  Furthermore how do I calculate it for FAT, FAT32, ZFS, EXT3, etc...  Or is it not the filesystem, but something else coming into play, or are my calculations wrong?

StorageStorage Hardware

Avatar of undefined
Last Comment
Gary Case

8/22/2022 - Mon
nf0rc3r

499,972,567,040 bytes / 1024 = 488254460 Kilobytes
488254460 Kilobytes / 1024 = 476810.99609375 Megabytes
476810.99609375 / 1024 =  465.635738372802734375 Gigabyte

That is how the OS gets 465GB on your "500GB" hard drive.

The missing drive could be used for overheads like you mentioned. Please note that every hard disk has a slightly different amount of freespace (Even if its the same make and model) due to the manufacturing process.
brittonv

ASKER
Thank your for trying to answer, but you merely restated everthing I just said?  I am looking for how to calculate the overhead or what ever beyond converting the specified Drive size from Base 10 to Base 2 Sizes.
ASKER CERTIFIED SOLUTION
Gary Case

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck