CIS 107a: Introduction to Hardware Concepts

Chapter 7: Hard Drives

 

Objectives:

This chapter discusses hard drives. The objectives important to this chapter are:

  1. How information is stored on a hard drive
  2. Understanding different types of hard drives
  3. How computers communicate with hard drives
  4. How to install hard drives
  5. Solving installation problems.
Concepts:

The chapter begins with a review of floppy drives, removing the need for a separate chapter on them. Floppy drives have some characteristics in common with hard drives, so this discussion is of value to this chapter.

The chapter presents two views of how data storage and retrieval take place: a physical view and a logical view. The chart below presents some physical features of different types of floppy disks used at different points in history. Note, these are not the only models that were ever used. They are, however, commonly discussed types. Only the 1.44 MB disk drive is commonly available now.

Floppy Disk Types
Type Storage Capacity Tracks per side Sectors per side

Cluster Size

3.5-inch extra-high-density 2.88 MB 80 36 2 sectors
3.5-inch high-density 1.44 MB 80 18 1 sector
3.5-inch double-density 720 KB 80 9 2 sectors
5.25-inch high-density 1.2 MB 80 15 1 sector
5.25-inch double-density 360 KB 40 9 2 sectors

You don't see many floppy disks in any size except the 3.5 inch, 1.44 MB type. The older ones (5.25 inches) are not practical. The 2.88 MB type didn't sell well, so they are rare. The historical progression for most users was from a 360 KB (5.25 inch) floppy, to a 720 KB (3.5 inch) floppy, to a 1.44 MB (3.5 inch) floppy. In each case, the medium capacity doubled. In the case of the 2.88 MB floppy, there were other alternatives available that were more practical (like 100 MB ZIP disks). Now, we use USB devices, but that is another topic.

Floppy drives must be connected to a controller with a data cable, and connected to power with a power cable. The data cable will probably be a 34-pin flat ribbon cable. This cable will have a connector on one end that fits the controller. The other end will have a connector that fits the drive, and there may be another connector in the middle of the cable for a second drive. Note that the primary floppy drive (usually drive A:) connects to the cable's end, while a second drive (B:) would use the connector in the middle.

Power is run to the floppy drive by a cable from the power supply. The power connector for a floppy drive, in the past, was typically smaller than the connectors used for other devices (hard drives, CD-ROMs, etc.). Current devices tend to use standard four pin power cables.

In order for disks to store data, there has to be a system of organizing the data. Disks are divided into tracks, which are concentric circles. Note that all the disk types listed above, except the 360 KB disks, have 80 tracks per side. Floppy drives read and write to the tracks with magnetic read/write heads (like in a tape recorder or VCR). The heads take turns, writing to one side then the other, so the user does not have to be aware that both sides are used (and does not have to flip the disk over, as I had to with my first computer: an Apple IIc). Floppy drives rotate at about 360 rpm (revolutions per minute), and the read/write heads are meant to make light contact with the disk. This is part of what causes a floppy disk to wear out after about 40 hours of actual use.

  • Red sector
  • Blue sector
  • Track
The disks are further divided into pie-shaped wedges called sectors. (Why is that word red? You'll see in a few lines.) Again, note in the chart that the number of sectors on a disk varies from type to type. Our common example, the 1.44 MB 3.5 inch disk has 18 sectors on each side. (The number of sectors is always the same on each side of any disk.) Now for the confusing part: the word "sector" has another meaning. Sector can mean one of the wedges on a disk, but it can also mean the part of a track inside that wedge. If we consider that a 1.44 MB disk has 18 sectors on a side, and that it has 80 tracks on that side, then those tracks are divided by the sector lines into 1,440 track segments that are also called sectors. It will become tedious if I continue using colors for that word, and it will be unrealistic: the real world is not color coded. You have to understand which meaning of the word is intended from the context in which it is used, just like any other oddity in English.

(In the picture on the right, the number of wedges has been reduced to make the image clearer. The picture is a metaphor, not an exact representation.)

Something that does not vary, at present, is that a sector can only hold 512 bytes of data, no matter what kind of disk is being used. (Okay, one more time. I made it blue so you would know I meant "a segment of a specific track".) Since there are two sides to that disk, that means it can hold 512 bytes per sector, times 2 sides, times 1,440 sectors per side, making 1,440 Kilobytes, which is 1.44 Megabytes. (In this paragraph, every time I used the word "sector", I meant "a segment of a specific track".)

The next major concept is the cluster, sometimes also called a file allocation unit. Think of sectors and tracks as being physical aspects of a disk that are dealt with by the BIOS. Think of clusters as being logical aspects of a disk that are dealt with by the Operating System. A cluster is defined as the smallest unit on a disk that the operating system can read from or write to at one time. Again, the chart above is helpful. For the type of disk we are discussing (1.44 MB), the smallest amount of data that can be written to the disk (a cluster) is the size of one sector. For the other types, it varies between one sector and two sectors.

Page 252 begins the discussion of formatting disks. Four actions are listed that take place when a disk is formatted:

  • tracks and sectors are created - these are discussed above
  • the Master Boot Record is created - this is a table that holds data specific to this disk. Some important items in the table are:
    • number of bytes per sector
    • number of sectors per cluster
    • number of FATs (se below)
    • number of sectors
    • number of sectors per track
    • name of program to load the OS (the program may or may not not be present on the disk)
  • two copies of the File Allocation Table (FAT) are created - this is the partner of the directories that list the filenames. Each file is named in a directory. That directory (and there can be many on the disk) knows the number of the cluster in which the file starts. The clusters are listed in the FAT. Each cluster has a record in the FAT, and only four things can be stored in those records:
    • if the cluster is empty, then nothing is stored in its record
    • if the cluster holds a part of a file that continues in another cluster, the next cluster's number is stored
    • if the cluster holds the end of a file, the code FFF is stored
    • if the cluster is marked as bad, the code FF7 is stored

    Since files are stored and deleted from disks all the time, it is common for a file to be stored in clusters that are scattered all over a disk. This file is said to be fragmented, and the system will take longer to read and write to such a file.

  • the root directory of the disk is created - this is the first directory on a disk. Like all directories, it must track all files and subdirectories in it. It includes information about the filename, last modified date, and size of each file.

As you can see, formatting a disk creates or recreates the storage scheme of the disk, which means that it will remove the records of files already stored on it.

The chapter continues with a discussion of hard drives. Hard drives (or hard disks) are called that because the actual disks involved are made of metal instead of plastic. The reason they are metal is so they can spin faster for more rapid access to greater amounts of data. Some (but not all) hard drives have multiple disks in them, which are called platters. Each side of a platter could be called a head, as your text explains, but I have never head this term used this way. The term head is more commonly used to refer to the read/write head, which is the part of the drive that reads and writes data to the disk. (Floppy drives and hard drives both have read/write heads.)

A hard drive must have one read/write head for each side of each platter in the drive. The heads are mounted on an actuator, which is a mechanical arm that moves across the disk like the arm on a record turntable. (If you have never owned one, and have never seen one, go see a movie! Here is an illustration on Wikipedia.) The platter spin rate varies from model to model, but it is usually in excess of two thousand revolutions per minute (RPMs). The heads actually fly just above (and below) the platters like hovercraft. If a head were to hit a hair or a dust particle at that speed (imagine it on the disk, speeding toward the head...) there would be an actual crash as the head hit the media surface. This is why hard drives are sealed air-tight: to avoid dust, hair, etc. entering the drive.

Another new term having to do with hard drives is cylinder. Every platter will have tracks, once it is formatted, and the tracks are numbered, as they are on a floppy disk. Since there can be multiple platters, we refer to all tracks with the same number as a cylinder. For instance, if our drive has three platters, it has six sides, and all six sides have tracks. All six tracks called Track 1 can be considered together as Cylinder 1. For a good lesson on basic hard drive technology, with very nice pictures, follow these links to Marshall Brain's web site, How Stuff Works.

Formatting is discussed in the chapter, as it relates to hard drives.

  • A hard drive is given a low-level format at the the factory that makes it. This format marks the sectors based on the size of the media used. This format is set to match the electronics of an IDE drive, which means that it should not be changed. A user should never give a hard drive a low-level format unless told to do so by a technician who has a very good reason to do it.
  • A utility like FDISK has several purposes. It can be used to create partitions on a hard drive. A partition is a logical division that allows a hard drive to act like several smaller hard drives. FDISK also assigns a device letter (drive pointer) to the hard drive, and tells the CMOS chip that the hard drive exists.
  • A high-level format creates a boot sector, a file allocation table (FAT) and a root directory on a hard drive. It cannot be done until the CMOS chip knows about the drive, so this step follows the use of FDISK in the preparation of a new hard drive for use.

The text discusses some currently common types of hard drives. Most hard drives you encounter will be variations on IDE (Integrated Device Electronics) or EIDE (Enhanced IDE). These include:

  • IDE/ATA - also called ATA; supports throughput of 2.1 to 8.3 MBps (megabytes per second)
  • ATA-2 - also called Fast ATA, ATAPI, PATA; supports throughput up to 16.6 MBps
  • ATA-3 - supports throughput similar to ATA-2
  • ATA/ATAPI-4 - also called Ultra ATA, Fast ATA-2, Ultra DMA, and DMA/33; supports throughput up to 33.3 MBps; uses 80 conductor cable
  • ATA/ATAPI-5 - also called Ultra ATA/66, Ultra DMA/66; supports throughput up to 66.6 MBps; uses 80 conductor data cable
  • ATA/ATAPI-6 - also called Ultra ATA/100; supports throughput up to 100 MBps; uses 80 conductor data cable; supports drives larger than 137 GB
  • ATA/ATAPI-7 - also known as Ultra ATA/133, Serial ATA (SATA)- supports throughput up to 133 MBps; uses 80 conductor data cable;
  • ATA/ATAPI-8 - draft not finalized

Note that the lines highlighted above use an 80 conductor data cable, as opposed to the standard 40 conductor cable. Both of these cables are parallel ATA (PATA) cables. An 80 conductor cable actually has 40 pins, just like the 40 conductor cables used by the types that are not highlighted. The other 40 wires are grounds to reduce crosstalk (signal crossover) from the other data wires. This type of cable may be called 80 conductor IDE cable, ATA/100 cable, or UltraDMA 100/66 cable.

80 conductor cables can be used in place of 40 conductor cables. Do not use a 40 conductor cable in place of an 80 conductor cable, since this will reduce the performance of drives that require the newer cable.

Another type of drive uses a serial ATA (SATA) cable. This is a newer technology that uses fewer pins, and fewer wires, but transfers data faster than 100 MBps. The standard may allow transfers as fast as 600 MBps in the future.

A motherboard may have this kind of connector instead of or in addition to PATA connectors. In the picture on the right a SATA cable (the orange one) is shown next to a PATA cable (the gray one).

Most PATA style IDE data cables will allow you to connect two IDE devices to each IDE channel on the motherboard. The text notes that if you place two devices that have different data speeds on the same channel, they may both run at the speed of the slower device. In order for the devices to run at their own rates, the motherboard chip set must support Independent Device Timing. This is a common feature in current chip sets, but not common in older chip sets.

Although this chapter is mainly about hard drives, the text notes that IDE devices can also be CD drives, DVD drives, ZIP drives, and other data storage devices. When connecting two devices to one channel, one device is designated the master, the other is designated the slave. The two channels are designated primary and secondary. If your IDE channel connector are different colors, the blue one is probably the primary channel.

SATA cables connect to just one device each. Since a motherboard may have two or more SATA connectors and two PATA connectors, you would expect to be able to connect six devices (or more) to them. This is true if you are using Windows 2000 or XP, but if you are running Windows 9x or NT, you are limited to connecting only four IDE devices. (PATA and SATA devices all fall under the IDE standard.)

Small Computer System Interface (SCSI) drives are a special case. SCSI is actually a kind of bus, and devices that attach to a SCSI bus can be daisy-chained, providing you have the proper cables, and providing your devices have SCSI input and output ports. A device that only has one port on it can only go on the end of a chain. Since SCSI is a bus, devices that are attached to it must be addressed (numbered). If your SCSI bus will accommodate 8 devices, they are addressed from 0 to 7. If your SCSI bus will accommodate 16 devices, they are addressed from 0 to 15. The actual SCSI card that plugs into your PC gets one of these addresses, and so does each device in the chain. The text covers SCSI in more detail in the appendix on SCSI.

Another common bus is USB, Universal Serial Bus. Each new version of USB has improved the data throughput, so that USB 1.1 and USB 2.0 are fast enough to support hard drives. The text recommends considering an external USB drive if you need additional or portable storage. Make sure that the USB ports on your computer support the standard required by the device. I often connect my USB flash drive to a computer and am greeted by a message that I have attached a Hi-speed USB device (USB 2.0) to a slower port. It usually still works, but some devices will not. The USB Specification, Revision 2.0, covers three speeds: 480 Mbps, 12 Mbps, and 1.5 Mbps. The first is Hi-speed, the second and third are not.

The text briefly discusses IEEE 1394, which is commonly referred to as FireWire (by Apple) and i.Link (by Sony). FireWire is a commonly used marketing name.

FireWire is a serial port technology that can transfer data at rates up to 400 Mbps. All Apple Macintosh computers now come with FireWire ports and support built in. (Click the logo on the right to jump to Apple's page about FireWire.) The bad news is that most PCs do not have FireWire ports built in, nor do all operating systems support it. Windows 95 and Windows NT do not, but other versions (98, 2000, and XP) do. IEEE standard 1394b provides for a version of Firewire that can transport data at 800 Mbps.

The text offers some advice about buying a new hard drive. Several features should be considered:

  • capacity - how much space do you want? All things being equal (which they are not) bigger drives cost more.
  • rotational speed - how fast does it spin? Faster drives are often faster at accessing data, but they are also typically noisier, hotter, and more expensive. Typical speeds currently available are 5400 rpm and 7200 rpm drives.
  • technology used - This refers to the list above. The lower in the list, the newer and more expensive the technology, which often means better performance. However, make sure that the technology you want will work with your motherboard.
  • cache size - the bigger the cache the better the drive, and the more costly
  • average seek time - in other words, on average, how long does it take the drive just to find the data you ask for? Smaller numbers are better.

The text suggests running the setup utility on your computer to find out what kind of drive(s) it has now, to shop for compatible equipment later.

A hard drive keeps track of the location of data with a directory listing and a FAT table, just like a floppy disk. A hard drive can have two (redundant copies) of several kinds of FAT tables.

  • DOS and every version of Windows since 3.1 can use 16 bit FAT tables (FAT16)
  • Windows 95, version 2, and later can use 32 bit FAT tables (FAT32), which are larger and can use larger addresses. Windows 2000 and XP can use FAT32, but only if the drive is no larger than 32 GB.
  • Windows NT can use any of these, or NT File System (NTFS) tables which are larger still, using the most addresses. Windows 2000 and XP also prefer NTFS.
  • FAT 16 is usable for hard drives up to 2 or 4 GB (see below) in size, but there is a penalty for large drives. The larger the drive, the larger the cluster size for a 16 bit table.
  • FAT 32 is better organized, and is practical for drives up to 8 GB, where its cluster size is about 4 KB. From 8 GB to 16 GB, the cluster size goes up to about 8 KB per cluster.
  • NTFS allows the use of much larger hard drives.

This is a chart of cluster sizes for various logical drive sizes using FAT12, FAT16, FAT32, and NTFS. For another view of the same data, see this page at the Microsoft Help and Support site.

Cluster Sizes, from Microsoft Help and Support site
FAT Type Logical Drive Size Cluster Size
FAT12 360 KB 2 sectors = 1KB
  720 KB 2 sectors = 1KB
  1.2 MB 1 sector = 512 bytes
  1.44 MB 1 sector = 512 bytes
  < 1 MB to 15 MB 8 sectors = 4 KB
FAT16 16 MB to 127 MB 4 sectors = 2 KB
128 MB to 255 MB 8 sectors = 4 KB
256 MB to 511 MB 16 sectors = 8 KB
512 MB to 1023 MB 32 sectors = 16 KB
1 GB to 2 GB (limit for DOS and Windows 9x) 64 sectors = 32 KB
2 GB to 4 GB (must be using NT, 2000, or XP) 128 sectors = 64 KB
FAT32 257 MB to 8 GB 8 sectors = 4 KB
8 GB to 16 GB 16 sectors = 8 KB
16 GB to 32 GB (limit for Windows 2000 and XP) 32 sectors = 16 KB
NTFS Up to 512 MB 1 sector = 512 bytes
512 MB to 1 GB 2 sectors = 1 KB
1 GB to 2 GB 4 sectors = 2 KB
More than 2 GB 8 sectors = 4 KB

You may wonder why we don't just use NTFS on all large hard drives. It is because NTFS is not available unless you are running Windows NT, 2000, or XP. We can consider a file system to be inefficient if it uses more than 8 sectors for a cluster size. By this measurement, FAT16 is only efficient for hard drives up to 256 MB, and FAT32 is only efficient for hard drives up to 8 GB.

The user is cautioned to read all documentation on a new device before installing it, to have a good boot or rescue floppy on hand (test it, or you don't know it is good), and to check the system requirements for the device. It is possible that an older operating system or an older BIOS will not support a new device without an upgrade first.

Setting the drive's role is often done by setting a jumper across one pair of a set of pins. Often, no jumper is needed if the drive is your only drive on an IDE channel, but a jumper is applied when you have multiple drives to designate one as the master, and the other as the slave. (NOTE: the pin configuration varies from drive to drive, so check the documentation for the drive you are installing.)

General precautions:

  • Handle the drive (and all parts) with care.
  • Do not touch exposed circuits, chips, connectors, etc. (Electrostatic Discharge)
  • Don't let other people touch the circuits either.
  • When opening the package, touch the package to a metal part of the computer (NOT a circuit) for two or more seconds to bring the drive to the same electrical potential as the computer.
  • Place the drive on its protective package if you need to set it down.
  • Don't place the drive on a metal surface, from which it might pick up a charge.

IDE controller connections on a motherboard are common. The primary connector may be labeled "Primary" or "IDE1". Look for the marker for pin 1 on your connector cable, on the motherboard, and on the drive.

After installing the drive, it may not work. Some possible troubleshooting steps:

  • Turn off the computer before opening the case.
  • Remove and reattach the cables (data and power), checking for correct connections.
  • If using an adapter card (instead of the mother board connector) remove and reseat it.
  • Try putting the adapter in a different slot.
  • Check jumper and DIP switch settings.
  • Check for bent pins on on the drive connector, the adapter, and the mother board.
  • Power up the computer and listen to the hard drive to determine if it spins.
  • Check the cables for damage.
  • Check the documentation for missed steps. (This should NOT be the first time you look at it!)

If your BIOS supports it, the text recommends using an IDE Autodetection setting. If not, you should set the BIOS values to those recommended by the manufacturer of the hard drive. For hard drives less than 528 MB, use CHS or Normal settings. Larger hard drives need LBA or large mode, so you should make sure your BIOS supports one or both before buying a larger hard drive. If you run into this problem, page 278 suggests five alternatives:

  • Tell the BIOS the drive is smaller.
  • Upgrade the BIOS.
  • Upgrade the motherboard (and the BIOS).
  • Use software to interface between the BIOS and the drive.
  • Use an adapter card that has its own BIOS, which will substitute for system BIOS.

After a drive is installed, you may have to partition it. The FDISK utility in DOS or Windows 9x is used for this. As you may know, FDISK is also used to assign drive letters to the disk. You should be aware that the system will boot from the primary partition, which is why it must be set as active. The primary partition cannot contain more than one drive letter. If more drive letters are desired, they must be assigned in an extended partition.

In modern versions of Windows, disk management may be done through Windows Explorer. Right click the disk in question, and select Properties. The Tools tab of the Properties menu will have choices for Error-checking and Defragmentation.

Page 294 begins a discussion of troubleshooting common problems encountered while installing hard drives. Some guidelines are given that are good reference material:

  • Error message: Hard drive not found. Suspect a bad or badly connected data cable.
  • Error message: the PC beeps three times. This often indicates a memory error. Suspect a RAM module is loose.
  • Error message: No boot device available. Suspect you have not put a boot disk in the PC or that you have not put the boot system on the hard drive.
  • Error message: Configuration/CMOS error. Run setup. Suspect bad settings in CMOS. Run the setup program again.
  • Error message: 601. Messages in this range (600 - 699) are floppy disk errors. Suspect the floppy disk drive was disturbed. Check its power and data cables.
  • Hard drives do not always fit well. Other parts do not always fit well, either. Get another pair of eyes: a partner, another technician, a supervisor; someone to check your procedure and offer other ideas.
  • Error message: Hard drive not present. This could be the same as the first example, but also suspect that a physical setting on the drive is wrong, like a jumper or DIP switch setting.
  • Check whether the devices have power and are turned on.
  • POST errors in 1700 and 10400 ranges can mean hard drive problems.
  • POST errors starting with 096, 112, 113, 206, 208, 210 and 1999 often mean SCSI Host Adapter problems.
  • Questions to ask the user who is having a problem:
    • Was the computer moved? Who did it? Anything to report during the move?
    • Was new hardware installed? Any error messages? Did it seem to work?
    • Was new software installed? Any error messages? Did it seem to work?
    • Was any hardware or software upgraded or reconfigured?
    • Has the problem happened before? How often? Under what circumstances?
    • What was the user doing just before the problem happened?

When calling the technical support people for any hardware device, you will want to have the information listed below handy. You will note that no one could remember all this minutia, so be at the machine with the problem when you call.

  • Model and description
  • Make and model of the computer you put the hardware in.
  • The exact wording of error messages.
  • A good description of the problem. You may have to communicate through several layers of staff, so make it accurate, descriptive, and as short as possible.
  • Hardware and software on your system, including configuration settings.