File Systems – FAT & NTFS





A computer has thousands of files. If there were no organized way of managing them, a computer
would have to search the hard drive every time it wanted to access a particular file. This would
make the computer very slow, provided that it works at all.
A file system manages the files that are stored on the hard drive. The main features are:
+ Efficiently use the space available on your hard drive to store the necessary data
+ Catalogue all the files on your hard drive so that retrieval is fast and reliable.
+Provide methods for performing basic file operations, such as delete, rename, and copy.

Disk Organisation
Before a disk can store data it must be put into a state usable by the computer operating system.
This happens when a disk is formatted.
The disk is divided up into little boxes or sectors each containing 512 bytes. These sectors in turn
are grouped into clusters (sometimes called “allocation units”).


All clusters are given the same size and typically run from 2 to 16 sectors. The cluster size
depends on the operating system and several variables, including the size of the hard disk or its
partitions, and is a key factor in determining operating system efficiency and speed.
Each file occupies one or more of these clusters AND a cluster can only contain one file.
This means a 100 byte file would occupy part of a cluster with the remaining part of the cluster
being wasted. It is therefore better to have clusters as small as possible however there are
limitations as are mentioned below.
In addition to the area where files are stored, there are other areas set aside on the disk for basic
system operations. These are:
  • + an area for boot processes (not covered in this article)
  • + an area for the file system providing information on the physical location and the propertiesof the files. 

When the computer requires a specific file for some purpose, it is this file
information that allows the system to find and load that file from disk into RAM for
processing. Here FAT and NTFS have completely different approaches.

File Allocation Table (FAT)
A File Allocation Table contains an entry for each cluster on the disk.
FAT was introduced back in the days of ‘MS-DOS’. Since then we have had FAT12, FAT16 and
finally FAT32 was introduced as the standard for Windows 98.
A major difference between these systems is the maximum size disk they can manage.
The numbers refer to the number of bits used for the cluster entries in the table. Originally, the
FAT system was limited to hard drives (or partitions) up to 32 megabytes. With the introduction of
FAT16 this was increased to 2 Gigabytes and FAT32 has a theoretical limit of 2 Terabytes.
FAT16

The biggest advantage of FAT16 is that it is compatible across a wide variety of operating systems,
including Windows 95/98/Me, OS/2, and Linux.
The biggest problem of FAT16 is that it has a maximum of 64K clusters per drive (64K is the
largest number that can be contained in 16 binary bits). As hard disks get bigger, the size of each
cluster gets larger. In a 2 gigabyte disk, each cluster is 32 kilobytes (2Gb / 64K), meaning that
even the smallest file on the drive will take up 32 KB of space.
FAT16 also doesn't support compression, encryption, or advanced security techniques.

FAT32
The FAT32 file system, originally introduced in Windows 95 Service Pack 2, is really just an
extension of the original FAT16 file system that provides for a much larger disks and number of
clusters per disk.
However, FAT32 shares all of the other limitations of FAT16, and adds an important additional
limitation - many operating systems that can recognize FAT16 will not work with FAT32 - most
notably Windows NT.
NTFS File System
NTFS (New Technology File System) is much more flexible than FAT. It is not limited by fixed
cluster sizes. Cluster sizes do not normally exceed 4Kb and using a form of file compression the
problem of wasted segments in a cluster is virtually eliminated.
Because it is intended for multi-user environments, NTFS has much more security built in. For
example, the XP Professional version (not the Home version) allows permissions and encrypting to
be applied to individual files. While much more secure, XP is accordingly much harder to tinker
with.
The NTFS system occupies quite a bit of space so is not intended for small disks. Also the amount
of memory required is substantial.
These system overhead requirements, are not as important as newer PCs have larger amounts of
RAM and very large hard drives.

FAT Vs NTFS
The FAT systems are wasteful of disk space when used with large drives. Making smaller
partitions on a large drive can help reduce this problem.
NTFS eliminates the problem of disk space wastage that is encountered with the FAT system
however uses much more disk space to store its own information.
Not all file systems will work with all versions of Windows although NTFS is becoming the standard
for NT, ME, 2000 XP and Vista.
NTFS provides advanced features not found in FAT. For example, NTFS includes built-in security
features such as file and folder permissions and the Encrypting File System (EFS), which is the
technology used to store encrypted files on NTFS volumes. NTFS also provides support for
volumes up to 256 terabytes in size.
The FAT system has been enjoying a come-back with the introduction of thumb or flash drives.
Their smaller capacity makes the FAT system useful.

File Fragmentation
Another problem is file fragmentation. Although a file may require many clusters, the clusters need
not be in close physical proximity on the disk.
When a file is loaded to the disk the operating system chooses unused clusters wherever it finds
them. This means the clusters comprising a file may be scattered all over the disc and the time
required to retrieve them inevitably slows the system.
To improve the retrieval time, a process known as ‘defragmentation’ should be periodically
performed on the disk. This process relocates file clusters so that they are in close proximity to
each other.

Deleting Files
When you delete a file using normal methods you only remove its entry in the file system - you do
not affect the actual clusters that comprise the file.
There are special programs that can recover these programs providing the operating system has
not re-used one or more of the clusters. Special techniques must be used if you wish to delete all
traces of a file.

No comments:

Post a Comment