Learn about the technologies behind the Internet with The TCP/IP Guide!|
NOTE: Using robot software to mass-download the site degrades the server and is prohibited. See here for more.
Find The PC Guide helpful? Please consider a donation to The PC Guide Tip Jar. Visa/MC/Paypal accepted.
|View over 750 of my fine art photos any time for free at DesktopScenes.com!|
Clusters (Allocation Units)
As described here, the smallest unit of space on the hard disk that any software can access is the sector, which normally contains 512 bytes. It is possible to have an allocation system for the disk where each file is assigned as many individual sectors as it needs. For example, a 1 MB file would require approximately 2,048 individual sectors to store its data. The file system HPFS uses this type of arrangement.
Under the FAT file systems (and in fact, most file systems) individual sectors are not used. There are several performance reasons for this. It can get cumbersome to manage the disk when files are broken into 512-byte pieces. A 20 GB disk volume using 512 byte sectors managed individually would contain over 40 million individual sectors, and keeping track of this many pieces of information is time- and resource-consuming. Some operating systems do allocate space to files by the sector, but they require some advanced intelligence to do this properly. FAT was designed many years ago and is a simple file system, and is not capable of managing individual sectors.
What FAT does instead is to group sectors into larger blocks that are called clusters, or allocation units. The cluster size is determined primarily by the size of the disk volume: generally speaking, larger volumes use larger cluster sizes. For hard disk volumes, each cluster ranges in size from 4 sectors (2,048 bytes) to 64 sectors (32,768 bytes). In some situations 128-sector clusters may be used (65,536 bytes per cluster). Floppy disks use much smaller clusters, and in some cases use a cluster of size of just 1 sector. The sectors in a cluster are continuous, so each cluster is a continuous block of space on the disk.
Cluster sizing (and hence partition or volume size, since they are directly related) has an important impact on performance and disk utilization. The cluster size is determined when the disk volume is partitioned. Certain third-party partitioning utilities can alter the cluster size of an existing partition (within limits) but aside from using these, once the partition size is selected it is fixed.
Every file must be allocated an integer number of clusters--a cluster is the smallest unit of disk space that can be allocated to a file, which is why clusters are often called allocation units. This means that if a volume uses clusters that contain 8,192 bytes, an 8,000 byte file uses one cluster (8,192 bytes on the disk) but a 9,000 byte file uses two clusters (16,384 bytes on the disk). This is why cluster size is an important consideration in making sure you maximize the efficient use of the disk--larger cluster sizes result in more wasted space because files are less likely to fill up an integer number of clusters. This issue is given a full treatment here.