Magnetic Disk Systems

 < Day Day Up > 



Windows supports two file systems for magnetic disks: FAT (File Allocation Table) and NTFS (New Technology File System). The latter is the preferred system for Windows NT 4.0, 2000, XP, and Windows Server 2003, but these operating systems still support the older FAT file system for several reasons:

  • Floppy disk use

  • Backward compatibility

  • Use with older versions of Windows in multi-boot systems

To take full advantage of the security, disk quota, and other features of the more recent versions of Windows, however, NTFS must be used.

File Allocation Table (FAT)

The File Allocation Table, or FAT, is the part of the file system that keeps track of where data is stored on the disk. The directory list, which contains such items as the file name, extension, and date, points to the FAT entry where the file starts. FAT was initially used with DOS, and the File Allocation Table file system now has three different versions: FAT12, FAT16, and FAT 32. The numbers used in these versions designate the number of bits used to identify a cluster.

  • FAT12 — The earliest version the file system, FAT12 allows a partition to contain up to 4096 (212) clusters. Because it supports clusters of one to sixteen sectors, the maximum partition size is 32 MB. Windows 2000 only uses FAT12 for floppy disks and for partitions of 16 MB or smaller.

  • FAT16 — FAT16 provides a 16-fold expansion in the number of clusters it identifies, supporting volumes containing 65,536 (216) clusters. It also expands the maximum cluster size to 128 sectors (64 KB) and maximum volume size to 4 GB.

  • FAT32 — To address the need for even larger storage capacity, Microsoft introduced FAT32 with Windows 95 OSR2. Following the pattern of the earlier versions of the file system, it uses 32 bits to designate a cluster; however the last four bits are reserved. Each volume, therefore, can contain up to nearly 270 million (228) clusters, which theoretically translates into an 8-TB volume composed of 32-KB clusters. In practice, however, while Windows 2000 will manage larger volumes created in other operating systems, it limits the size of new FAT32 volumes to 32 GB, as the file system grows quite inefficient beyond that size. To create a larger volume, the system can be dual-booted into either Windows 95 or 98, the volume established using that OS, and then the volume managed using Windows 2000.

The above types of FAT file systems have key architectural elements in common. Several sections actually comprise a FAT volume, starting with the boot sector. Following this are the File Allocation Table itself and, for protection, a duplicate File Allocation Table. Next comes the root directory and finally any other directories and files of the volume. FAT32 also stores a duplicate copy of the boot sector for added reliability (Exhibit 1).

Exhibit 1: File Allocation Table (FAT) Volume

start example

Boot Sector

File Allocation Table

Duplicate FAT

Root Directory

Other Directories and All Files of the Volume

end example

The first three bytes in a FAT boot sector contain a jump instruction telling the CPU that the next several bytes are not executable. After that is an eight-byte original equipment manufacturer (OEM) identifier (ID) that identifies the operating system that formatted the volume. Next comes the BIOS Parameter Block (BPB), which lists the parameters of the volume. These include such items as the number of bytes per sector and sectors per cluster, number of reserved sectors, number of File Allocation Table copies (generally two), number of possible entries in the root directory, and number of sectors in the volume.

Each cluster in the volume has an entry in the File Allocation Table that indicates whether the cluster is bad, whether it contains a file, and, if so, whether it is the last cluster for that file. If the cluster contains a file that is continued in another cluster, the File Allocation Table entry will contain the number of that cluster. If the entire cluster is contained in a single cluster, or if that cluster is the final one for a file spanning multiple clusters, the entry will contain the value "0xfff", which indicates that it is the last cluster.

In FAT12 and FAT16, the root directory or root folder contains 512 entries, each one being 32 bytes. FAT32 permits an unlimited number of entries in the root directory, and that directory can be located anywhere on a hard disk. Each entry begins with the file name in 8.3 format (DOS format). Following this is the attribute byte, which contains six binary flags indicating if the file has been archived, if the entry is a directory or a file, if it is read-only, if it is a hidden file, if it is a system file, and if it is a volume label.

The next 11 bytes tell when the file was created, last accessed, and last modified. After these are 2 bytes identifying the location of the first cluster in the file (the locations of the rest of the clusters are stored in the File Allocation Table). The final entry is a 4-byte number giving the size of the file in bytes, yielding a maximum file size of 4 GB (232).

This root directory structure only natively supports file names using the 8.3 format. For long file names, it uses a truncated version of the file name (e.g., FILENA~1.EXE) for the main entry and assigns additional lines in the directory to list the long name using Unicode. Because the size of the root directory in FAT12 and FAT16 is limited, this reduces the total number of files or directories that can be listed in the root. This is not a problem with FAT32, however, as it does not have this directory-size limitation.

New Technology File System (NTFS)

While each of the FAT versions represents an incremental improvement over its predecessor, NTFS takes a completely different approach to the way that data is organized as a result of Microsoft's desire to increase its share of the corporate marketplace. FAT was a very simple system that worked for PCs, but it lacked the management and security features necessary to compete with UNIX in a networked enterprise environment. The first attempt at a newer file system was the High Performance File System (HPFS) introduced with OS/2 Version 1.2. After the IBM/Microsoft partnership that created OS/2 fell apart, Microsoft created Windows NT, which incorporates some of the features of HPFS into its New Technology File System (NTFS). NTFS is the native file system for Windows NT 4.0, Windows 2000, and Windows XP operating systems. While these operating systems can operate with FAT, many of their features only work with NTFS, so NTFS should be used whenever possible. Fortunately, if one or more FAT partitions is running on one of these operating systems, it is a simple matter to convert them to NTFS without losing any data.

A log-based file system, NTFS addresses the reliability and recoverability problems of FAT. The clusters of a partition are numbered sequentially using a 64-bit logical cluster number (LCN). Theoretically, this system would allow access to 16 exabytes (16 billion GB), which far exceeds current storage needs. For now, Windows 2000 limits volumes to 128 TB, but later operating systems could take advantage of even larger storage capacities. Like FAT, it sets a default cluster size depending on the size of the partition, assigning a size of 4 KB for anything over 2 GB. Also like FAT, administrators can override the defaults and use a drop-down box to specify sizes up to 64 KB (Exhibit 2).

Exhibit 2: Partitions

start example

click to expand

end example

An NTFS partition is divided into four sectors: the Partition Boot sector, Master File Table, Filesystem Data, and a backup copy of the Master File Table. The two sections of the Partition Boot Sector occupy the first 16 sectors. The first section holds the BIOS Parameter Block, which contains information on the layout of the volume and the structure of the file system similar to what was discussed previously for FAT. The boot code to load Windows NT/ 2000/XP resides in the second section.

The next section contains the Master File Table (MFT). When creating an NTFS partition, the system allocates a block (the MFT Zone) that contains 12.5 percent of the capacity of the volume (Exhibit 3). This size is the amount considered necessary to support a volume with an average file size of 8 KB. If the volume will contain a large number of files in the 2- to 7-KB range, the size of the MFT Zone can be increased with the fsutil behavior set mftzone command. This command offers four options: setting 1 is the same as the default, setting 2 reserves 25 percent of the disk, setting 3 reserves 37.5 percent, and setting 4 reserves 50 percent. When the size of the MFT Zone is increased, NTFS does not immediately allocate additional space. But, when the original space allocated to the MFT Zone fills up, additional space will be allocated. Because this results in MFT fragmentation, thereby inhibiting performance, it is best to set the desired size before creating the volume. Keep in mind also that resizing the MFT Zone setting will affect all the NTFS volumes on the computer; it cannot be done for just a single volume.

Exhibit 3: NTFS Partition

start example

Partition Boot Sector

MFT

Duplicate MFT

File System Data

end example

The MFT consists of a series of 1-KB records, one for each file in the partition. The first 16 entries are reserved for the NTFS system files. Record 0 is the MFT itself, and the next 10 include a changes log file for system recovery, information about the volume, the index of the root folder, and a bitmap showing cluster allocation information. The final 5 files are reserved for future use. The MFT is followed by the non-system files of the volume and then by a backup copy of the MFT.

Two types of attributes — resident and non-resident — can be used to describe a record. Resident attributes are ones that fit within the MFT, while non-resident attributes are ones too large to fit in the MFT record. Each resident MFT record contains four types of attributes. The first, standard information, includes such file attributes as the archive bit (which indicates whether or not the file has been backed up) and time stamps that show when the file was created, last modified, and last accessed. The second attribute contains the file names; each file can have multiple names (for example, both a long and a short name), and both would be listed in this space (NTFS supports names up to 255 Unicode characters). The third, the Security Descriptor, contains the Access Control List (ACL) data for the file. The final attribute, data, includes the data of the file itself; small files, under 1 K, can fit entirely within the MFT which speeds up access because the system does not have to first read the MFT to find the location of the desired file and then go fetch the file from elsewhere on the disk. Instead, it is all done in one rapid action.

Most files, however, are far too extensive to fit into the MFT record because the file itself is too large or the ACL is too big. In such a case, the data section of the record contains the locations in the main data portion of the volume where the file contents may be found. Each of these locations is defined by a virtual cluster number (VCN), logical cluster number (LCN), and number of clusters. The VCN is a sequential number relating to each extent of consecutive clusters on the disk that contain the file, and the LCN refers to the location of the first cluster of each extent. If, for example, the file was fragmented into four pieces, the MFT record would list four VCNs (1, 2, 3, 4). If the first extent begins on cluster 6097 and includes clusters 6098 and 6099, then the MFT would have VCN = 1, LCN = 6097, Number of Clusters = 3. The other extents would be similarly numbered. If the file becomes severely fragmented, additional records in the MFT will have to be used to list the additional extents.

Additional NTFS Features

In addition to supporting larger volumes than FAT, NTFS contains other features that make it better for corporate operations:

  • Reliability — A drawback to using FAT is that if a computer goes down it can be difficult to repair the file system. For speedy recovery, NTFS maintains a log of every transaction that affects the file system. These actions are logged before they are performed. Then, when a problem occurs, any incomplete transactions can be completed or changes can be rolled back.

  • Mount Points — All Windows versions assign a different drive letter to each partition or volume on a disk, a procedure that limits the number of accessible volumes to the 26 letters of the alphabet. Mount Points let the administrator attach other partitions to an empty directory within an already mounted NTFS volume. Rather than being limited to NTFS volumes, these additional volumes can also be using FAT16, FAT32, CDFS (CD-ROM File System), or UDF (Universal Disk Format), which expands the functionality of this feature.

  • Access Control — The Security Descriptor function provides hierarchal access control for each file or directory in an NTFS volume. It is important to understand that the security features built into Windows NT/2000/XP work only with NTFS. If FAT is used instead, all security functionality is lost and the organization is at risk.

  • Disk Quotas — NTFS permits assigning storage quotas on a per-user basis. It does this by tracking the Security ID (SID) of anyone who creates a file or directory. When the limit is exceeded, the system sends a "Disk Full" error report and logs it in the Event Log.

  • Encryption — When the computer is running Windows 2000, NTFS includes Microsoft's Encrypting File System (EFS), which automatically encrypts and decrypts files without user intervention. This is particularly useful for remote users, as laptops are frequently lost or stolen and one cannot rely on users to remember to encrypt their files.

These and other features are not available with FAT.

FAT versus NTFS

For most enterprise users, NTFS is the file system of choice. In those cases where there is some doubt, however, here is a summary of the key factors to take into account:

  • NTFS additional capabilities — As discussed above, NTFS offers file access controls and permissions, as well as encryption.

  • Stability — NTFS has much greater stability and resilience than FAT and allows users to roll back system states to earlier configurations after a crash. Having said that, FAT is stable enough for many users and conversion to NTFS is not easily reversed. Users who have a dual boot system that requires a FAT partition to run an earlier version of Windows will find it impossible to dispense with FAT without an OS upgrade.

  • Performance — FAT has size limitations and restrictions that can sometimes lead to wasted disk space. NTFS tends to perform better, although it places more demands on memory and generally requires a larger amount of RAM than FAT does to run well. The better performance of NTFS shows up in such ways as speeding up searches through directories, which are much slower on FAT.

  • Partition size — Today, with partitions growing to sizes larger than 32 GB, NTFS is essential, as FAT will not format partitions above that size. So, for large partitions, NTFS must be used; leave FAT alone.

Converting FAT to NTFS

Converting from FAT to NTFS is relatively simple to achieve and is something that users will need to know how to do, as some computer manufacturers ship systems preloaded with FAT32. Fortunately, Windows 2000 and Windows XP come with built-in utilities to help you with this. All the details are not provided here, as the topic is covered adequately elsewhere. Users can find out how to use these utilities in the Windows help files or just by typing "Converting FAT to NTFS" into a search engine, which will result in plenty of tips, cautions, and suggestions. Such a search may even uncover ways to convert NTFS back to FAT, although such pages are filled with cautions and warnings.



 < Day Day Up > 



Server Disk Management in a Windows Enviornment
Server Disk Management in a Windows Enviornment
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 197

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net