Jump to content

Data cluster

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Premeditated Chaos (talk | contribs) at 10:31, 3 August 2020 (merge lost cluster). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Disk structure:
(A) track
(B) geometrical sector
(C) track sector
(D) cluster

In computer file systems, a cluster or allocation unit is a unit of disk space allocation for files and directories. To reduce the overhead of managing on-disk data structures, the filesystem does not allocate individual disk sectors by default, but contiguous groups of sectors, called clusters.

On a disk that uses 512-byte sectors, a 512-byte cluster contains one sector, whereas a 4-kibibyte (KiB) cluster contains eight sectors.

A cluster is the smallest logical amount of disk space that can be allocated to hold a file. Storing small files on a filesystem with large clusters will therefore waste disk space; such wasted disk space is called slack space. For cluster sizes which are small versus the average file size, the wasted space per file will be statistically about half of the cluster size; for large cluster sizes, the wasted space will become greater. However, a larger cluster size reduces bookkeeping overhead and fragmentation, which may improve reading and writing speed overall. Typical cluster sizes range from 1 sector (512 B) to 128 sectors (64 KiB).

A cluster need not be physically contiguous on the disk; it may span more than one track or, if sector interleaving is used, may even be discontiguous within a track. This should not be confused with fragmentation, as the sectors are still logically contiguous.

A "lost cluster" occurs when a file is deleted from the directory listing, but the File Allocation Table (FAT) still shows the clusters allocated to the file.[1]

The term cluster was changed to allocation unit in DOS 4.0. However the term cluster is still widely used.[2]

References

  1. ^ http://support.microsoft.com/kb/71609
  2. ^ Mueller, Scott (2002). Upgrading and repairing PCs, p. 1354. ISBN 0-7897-2745-5.