Technology Dock - Information Technology Articles

Hard Drives - November 1993
(Archive Article)
by Dean S. Tripodes

[Man at PC]

Having your hard drive fail without a backup of all your data is definitely a horror story we have all heard about. What is this nebulous electronic file cabinet that we call a hard drive? What is it made of, and how is it defined? No secretary has ever worried about accessing a metal file cabinet the wrong way and having all the contents destroyed. But we are constantly bombarded with rumors of people "killing their drives" by turning off the machines in the middle of a program like Windows or by a virus that wiped a person's information clean off of this planet. (Remember the Michaelangelo scare a while back?) A little knowledge of what's in that black box will help you understand where things go, and what happens when you "save" or "retrieve" a WordPerfect document or Quattro Pro spreadsheet.

Hard drives come in different sizes, full height and half height -- and 5-1/4", 3-1/2", and 2-1/2" wide. Both floppy and hard disks depend on the same phenomenon as audio or video tape recorders do to store their data. A recording head magnetizes microscopic particles embedded in a surface, moving the particles past the recording head and causing the particles to become magnetized. In an audio tape, and a digital computer tape too, the magnetic medium is simply a long string of plastic tape embedded with metal particles. The most popular metal particle among tape makers is iron oxide, otherwise known as rust. Floppy disk surfaces are brown because they are covered with rust. But there is nothing magic about that long thin shape. You could successfully create a magnetic recorder with a medium of any shape, provided you could master the mechanics of moving the medium past a recording head.

The most basic elements of a hard disk are the platter, spindle, and read-write heads. The platter is a magnetic cylinder that contains your programs and information. It is shaped like a thick compact disc. The spindle is the arm that spins the platter, and the read-write (recording) heads access the platter to transfer information. Before the platter can contain your information, it must be prepared to hold your information in a logical way so your computer can access it. Formatting a hard drive installs that logical information, and involves two distinct steps. The first step is a low-level, physical formatting. The second is a high-level, logical or DOS formatting. The DOS FORMAT command executes both procedures on floppy disks. On hard disks, FORMAT performs only high-level formatting, with low level formatting done by the manufacturer or with programs such as Disk Manager.

During the low-level formatting process, all DOS disks are divided into addressable 512-byte units called sectors. When disk controllers read or write data, they think of one sector at a time. Sectors are magnetically laid down one after another in concentric circles known as tracks. You can imagine holding a paint brush just above a record spinning on a turntable. If you were to touch the spinning record lightly with the brush, you would leave a ring of ink on the record. That ring would be called a track. The separate tracks that contain the sectors are closely spaced from the outer to the inner diameter of the disk. On 360K 5-1/4" and 720K 3-1/2" floppy diskettes, there are 9 sectors per track. A 1.2 5-1/4" Megabyte floppy has 15 sectors per track, and a 1.44 3-1/2" Megabyte floppy has 18 sectors per track. On a typical hard disk there may be 17, and very high capacity hard disks that use advanced encoding techniques may cram 63 sectors end to end around a single track.

To understand how information is written on sectors contained in a hard drive's tracks, let's consider one side of a platter. By applying a digital signal to the read-write head, we can record information on the track exactly the same way we could record it on a string shaped audio tape. The only difference is that, with an audio tape, we would record a continuously variable signal representing a sound waveform. On a hard disk we would record either a maximum signal or nothing at all. In other words, on an audio tape we would record an analog signal, while on a disk we would record a digital signal.

So far we have considered only one side of a platter (or floppy disk). A disk drive that records on a single side needs a motor to spin the disk, an apparatus to hold the head against the disk, a second motor to move the read-write head back forth across the disk, and a chassis to hold the whole thing together. To record on the flip side doesn't require the addition of much anything else, except a second read-write head. Twice as much data can be written before the head has to be moved from one track to the next. Data can be written first to the track on the top side of the disk, then without movement of the head, more data can be written to the track on the bottom side. The pair of tracks that lie over each other and can be written without movement of the head assembly are collectively referred to as a cylinder. For convenient reference, both cylinders and tracks are numbered. The outermost track is called track 0, and the track on the top side of the disk is called track 0, side 0, and the track on the bottom is called track 0, side 1. Or you can refer to both track 0's together as cylinder 0. Standard 360K floppy disks have 40 cylinders, number from 0 to 39.

On a floppy disk, it is possible today to squeeze up to 18 sectors around a single track and maintain reliability. However, conservative engineering led IBM to use only 9 sectors per track on their 360K 5-1/4" floppy disks. 9 sectors times 40 tracks per side and 2 sides per disk multiplies out to 720 sectors. 720 sectors times 512 bytes (per sector) reveals the now familiar 368,640 bytes (360K) per low density 5-1/4" diskette.

A quick break for review. A hard disk's main components are platters, a spindle, and recording heads. The low level format of the hard disk is broken up into 512 byte sectors, the base unit that disk controllers use to transfer information to the computer. Sectors are written in concentric circles around the platter, called tracks. The number of tracks that can be squeezed on a platter is based on the disk's density. The higher the density, the more tracks that can be stuffed in the same space. Tracks on the same radius from the spindle are called cylinders.

Now we can take a look at the logical format. The high-level formatting of a diskette or hard disk partition establishes the logical structure of the disk by distributing the sectors between a system area at the outside, or beginning of the disk, and a data area, the remainder of the disk. The system area of a formatted floppy and a DOS partition on a hard disk are comprised of three components: the boot sector, the file allocation table (FAT), and the root directory (\).

Before you use FORMAT on a hard disk, you may recall having had to run FDISK. FDISK lays down a master boot sector, the very first sector on side 0, track 0 of the disk. This sector contains a short master boot program, immediately followed by the partition table. On a system with a hard disk and several DOS partitions, DOS can't find the start of the drive D: unless it has the information in the partition table that lets it figure out how big drive C: is. The partition table also specifies which is the active or bootable partition. It is important to remember that FDISK allows you to have multiple partitions, but does not require it. The ability is a throwback from the days when DOS could not gain access to more than 32 Megabytes stored on the same physical drive.

In sequence, when you turn on your computer, BIOS loads and runs the master boot program, consulting the partition table to determine the location of the active partition. When it gets to the active partition, it loads the boot sector for that partition into memory and passes control to it.

As the name implies, the boot sector of a diskette or hard disk partition is a sector of data that contains a brief program run when the system is booted. If you have transferred DOS to the disk with FORMAT /S, the hidden system files IBMBIO.COM (or IO.SYS on some versions of MS-DOS) will be found, and control passes to it. When you format a disk or hard drive without transferring the system, the disk is not bootable. When you try to boot with such a disk, a program that displays the error message "Non-System disk or disk error. Replace and strike any key when ready." is written to the disk. The program waits for you to press a key and then reads in the boot sector of the new disk. The SYS command, and third party programs such as Norton Utilities, actually remove this error message and replace that program with one that reads in the system files.

The second part of the system area of the disk, immediately following the boot sector, is the file allocation table, or FAT. In contrast to the boot sector, the FAT can occupy many sectors. Indeed, two copies of the FAT are kept on disk, though DOS itself makes no use of the second copy. The FAT is essentially a database with a fixed length record for the number of each cluster in the general data area of the disk where your files themselves are kept. A cluster is simply a group of one or more sectors that DOS allocates as a single unit. Cluster size, which is always a power of two, is fixed for a given diskette or partition. It is 1K (two sectors) on 360K and 720K diskettes, and 512 bytes on 1.2 Megabyte and 1.44 Megabyte diskettes. Clusters were commonly 2K (four sectors) on hard disks formatted with DOS 3.x, and the latest machines have 8K (sixteen sectors) on hard disks formatted with DOS 6.x.

When a program makes a request to increase the size of a file so that more than the number of currently assigned clusters is needed, all that DOS does is find a free cluster, copy the new data there, change the FAT entry for the previous last cluster to the number of the newly assigned cluster, and change the FAT entry for the new cluster to indicate that it is now the last cluster in the chain.

If a file is expanded and the available free clusters on a disk are scattered, invariably its assigned clusters wind up spread out in different places on the disk. Such a file is called fragmented. DOS can keep track of it without any problem, but the disk head now has to jump around the disk to read the file, so performance suffers. A defragmenting utility such as Norton Utilities' Speed Disk can rearrange the physical locations of the file to make the file clusters contiguous and restore hard disk performance.

Following the FAT is the root directory, the final section of the system area of the disk. The number of files you can fit in the root directory is dependent on the size of the disk. 360K and 720K floppy disks can have 112 root directory entries. 1.2 Megabyte and 1.44 Megabyte floppy disks can have 224, and most hard disks can have 512 root directory entries. Subdirectories, on the other hand, are themselves files, so the data area assigned to them can be increased as needed and there is no limitation on the number of files that a subdirectory can have.


Terms of Use For Baywalk - Use of Baywalk signifies your agreement to the terms of use.



Top of Page