Taking a hard disk from its pristine, newly manufactured state to a fully functional DOS or Windows ’95 storage area requires three steps: Physical formatting, partitioning, and logical formatting. To understand what each step does, let’s take a brief look at how hard disks operate. Hard disks are mechanical devices consisting of several stacked platters (small, round metal disks treated to store magnetic charges on both sides), a spindle around which the platters rotate (much like the centre post on a record turntable), and read and write heads attached to the disks by a mechanical arm. The read and write heads allow magnetic charges to be stored on the disk (as bits) and retrieved from it. When you direct a program to load a file from the disk, the platters spin around the spindle and the read head moves back and forth over the platters until it locates the desired bits. Software in the hard disk and the hard disk controller then loads the bits into RAM. When you save data, your computer transfers a series of bits to the hard disk, recorded by the write heads as magnetic charges. From the standpoint of your computer, the hard disk is completely useless until it undergoes the formatting and partitioning stages. The first of these stages is physical or low-level formatting that in most cases is handled by the manufacturer (older drives and SCSI drives have utilities that refresh low-level formats, but IDE drives don’t). Low-level formatting essentially gives the disk its physical structure. It adds tracks, sectors, and cylinders, terms with which you’re familiar if you’ve ever had the pleasure of installing a new hard disk. You can think of tracks as being like the grooves on a long-playing record, although tracks are laid out in separate concentric circles rather than one long, continuous spiral like the grooves on an LP. Tracks are divided into sectors each of which can store a given amount of data, and each platter has its own tracks and sectors. A cylinder encompasses all platters comprising the corresponding track—that is, the track that is the same distance from the spindle—on each. To visualise cylinders think of a tall stack of pancakes and a number of drinking glasses, each having a different diameter. Centre a glass above the pancakes then push down right through the entire stack. Then do the same with each remaining glass. The vertical configurations you’ve produced are cylinders. Once a hard disk has been physically formatted, it can be divided into physical regions called partitions. Each partition occupies a group of contiguous cylinders and with some operating systems (Linux, for example), you can specify precisely which cylinders you want each partition to occupy. The purpose behind partitioning is to segment your hard disk, for organisation’s sake and also to let you run multiple operating systems on a single computer. Each operating system works best (and sometimes solely) with its own file system, and only one file system can exist in a single partition. Under some file systems, there’s a third reason for multiple partitions — to cut down on wasted space. We’ll deal with all these reasons a little later in this article. Even with your partitions in place, the hard disk is still useless to your computer. To make each partition capable of storing information, it must be logically formatted. Where physical formatting gives your disk it’s physical structure, logical formatting (which is unrelated to physical formatting) provides a means of exchanging data with the operating system by giving the disk a logical structure, the file system. When you use the Format command in DOS or the Format menu item in Windows Explorer, you are initiating a logical format of either a floppy disk or a hard disk. File Systems The sole purpose of logical formatting is to place a file system on the disk. Your operating system determines what file system is available to you; you rarely get a choice. The most common file systems for machines driven by Intel processors are: • FAT (File Allocation Table) — the standard file system for DOS and Windows. Because of its widespread use, FAT is also accessible by Linux, OS/2, Windows NT, and other operating systems. • VFAT (Virtual File Allocation Table) — a protected-mode version of the FAT file system, used by Windows ’95. It is compatible with the FAT system, the main difference being support for long filenames. • NTFS (NT File System) — Windows NT’s native file system. You can install Windows NT on a FAT partition, but NTFS is far more advanced, with better security and reliability, faster file access, and very little wasted space. • HPFS (High Performance File System) — OS/22’s native file system. As with NTFS, which evolved from HPFS, the security, reliability, speed, and efficiency are far superior to FAT’s. • FAT32 (32-bit File Allocation Table) — included with Windows ’95 OSR2, a version that is only available preinstalled by the system manufacturer. FAT32 gets rid of many FAT limitations. But so far, it can’t be accessed by anything other than Win95 OSR2. Partitions, and Partitions? If you’ve played with fdisk at all, you’re probably familiar with primary, extended, and logical partitions. Primary and extended are major partition types and the total number you can have on your hard disk is limited. You can divide each hard disk into, as many as four major partitions, and only one of those can be an extended partition. Note that these limitations have nothing to do with the operating system. They stem from a decision, made by drive and BIOS manufacturers in the early years of hard disks, that four partitions should be enough for anyone (a bit like DOS’ 640K memory limit). The extended partition was developed in response to the need for more than four partitions. An extended partition can itself be divided into as many logical partitions as you wish; in a sense, the extended partition acts as a container for them. In a system with multiple operating systems, it’s common to have a primary partition for each OS and an extended partition, subdivided into three or four logical partitions, for the OS you use most frequently. In the DOS/Windows ’95/Windows NT world, drive letters are assigned according to partition type. When your computer boots, it checks the master boot record, which is usually on the first sector of the first disk, and reads the partition table in that record. The partition table tells the computer how the disks are partitioned, and the operating system assigns letters accordingly. The designations A: and B: are reserved for floppy disk drives, and the active primary partition (only one can be active) on the first hard disk is assigned C: Now the first primary partition on each additional hard disk gets the next letter in sequence. Once the primary partitions on all hard disks have been assigned letters all logical partitions on the first hard disk take their turn, followed by all logical partitions on the second disk, and so on. If you add a new hard disk to a single-drive system that had volumes designated C: and D:, the new disk’s primary partition becomes D: and your old D: becomes E:. Note that the OS will assign letters only to partitions it recognizes, so DOS/Windows 95 will ignore an NTFS partition. Why do I need more than one? Most new computers are shipped with a large (1GB or greater) hard disk with only one partition. This causes three potential problems. First, it makes it hard to organise programs and data, because you end up filling the C: drive with so many directories that finding anything become difficult. Wouldn’t it make more sense to have a partition for programs, another for data and downloads, a third for games, and so on? Second, if you want to install an additional OS and want to use the file system native to that OS, you’ll have to back up your entire hard disk, delete the existing partition and create new ones, then reformat and reinstall the operating system, programs, and data from scratch. In other words, not likely the third problem might come as a surprise. Large FAT partitions waste disk space. That may not seem logical —one big building with multiple rooms seems more efficient than several smaller buildings—but it’s true. The problem stems from the fact that FAT file system was developed in the days when floppy disks ruled and hard disks were small, and it was never meant to scale onto today’s multi-GB drives. It’s extremely inefficient at storing files. Why? To put it simply, FAT divides its partitions into groupings of sectors called clusters. That’s fine, except that FAT also limits the number of clusters in a given partition to just over 65,000. As a result, as the size of the partition grows, so does the size of each cluster. For a partition under 128 MB, for example, each cluster will be 2K in size while a partition between 1GB and 2GB has a relatively huge cluster size of 32K. And it’s not as if you have a choice; that 32K cluster size is the minimum for a 1GB partition, again because of the limited number of clusters the partition can have. FAT allocates disk space to files using
whole clusters, even though very few files are precise multiples of the
cluster size. The data occupying a file’s last cluster may fill the
cluster completely or it may be as little as a single byte. With an even
distribution of file sizes, the average wasted space per file will be
half a cluster. On a 127 MB drive with 2K clusters, your CONFIG.SYS
file, typically about 0.5K in size, wastes 1.5K. The same file on a
1.2GB drive with 32K clusters wastes 31.5K. On that same 1.2GB drive, a
100K file occupies just over three 32K clusters, with the majority of
the fourth cluster remaining empty. |