|
PC Disk File Systems
By Stephen Bucaro
The first PC file system, called FAT because it used a "File Allocation Table", was
developed in the early 1980’s for floppy disks. The File Allocation Table, a map of
the location of files on the disk, is located near the beginning of the disk. A disk
contains two copies of the FAT, in case one gets damaged.
The FAT file system divides a disk into sections called "clusters". The size of a
cluster depends on the size of the disk. Since the largest 16 bit number is 65,535
(64K), the disk can be divided at most into 64K sections. For example, a 512MB disk
would have an 8KB cluster size.
512MB / 65,535 = 8KB
When a file is written to the disk, a cluster is the minimum allocation unit. So on
a 512 MB disk, a 1KB file wastes 7KB of disk space. Explorer would report the file
size as 1KB, but the wasted space would be deducted from the free space on the disk.
A file is written to the first unused block of space on the disk. As files are
deleted and rewritten in a different size, unused blocks of space become
discontiguous. Parts of individual files become scattered across the disk. That’s
why it’s important to defragment your hard disk occasionally.
A 2GB FAT disk would have a cluster size of 64KB. In this case, a 1KB file wastes 63KB
of disk space. No matter how large a file is, unless the file’s size can be evenly
divided by the size of a cluster, some space is wasted in the file’s last cluster.
2GB / 65,535 = 64KB
The waste situation was getting out of hand, so the size of a FAT partition was limited
to 2GB. In the middle of Windows 95 operating system production, Microsoft released OSR2.
This revision increased the size of FAT entries to 32 bits. The 32 bit file system
was named FAT32, and the 16 bit file system became referred to as FAT16.
Because the largest 32 bit number is more than 2 trillion, the FAT32 cluster size was
fixed at 4KB. This helped the disk space waste problem, but the FAT system could not
accommodate features like security and damaged file recovery that are required for
an advanced operating system. For this reason, Microsoft developed the NTFS (New
Technology File System).
The NTFS Master File Table and all other file system information is contained in
separate files. The maximum NTFS partition is 16 exabytes (an "exa" is a decimal
number 19 digits long). NTFS sets the cluster size depending on the size of the
partition, but you can choose a cluster size when you format a disk.
NTFS can perform file compression and decompression transparently. When you save a
file to a compressed folder, it is automatically compressed. When you open a
compressed file, it is automatically decompressed. You can also compress individual
files by simply setting the files compression attribute.
NTFS can perform file encryption and decryption transparently. Encryption and
decryption work automatically similar to compression, but with one warning. Once a
file is encrypted, only the user who encrypted the file, or the configured "recovery
agent", will be able to decrypt that file. If the user who encrypted the files leaves,
you could lose access to those files permanently. Be sure to assign a qualified
recovery agent before using file encryption.
NTFS allows you to set disk quotas. A disk quota sets the maximum amount of disk space
that can be used. You can specify a disk quota for an individual user, or for all users.
One warning when setting a disk quota: when a user exceeds the disk quota, they will
receive an "out of disk space" message and they may be unable to continue working.
You might think that selecting NTFS instead of FAT32 for your file system would
always be the correct choice. But all those advanced features require overhead. A
NTFS system’s performance can be 20%, slower than an equivalent FAT32 system, or even
slower if compression or encryption is used. You should choose NTFS only when
security is more important than performance.
|