I am facing typical "size on disk" issue on windows 2008 OS.

I am using NTFS partition with cluster size of 4k and in that Size of disk is almost triple the real size. This is becaus I have large number of small files in the system.

I tries to reduce the cluster size to 2kb but in that also but that also didnt help me to reduce the "size on disk" very much.

I tried to use the compression by ticking "Compress this drive to save disk space" but that also didnt help me to reduce the "size on disk" at all. it seems compression does not work properly on small files.

I tried to use the compression + 2kb cluster but that also didnt help me to reduce the "size on disk". If I open 1 single file's property then it says size as "1.33 KB" and size on disk "4.00 KB" !! how this can happen as my cluster size is already 2kb. I checked cluster size using following command.

fsutil fsinfo ntfsinfo

Can anybody suggest me what option do I have to reduce disk space?

  • 1
    The real solution to this is don't write tons of tiny files, consolodate them or use a database where appropriate.
    – JamesRyan
    Feb 2 '12 at 13:07
  • I can not as that is the output of the application. I am planning to create batch file or some thing and that will create archive of all small files and put this batch file as scheduled job.. hope fully it will helps
    – swd
    Feb 3 '12 at 5:11

I do not know what methods Explorer is using to calculate "size on disk", but if it actually takes into account all the clusters used for the MFT as well as the additional data, you might see the effect of a file growing slightly greater than 2K (one cluster in your example) due to the space taken by its additional attributes or alternate streams.

NTFS stores most of the information about a file (with the exception of the file name, which is stored in the directory) in the Master File Table (MFT). This includes the various time stamps, the ACLs and even the file data itself (stored as the value of the "data" attribute), if it is small enough to fit into the MFT record. The exact MFT record size is based on the cluster size of the file according to the documentation and probably equals the cluster size in your case. So if your file metadata is too large to make the data attribute fit into the MFT record, a new "extent" cluster is reserved for it and a pointer is placed within the MFT record - at this point, your file would occupy at least 2 clusters (or 4K) of disk space.

You also should not dismiss the possibility that Explorer might simply be wrong about the "size on disk". Consider lowering the cluster size even further down to 1K or 512 bytes and re-check.

  • thanks.. tried with 1k, result is not so good.. I have mostly files ranging from 1kb to 5kb in directory and number of files are in millions..!! I also read somewhere that reducing the cluster size increases the indexes..
    – swd
    Feb 2 '12 at 13:13
  • @swd How good was "not so good"? You just would need a dozen of differently sized files for testing to see how much space they would occupy on the volume. The indexes (directory B-Trees, I suppose) have nothing to do with cluster size.
    – the-wabbit
    Feb 2 '12 at 16:26
  • hmm.. it was around 12% more free space.. that is not much as size of data is 10 GB and size on disk is 88GB !!
    – swd
    Feb 3 '12 at 5:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.