To make things a little simpler than managing a large number of sectors, the
operating system groups sectors together into a minimum allocation unit called a
cluster. When a request to create a file occurs, the operating system allocates
a cluster at a time until the all the data is stored. This raises a question.
How are all the clusters of a file linked together?
The previous diagram also illustrates the linking of the file clusters in a
chain, with the last cluster signifying that there are no more clusters
allocated to the file. One of the problems of using clusters as a minimum
storage allocation unit is the wastage of space. Consider a cluster allocate of
two sectors, each sector storing 1024 bytes (or characters). This means a
minimum storage allocation of 2048 bytes. If you stored a file containing the
phrase “Hello”, then this would result in 2043 unused bytes in the cluster (most
operating systems store the length of the file, so there is no need to use an
end of file marker, which would occupy an additional byte). You might consider
that a smaller allocation size based on the size of a sector would be more
efficient. However, it becomes more complex to manage smaller cluster sizes and
they take up more space (the table becomes larger and it takes more time to go
through all the entries).