What is the difference between “Size” and “Size on disk?”

721 views

What is the difference between “Size” and “Size on disk?”

In: Technology

5 Answers

Anonymous 0 Comments

Imagine you have a case of beer. Inside the case it’s broken up into 16 slots, one for each bottle. The slots are bottle sized and so using a bottle is an efficient use of that space. Now imagine you put something smaller in the slot, but you can only put 1 thing in each slot, never 2 or more. If you put something smaller than a beer bottle in the slot, like a stick of gum, the object itself is smaller, but the amount of space it takes up in the box, 1 slot, is the same as the much larger beer bottle. It’s a less efficient use of that space. So the stick of gum is small, but it’s size ‘in the box’ is larger.

A gigabyte is a billion bytes of data, which is a lot. Each file on a disk uses a certain amount of bytes and it’s position on the disk, and what parts of the disk the file is using are all stored in something called a file allocation table, which is a kind of index to the book that is your disk.

Now imagine you tried to keep track of all one billion bytes of space in that file allocation table, the FAT itself would quickly take up a billion bytes itself if it wanted to track file usage in that much detail. It would be wasteful and slow.

So instead the disk space is broken up into blocks of data, like larger chunks that are easier to track. The larger the disk is, the larger these chunks are to keep the file allocation table a healthy size.

Lets say that your disk has a block size of 32,000 bytes and you need to store a file that is 5 kilobytes. The smallest amount of space it can use is 32 kilobytes though because that’s the minimum block size and so the file size would be 5k but size on disk would be 32k.

In general, the larger the file allocation table, the smaller the block size can be for any given disk size. This is why the block size on old fat16 disks was so much more wasteful than fat32, and why fat32 is so much more wasteful than exFAT.

You are viewing 1 out of 5 answers, click here to view all answers.