Installation and Setup
All boot devices must be configured outside the operating system (Windows 95 and 98, Windows NT, or MS-DOS) regardless of the level of Plug and Play compatibility. (Devices such as disk drives and CD-ROMs that are used to boot must be configured at the BIOS and hardware level because they typically contain the operating system and must run properly before the operating system can be started.)
Installation of a hard disk drive consists of five simple steps:
- Physical installation and cabling
- CMOS setup
- Low-level formatting (if required)
- Partitioning
- Formatting
Cabling
Just as there are different types of drives, there are different cabling requirements for each. Let's look at the three most common types.
ST-506
The ST-506 uses a 34-connector control cable (daisy-chained for dual drives) and a 20-connector data cable for each drive. The 34-wire control cable has a twist in it for line 25 through 29 configuration (similar to the floppy disk drive cable); this twist determines which hard disk drive is hard drive 0 and which is hard drive 1. The drive at the end is drive 0.
IDE/EIDE
The IDE uses a simple 40-pin cable that plugs into the controller and into the drive (see Figure 8.9). There are no twists. IDE controllers identify the two drives as either master or slave. Drive makers use different methods to set up their drives. The most common system uses jumpers. Setting these jumpers serves the same function as the twist used with other drive cables: it identifies whether the drive is master or slave. Other drives use switches, and some new drives use software to determine which is the dominant drive. Be sure to check the manufacturers' specifications to properly set up the drive.
U-DMA 66
A special version of the 40-pin IDE cables is used for U-DMA 66. Be sure to obtain and install it if you are working with one of these newer drives. It is also 40-pin, but has a blue connector on one end and a black one on the other. All the other installation and cabling procedures are the same as for traditional IDE devices.
Figure 8.9 IDE connections
TIP
When installing a new secondary hard disk drive in a system, be sure to set the new drive as slave and verify that the first drive is set to master. The documentation supplied with the drive should provide the necessary information. Often, this information is printed on the label of the drive. Both drives must be properly configured before the system is started. If the drives are not properly jumpered, they won't work.
If you don't know how to set the jumpers (see Figure 8.10), try calling the hard disk drive manufacturer (or look for its Web site on the Internet).
Figure 8.10 Master/slave jumper settings
Setting the System CMOS for the Hard Drive
After a hard disk drive has been installed physically, the geometry of the drive must be entered into the CMOS through the CMOS setup program before the PC will recognize the new device. This information must be entered exactly as specified by the manufacturer. Figure 8.11 shows hard disk drive configuration information in a typical CMOS. Figure 8.12 shows a subscreen of the main hard drive setup screen.
Figure 8.11 CMOS main screen
Originally, CMOS would allow for only two drives. Later versions allow up to four drives, because most new PCs have two IDE channels.
The CHS (cylinders, heads, sectors per track), along with write precompensation and landing zone, determine how the hard disk drive controller accesses the physical hard drive. The creators of the first CMOS routines for the 286 AT believed that the five different geometry numbers would be too complicated for the average user to configure, so they established 15 preset combinations of hard drive geometries. These preset combinations are called types. With types, the user simply enters a hard drive type number into the CMOS.
Figure 8.12 Hard disk drive setup screen
This system worked well for a period of time, but with each new hard disk drive that manufacturers designed, a new type also had to be created and added to the list. BIOS makers continued to add new types until there were more than 45 variations. To deal with this issue, Setup routines now include a user type. This allows manual entry of the geometry values, increasing both the flexibility and complexity of hard drive installation.
CMOS setup is easy with IDE drives. Most CMOS chips today have a setting known as IDE autodetection, which runs the identify drive command, gathering and setting the proper geometry values. To use it, simply connect the drive to the computer, turn it on, and run the CMOS. The identify drive command instructs the drive to transmit a 512-byte block of data containing the following information:
- Manufacturer
- Model and serial numbers
- Firmware revision number
- Buffer type indicating sector buffering or caching capabilities
- Number of cylinders in the default translation mode
- Number of heads in the default translation mode
- Number of sectors per track in the default translation mode
- Number of cylinders in the current translation mode
- Number of heads in the current translation mode
- Number of sectors per track in the current translation mode
IMPORTANT
Be sure to save your settings before you exit the setup program.
What happens if wrong data is entered into the CMOS? For example, what if a 1.2-GB hard disk drive is installed and the CMOS is set up to make it a 504-MB hard drive? When you boot the computer, you will see a perfect 504-MB hard drive. You will need to correct the entry to obtain proper use of the drive. It should not be left improperly entered, and it might not be accessible by the system.
If the computer you are working on does not support autodetection, you must be able to determine the geometry of a drive in order for it to be installed.
There are many ways to determine the geometry of a hard disk drive:
- Check the label. The geometry or type of many hard drives will be labeled directly on the hard drive itself.
- Check the documentation that came with the hard drive. All drives have a model number that can be used to obtain the geometry parameters either from the manufacturer or a third party. The hard drive manufacturers usually reserve a section of their Web site for providing configuration data and the setup utilities available for download.
- Contact the manufacturer. Many manufacturers have toll-free phone numbers.
After a drive is installed, it must be assigned a drive name or letter that is unique. There are several drive-naming conventions that help identify this unique name. If only one hard disk drive is installed, it must be configured as drive 0, or master. If a second drive is installed, it is recognized as hard drive 1, or slave. Many CMOS configurations use the terms C: and D:. Under all versions of MS-DOS and Windows, hard drive 0 is recognized as C; hard drive 1 is recognized as D.
As more drives are added to a system, (including tape, CD-ROM, and network drives), the names of existing drives might change. For example, installing a portable drive such as an Iomega Zip drive can change a CD-ROM from the D drive to the E drive. When the portable drive is removed, the CD-ROM will once again be the D drive. Keep in mind the difference between logical and physical drives. A physical drive is the hardware-it can be divided into two or more logical drives. (See the "Partitioning" section later in this lesson.) Drives on a network server are also logical drives. Write down the configuration and keep track as changes in the system are made. The only drive letters that are fixed are the A and B drives, which are always the floppy disk drives, and the C drive, the boot drive where the MS-DOS operating system resides.
NOTE
This confusion in drive letters can also confuse the operating system, making it hard or impossible for it to locate drivers. In such cases, you might need to reinstall the drivers before the system can make use of the affected hardware, and a Windows 95, 98, or 2000 machine might automatically start in Safe Mode. Check the System/Device manager option in the Control Panel after the PC is operational and look for duplicate hardware items or items with flags noting missing or inoperable conditions.
Low-Level Formatting
Low-level formatting means to create all the sectors, tracks, cylinders, and head information on the drive and is the third step in installing hard disk drives; generally it applies only to older drives. Low-level formatting by the end user has virtually been eliminated with today's drives (it's done at the factory).
A low-level format performs three simultaneous functions:
- It creates and organizes the sectors, making them ready to accept data.
- It sets the proper interleave (records the sector header, trailer information, and intersector and intertrack gaps).
- It establishes the boot sector.
Every hard disk drive arrives from the factory with bad spots on the platters. Data cannot be written to these areas. As the sectors are being created, the low-level format attempts to skip over these bad spots. Sometimes, it is impossible to skip over a spot so the sector is marked as "bad" in the ID field.
CAUTION
Low-level formatting is not required on IDE and U-DMA drives. Performing a low-level format on these devices might render the drive unusable. SCSI drives are low-level formatted using a utility that is built into the SCSI adapter card's firmware. Format a low-level drive only if it is absolutely necessary (for example, if a virus has contaminated the boot sector and that is the only remedy) and if you are sure you know and can follow the proper procedure! Remember, as soon as you issue the format command, all data on the drive will be lost.
IDE drives use a special type of low-level formatting called embedded servo. This type of low-level formatting can be done by the manufacturer only, or with a special utility provided by the manufacturer. When installing an IDE drive, go straight to the partitioning step after the CMOS is set up.
To continue with hard disk drive installation for MS-DOS and Windows 3.x and 95 and 98 versions, you will need a bootable floppy disk containing several programs that are required to prepare the new drive. (For Windows NT and 2000, alternate methods that are not part of the current A+ test are available. You can also use the procedure listed below to prepare a drive for use with those operating environments.)
To create a bootable floppy disk, a computer is required that has an installed working hard disk drive, or floppy disk drive, and a compatible operating system. Be sure to use the same operating system on the floppy disk as the one you'll use for the new drive.
Insert a floppy disk into the A drive and type:
This will copy system files to the disk, making it a bootable disk.
The next step is to copy the necessary files from the MS-DOS directory to the floppy disk. The default location for these files is the C:\DOS directory for MS-DOS and the C:\Windows\Command directory for Windows 95 and 98. Copy these files:
This bootable disk can be used for partitioning and high-level formatting as discussed in the following sections.
Partitioning
Partitions are logical divisions of a hard drive. A computer might have only one physical hard drive (called hard drive 0), but it can have anywhere from one to 24 logical drives, identified as C to Z.
Partitions exist for two reasons:
- To divide the disk into several drive letters to make it easier to organize data files. Some users separate data, programs, and operating-system files onto different drives.
- To accommodate more than one operating system.
When MS-DOS was first designed to use hard disk drives, the largest hard drive that could be used was 32 MB (because of the way MS-DOS stored files on the hard drive). Partitioning was included in MS-DOS 3.3. This allowed for the development of larger physical hard drives by creating multiple logical drives of up to 32 MB each. Starting with MS-DOS 4.0, the partition size was increased to 512 MB. Beginning with MS-DOS 5.0, the partitions can be as large as 2 GB. Windows 98 and 2000 support much larger drive sizes, and many new disks exceed 20 GB.
NOTE
Some hard disk drives that exceed 4 GB might not work with an older computer, BIOS, or operating system. They will physically function, but the whole drive cannot be accessed-disk access will be limited to the largest size that can be recognized by that system.
Primary and Extended Partitions
There are two types of partitions: primary and extended. The primary partition is the location where the boot information for the operating system is stored. To boot from a hard disk drive, it must have a primary partition. Primary partitions are for storage of the boot sector, which tells the computer where to find the operating system. The name of the primary partition is C.
The extended partition is for a hard disk drive, or part of a hard disk drive, that does not have an operating system. The extended partition is not associated with a "physical" drive letter. Instead, the extended partition is further divided into logical drives starting with D and progressing until drive letter Z is created. (Remember: A and B are reserved for floppy disk drives.)
Newer operating systems can use all of the drive as a single primary partition. The logical drive concept was invented to allow older versions of MS-DOS and Windows to make use of drives that exceeded their maximum drive size.
The following table provides examples of partitions:
|
One 500-MB physical drive with one partition:
C (primary drive) One physical drive and one logical drive |
|
|
One 1-GB physical drive with two partitions:
C (400-MB primary drive) D (600-MB extended drive) One physical drive and two logical drives |
|
|
One 4.3-GB physical drive with three partitions:
C (1-GB primary drive) D (1.65-GB extended drive) E (1.65-GB extended drive) One physical drive and three logical drives |
How to Partition
The FDISK utility is used to partition a drive. After the drive is installed and the CMOS is updated, run FDISK to partition the drive(s).
Figure 8.13 shows the FDISK startup screen.
Figure 8.13 The FDISK startup screen.
The function of lines 1, 3, and 4 is clear. Line 2 sets the active partition. The active partition is the partition where the BIOS will look for an operating system when the computer is booted.
Don't confuse the primary partition with the active partition. On a computer with a single operating system, the primary and active partitions are usually the same. A computer with dual-boot capability might have separate partitions for each operating system. In that case, the active and primary partitions might not be the same.
The primary partition is where MS-DOS (or the Windows boot information) is stored on the hard disk drive, and the active partition is where the operating system is stored on the hard drive. (If MS-DOS is the only operating system, the primary partition and active partition are the same.) Other operating systems- Windows NT, Windows 2000, and OS/2, for instance-can exist on an extended partition.
Advanced operating systems can create a special partition called a boot partition. When the computer boots, a menu prompts the user to pick which operating system to use. The boot manager then sets the chosen partition as active, which starts the operating system located in that partition.
NOTE
MS-DOS has a limitation not shared by any other operating system: it must be placed on the primary partition, and that partition must always be named C. OS/2, UNIX, and Windows NT/2000 can boot from another drive letter, as well as from the C drive.
High-Level Formatting
The high-level format is simply called "format" (the program used to perform a high-level format is called FORMAT.COM). This is the same format command used to prepare floppy disk drives. The high-level format performs two major functions:
- It creates and configures the file allocation tables (FATs).
- It creates the root directory, which is the foundation upon which files and subdirectories are built.
File Allocation Tables (FATs)
The base storage unit for drives is a sector. Each sector can store between one byte and 512 bytes of data. Any file less than 512 bytes is stored in a single sector, and only one file can be assigned a sector. Therefore, any part of a sector left unfilled is wasted. When files are stored in more than one sector (if they are greater than 512 bytes), MS-DOS needs a way to keep track of each location and the order in which data is stored. MS-DOS also needs to know which sectors are full and which sectors are available for data, so it uses the file allocation table (FAT) to keep track of this information.
The FAT is simply an index that keeps track of which part of the file is stored in which sector. Each partition (or floppy disk) has two FATs stored near the beginning of the partition. These FATs are called FAT #1 and FAT #2. They are identical. Each FAT can be looked at as a two-column spreadsheet.
| Left Column | Right Column |
|---|---|
| Gives each sector a number (in hex) from 0000 to FFFF (65,536 sectors). The left side contains 16 bits (4 hex characters = 16 bits). This FAT is called a 16-bit FAT. Floppy disk drives use 12-bit FATs because they store substantially less data. | Contains information on the status of the sector. During formatting, any bad sectors are marked with a status code of FFF7 and good sectors are marked 0000. |
Sectors and Clusters
As mentioned, the CHS values limit the maximum size of a hard disk drive to 504 MB under the older PC operating systems. The 16-bit FAT can address 64,000 (2l6) locations. Therefore, the size of a hard drive partition should be limited to 64,000 x 512 bytes per sector or 32 MB. With this limitation, you might ask, how are larger hard drives possible?
There are two solutions to this problem. The first method, used with earlier drives (under 100 MB), was to use FDISK to break the drive up into multiple partitions, each less than 32 MB.
The second method is called clustering. Clustering means to combine a set of contiguous sectors and treat them as a single unit in the FAT. The number of sectors in each cluster is determined by the size of the partition. There can never be more than 64,000 clusters. To determine the number of sectors in a partition, divide the number of bytes in the partition by 512 (bytes per sector). Then divide the number of sectors by 64,000 (maximum allowable clusters). The following table provides an estimate of sectors per cluster.
| Partition (in MB) | Total Bytes | Total Sectors | Sectors per Cluster | Bytes per Cluster |
|---|---|---|---|---|
| 32 | 33,554,432 | 65,536 | 1 | 524 |
| 64 | 67,108,864 | 131,072 | 2 | 1049 |
| 128 | 134,217,728 | 262,144 | 4 | 2097 |
| 256 | 268,435,456 | 524,288 | 8 | 4194 |
| 512 | 536,870,912 | 1,048,576 | 16 | 8389 |
| 1000 | 1,048,576,000 | 2,048,000 | 32 | 16,384 |
| 2000 | 2,097,152,000 | 4,096,000 | 64 | 32,768 |
| 4000 | 4,194,304,000 | 8,192,000 | 128 | 65,536 |
NOTE
Remember: for this table, a sector is not the basic unit of storage-it is now the cluster.
How the File Allocation Table Works
When a file is saved:
- MS-DOS starts at the beginning of the FAT and looks for the first space marked "open for use" (0000). It begins to write to that cluster.
- If the entire file can be saved within that one cluster, the code FFFF (last cluster) is placed in the cluster's status field and the file name is added to the directory.
- The cluster number is placed with the file name.
- If the file takes more than one cluster, MS-DOS searches for the next open cluster and places the number of the next cluster in the status field. MS-DOS continues filling and adding clusters until the entire file is saved.
- The last cluster then receives the end of file code (FFFF).
FAT32
Windows 98 and Windows 95 (OSR2-the final version of Windows 95, available only on new machines, also called version C) support the new FAT32 file system. FAT32 can create partitions up to 2 terabytes (two trillion bytes) in size (much larger than the 2-GB limit of FAT16) and uses smaller clusters than FAT16. This results in a more efficient use of space on a large hard disk.
When deciding whether to use FAT32, take the following into consideration:
- Don't use FAT32 on any partition that other operating systems-except for Windows 95 OSR2-will use.
- MS-DOS, Windows 3.x, the original release of Windows 95, and Windows NT clients can read FAT32 partitions shared across a network.
- If you dual boot between Windows 98 and another operating system (such as Windows NT 4.x), the drive C partition cannot be FAT32.
- You cannot compress FAT32 partitions.
- Windows 98 MS-DOS mode fully supports FAT32, so you can run most MS-DOS-mode games and applications from FAT32 partitions.
- Some older applications written to FAT16 specification might not display disk space larger than 2 GB.
- Do not use any utilities that do not support FAT32. This could result in data loss and might corrupt the file system on the hard drive.
Fragmentation
Fragmentation is the scattering of parts of the same disk file over different areas of the disk.
During PC use, files are opened and then saved back to disk. As mention earlier, the file is often stored in several small sections. Fragmentation is caused by the following:
- As a file is written to sectors (clusters), it is placed in the first available location.
- The continual addition and deletion of files begins to leave open clusters.
- These open clusters are filled by the first part of the next file to be saved.
- Soon, files become fragmented, or scattered, all over the drive.
This is an acceptable way to operate and causes no problems for the computer itself. However, excessive fragmentation slows down the hard disk drive because it has to access two or more areas to retrieve a file. It is possible for a single file to be fragmented into hundreds of pieces, forcing the R/W heads to travel all over the hard disk drive.
Most operating systems have either native or third-party applications that will defragment a drive. These should be used on a regular basis to improve performance and save wear and tear on the drive.
Disk Compression Disk compression is offered as part of the Microsoft Plus add-on product for Windows 95, but is included in Windows 98 as the DriveSpace 3 program. It works by creating a single big file (called a compressed volume file or CVF) that acts like a virtual disk drive (with its own drive letter). Files you write to the CVF will become records within the one big file. This process is normally transparent to the user.
NOTE
Keep in mind that you cannot use DriveSpace 3 with partitions that use the FAT32 file system. If you wish to compress a drive under Windows 98, use the FAT16 file system when installing the drive.
Compression saves space in two ways. It:
- Eliminates the wasted cluster space used by separate disk files.
- Replaces sequences of identical values or characters in the file data with a special reference that represents the actual data, but occupies less disk space than the data itself would.
- When the data is retrieved from the file, the real values are extracted from the special references. The result can be a dramatic reduction in the disk space occupied by files, especially with uncompressed graphics files and word-processing documents.
Using compression introduces some risk because an error in the compressed volume file can make data inaccessible. It is safest not to use a compressed file for critical data, and some older programs (particularly games) might not work with compression. With DriveSpace 3 you can use the Troubleshooter to identify and fix problems.
Compression is less necessary today, because of the advent of large hard disk drives and the availability of the FAT32 file system with its smaller cluster sizes.
The elimination of fragmentation improves the speed of the hard disk drive dramatically. Running a program to eliminate fragmentation is called defragmenting a drive. The slang term "defrag" is often used. MS-DOS installations include a defragmentation program called DEFRAG. Windows 95 and 98 include a defragmentation program that can be accessed from the Start menu-select Programs, then select Accessories, and finally select System Tools.
NOTE
DEFRAG cannot rewrite or move systems and hidden files. These files might be program files that are copy protected and must not be moved after the program is installed. System files such as the MS-DOS core program must occupy a particular position on the disk.
CAUTION
Never run a defragmentation program designed for MS-DOS or Windows 3.x on a Windows 95 or 98 system. The program might not understand the Windows 95 and 98 long file names, and data might be lost.