Brief Introduction of Cluster
A cluster refers to the minimum disk space that can be allocated to save files. When creating a very small file, such as one byte, it does not occupy only one byte of space on the disk, but the entire "cluster". Cluster is a logical concept used by the operating system, not the physical characteristics of the disk. In order to better manage the disk space and read data from the hard disk more efficiently, the operating system stipulates that only one file can be placed in a cluster, so the space occupied by the file can only be an integer multiple of the cluster. If the actual size of the file is smaller than a cluster, it also occupies a cluster of space. If the actual size of the file is larger than one cluster, according to the logical calculation, the file will occupy two clusters. Even if the file has only 0 bytes, it is not allowed for two files or more than two files to share a cluster, otherwise, it will cause data confusion.
The concept of cluster only applies to the data area. The system depends on different storage media (such as floppy disks, hard disks), hard disks of different capacities, and cluster sizes are different. The size of the cluster can be obtained in the so-called Disk Parameter Block (BPB). Each cluster can include 2, 4, 8, 16, 32, or 64 sectors. The smaller the cluster, the higher the efficiency of storing information.
In the FAT16 file system, each partition has 65,525 clusters at most, and the default cluster size is 32KB; the cluster used in the FAT32 file system is smaller than FAT16, and the default is 4KB.
How to set the cluster size in the NTFS file system
By default, if the cluster size is not specified when formatting, the system will select the default cluster value according to the partition size. In fact, when formatting in the NTFS file system, you can add the "/a:UnitSize" parameter after the "Format" command to specify the size of the cluster. UnitSize represents the value of the cluster size. NTFS supports 512/1024/2048/4096/8192/16K/32K/64K. For example, "format d:/fs:NTFS/a:4096" means format D disk with NTFS file system, and the cluster value is 4096B.
Use the default settings
For beginners, there is actually no need to manually set the size of the cluster, because in general, the default setting is sufficient. For example, when formatting a partition with the NTFS file system, the system will automatically select the default cluster size according to the size of the partition, such as 4KB.
The size of the cluster varies with the size of the hard disk partition
In the NTFS file system, when the partition size is below 2GB, the cluster size should be smaller than the corresponding FAT32 cluster, that is, less than 4KB; when the partition size is above 2GB (2GB~2TB), the cluster size should be both 4KB.
Use the compression function to the cluster size requirements
In Windows 2000/XP, in order to use the compression function to save disk space, two conditions must be followed:
1. The disk partition must be NTFS file system;
2. The size of the cluster in the partition must not exceed 4KB (the default cluster size is 4096 bytes).
The impact of cluster size
In the NTFS file system, the size of the cluster will affect the arrangement of the disk files. Setting an appropriate cluster size can reduce the loss of disk space and the number of fragments on the partition. If the cluster is set too large, it will affect the disk storage efficiency; if it is set too small, although the utilization efficiency will be improved, a large amount of disk fragmentation will be generated.