size vs size on disk?

andrewjm

Senior member
Jun 7, 2002
421
0
0
When you go to properties of a folder or something, you see size and size on disk... What is the difference?
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
size is the number of bytes that the file actually consists of. Size on disk is the number of bytes of disk space the file is occupying.

They're not always the same because files get split across sectors of the disk, but if the file doesn't completely fill all the sectors it's using, the remaining psace is wasted, another file won't be written in the same sector.

So, size on disk is usually slightly larger than the actual file size.
 

andrewjm

Senior member
Jun 7, 2002
421
0
0
So if i defrag would the size on disk go down? If it went down, would i have more hdd space?
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: andrewjm
So if i defrag would the size on disk go down? If it went down, would i have more hdd space?

It may go down a bit, and yes, it's possible to get more diskspace from a defrag, however it's usually not very much space.
 

NogginBoink

Diamond Member
Feb 17, 2002
5,322
0
0
Notfred is close, but not quite accurate.

NTFS allocates disk space in units called "clusters." A cluster is an integer number of sectors. Typically, most NTFS volumes use 4K clusters. So a file will consume a multiple of 4K bytes on disk. However, it does not appear that this is the number that is used to calcluate "size on disk," because I have a file that has a size of 1,555,272 bytes and size on disk is the same: 1,555,272 bytes, which is not a multiple of my 4096 byte cluster size.

(If the file is <1KB, the file is stored in the MFT and does not consume a full cluster.)

Then there's NTFS compression. A highly compressible file will use less size on disk than its file size. I think this is where you'll see a different size on disk, is when compression is in the picture.

Defrag shouldn't change the number of clusters a file consumes.

If you want more disk space, the first thing to do is ensure compression is on.
 

ProviaFan

Lifer
Mar 17, 2001
14,993
1
0
Originally posted by: NogginBoink
If you want more disk space, the first thing to do is ensure compression is on.
Compression won't help much with most graphic files (JPEG and GIF are already compressed), so unless you have a ton of Word documents, it won't do much for you except slow your computer down.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Theoretically it shouldn't slow the computer down, if anything it'll help performance because less disk reads will be required when reading a compressed file. And since most computers CPUs aren't taxed the entire time they're in use the decompression should be invisible.
 

kursplat

Golden Member
May 2, 2000
1,547
0
0
come on , has't SOMEONE done benchmarks of this they can post ? i use compression (seemingly without a problem) .