Record of some of the computer tech I deal with so that it's documented at least somewhere.

Saturday 12 July 2008

Windows File Sizes & Block sizes

As part of another project I did an ad-hoc survey of file sizes on my XP machine to see what would make a good block size.

The bit of python for walking the tree outputs (something like) this :

c://inferno.iso 172632064

Which is filename - size

Graphing was a bit of a waste, too many data points (200k+ files)
So I worked out what kind of wastage would come about for big block sizes.

the block sizes were the ones available for formatting NTFS partitons through Computer Manager .. Disk Management
Format from MyComputer only offers up to 4k

59619370 blocks at 512 = 30525117440 bytes
29862921 blocks at 1024 = 30579631104 bytes
14987043 blocks at 2048 = 30693464064 bytes
7552948 blocks at 4096 = 30936875008 bytes
3837543 blocks at 8192 = 31437152256 bytes
1995407 blocks at 16384 = 32692748288 bytes
1078532 blocks at 32768 = 35341336576 bytes
628801 blocks at 65536 = 41209102336 bytes

It looks like 16k is a reasonable value, 2 million blocks rather than 60 million seems a good trade off.

chkdsk tells me that I am running 4096 sized allocation units (blocks). Next windows install I'm going to try and change that :)
I don't know what the totals don't tally but I don't care about that.

29302528 KB total disk space.
27922384 KB in 206114 files.
79412 KB in 16188 indexes.
0 KB in bad sectors.
309932 KB in use by the system.
65536 KB occupied by the log file.
990800 KB available on disk.

4096 bytes in each allocation unit.
7325632 total allocation units on disk.
247700 allocation units available on disk.

No comments: