| On a disk, the smallest block of data that you can address is a sector. A sector contains 512 bytes of information. If you read data from a disk, it *HAS* to be in 512 byte chunks, even if you only wanted one byte of information.
However, NTFS and FAT operate on the concept of 'clusters'. A cluster is a number of sectors, considered by the file system to be the smallest block. With FAT, the cluster size is determined by the maximum number of clusters available. For FAT16, that's 65,536 clusters. For FAT32, it's 268,435,445 clusters. Each cluster is made up of one or more sectors on the disk, so it has to be a multiple of 512bytes.
It's easiest to illustrate with FAT16. If the disk was 32MB in size, we have 65536 sectors on the disk. This makes it easy, as we can allocate one sector per cluster. However, if the disk was 64MB in size, we have 131072 sectors on the disk, so we have to allocate two sectors per cluster to keep the number of clusters at or below 65536. That gives you an idea to the concept of clusters.
For slack space, remember that the cluster is the smallest space that can be allocated on the disk. Lets say you have a file that's only 10 bytes long. You write it to disk, but the smallest space that can be allocated by the file system is 1024 bytes. Now your 10 byte file is taking up 1024 bytes of disk space! The 1014 bytes that are not being used are slack space. They cannot be used to store another file's information, as they make the smallest unit usable by the filesystem.
Now, the amount of slack space on a disk is dependant on the number of files and their size. If we make the assumption that each file will incur a random amount of slack space, then we can assume that each file will waste half a cluster on average, in slack space. If the cluster size is 2K, then the average file will waste 1K of disk space, regardless of how big the file is.
For NTFS, it's possible to set a cluster to be a sector. By default, NTFS will use a cluster size of 4K for a disk that's over 2GB in size. That means, on average, each file will waste 2K of disk. So, if you want to work out how much slack space there is on your NTFS disk, find out the number of files there, and multiply by 2 to get the approximate amount of slack space in Kb.
Sure, you can set NTFS to use a smaller cluster size, but you're into a compromise situation then. As you shrink the cluster size, the Master File Table (MFT) gets larger, and fragmentation more likely. There's also more overhead in RAM usage.
__________________ |