Partition Magic - Partition Manager Software

Extend partition with one step
Resize/Move partition without data loss.
Create, delete and format partion with simple steps.
Copy partition and disk to transfer data with ease. Support disk and partition size larger than 2 TB. Keep your data safe even in case of power outages or hardware failure.
Partition Magic - Partition Manager Software buynow download

A file as a chain of clusters

  • A file on a disk is stored as a chain of clusters. A cluster consists of one or more sectors, the number of sectors per cluster depends on partition size and equals a degree of 2 (1, 2, 4, 8, 16, etc.). Each cluster has its number with numeration beginning with 2.

    The File Allocation Table (FAT) describes the order of folders and files in clusters. Each cluster corresponds to a FAT element (a table cell).

    FAT elements can indicate of the following values:
    • 0 - free cluster
    • 2 - the number of the next element in a cluster chain (0FEFh - for FAT12, 0FFEFh - for FAT16, 0FFFFFEFh - for FAT32)
    • 0FFF0h - 0FFF6h - reserved values
    • 0FFF7h - bad cluster
    • 0FFF8h - 0FFFFh - last cluster in a chain

    To read a file it is necessary to find its record in a folder by its name and to read the number of the 1st file cluster. The first cluster represents the beginning of a file. Then it is necessary to read a FAT element corresponding to the first cluster of a file. If this element contains a «last in chain» label, there's no need to continue searching: this file is simply located in a single cluster. If a cluster is not the last, it contains the number of the next cluster. Contents of the next cluster should be read after the first. When the last cluster in a chain is found, it is necessary to cut off the remaining bytes of the cluster, if this file does not occupy all of it. Extra bytes are cut off according to the file length stored in the record.

    To write a file the operating system has to execute the following sequence of actions. Create a file description in a free element, then search for a free FAT element, and place the reference to it to a folder record. Fill the first cluster described by the FAT element found. Place the number of the next cluster or an attribute of the last cluster in a chain to this FAT element.

    The operating system operates in this way to add next clusters to chains according to the increasing number. It's clear that consistently located clusters can be addressed much faster than if they were randomly spread along the disk. At that clusters that are already occupied and clusters marked in FAT as defective are leaved out.

    File deletion (abstracting from a Recycle bin that appeared in Windows 95) comes to declaring all file clusters free (along with zeroing of corresponding FAT elements) and replacing the first symbol of file name in the record by 0E5h value. Operating system ignores such elements during a usual search.