Sign up for PayPal and start accepting credit card payments instantly.


Wednesday, January 28, 2009

Hard Disk Guide


The hard disk can have a huge impact on the performance of your PC: The fact is that the rotating magnetic media of the hard disk is one of the severest performance bottlenecks, causing second-long delays while fat programs spin off the disk and into RAM. Whereas disk access times are measured in milliseconds, system RAM performance is counted in nanoseconds. Understanding hard disk operation - and optimizing - can eliminate teeth-grinding delays.
The factors that affect the speed of a Hard disk:

Rotation speed
Number of sectors per track
Seek time / head switch time / cylinder switch time
Rotational latency
Data access time
Cache on the HD
How data is organized on the disks
Transfer rates
Interface (EIDE / SCSI)


What are sectors, tracks, heads and cylinders?
On a Hard disk, data is stored in the magnetic coating of the disk. The so called head, held by an actor arm, is used to write and read data. This disk rotates with a constant turn time, measured in revolutions per minute (rpm). Data is organized on a disk in cylinders, tracks and sectors. Cylinders are concentric tracks on the surface of the disk. A track is divided into sectors. A Hard disk has a head on each side of a disk. Nowadays, the actuator arm is moved by a servo-motor (not a step-motor which needs more time while swinging in after moving over the desired track). All harddisks have reserved sectors, which are used automatically by the drive logic if there is a defect in the media.
Rotation speed
Typical harddisks have a rotation speed from 4,500 to 7,200 rpm, a 10,000 rpm drive just hit the market. The faster the rotation, the higher the transfer rate, but also the louder and hotter the HD. You may need to cool a 7200 rpm disk with an extra fan, or its life would be much shorter. Modern HD's read all sectors of a track in one turn (Interleave 1:1). The rotation speed is constant.

Number of sectors per track
Modern harddisks use different track sizes. The outer parts of a disk have more space for sectors than the inner parts. Usually, HD's begin to write from the outside to the inside of a disk. Hence, data written or read at the beginning of a HD is accessed and transferred faster rate.


Seek time / head switch time / cylinder switch time
The fastest seek time occurs when moving from one track directly to the next. The slowest seek time is the so called full-stroke between the outer and inner tracks. Some harddisks (especially SCSI drives) don't execute the seek command correctly. These drives position the head somewhere close to the desired track or leave the head where it was. The seek time everyone is interested in is the average seek time, defined as the time it takes to position the drive's heads for a randomly located request. Yes, you are correct: seek time should be smaller if the disk is smaller (5 1/4″, 3 1/2″ etc.).
All heads of a Hard disk are carried on one actuator arm, so all heads are on the same cylinder. Head switch time measures the average time the drive takes to switch between two of the heads when reading or writing data.
Cylinder switch time is the average time it takes to move the heads to the next track when reading or writing data.
All these times are measured in milliseconds (ms).
Rotational latency
After the head is positioned over the desired track, it has to wait for the right sector. This time is called rotational latency and is measured in ms. The faster the drives spins, the shorter the rotational latency time. The average time is the time the disk needs to turn half way around, usually about 4ms (7200rpm) to 6ms (5400rpm).
Data access time
Data access time is the combination of seek time, head switch time and rotational latency and is measured in ms.
As you now know, the seek time only tells you about how fast the head is positioned over a wanted cylinder. Until data is read or written you will have to add the head switch time for finding the track and also the rotational latency time for finding the wanted sector.
Cache
I guess you already know about cache. All modern HD's have their own cache varying in size and organization. The cache is normally used for writing and reading. On SCSI HD's you may have to enable write caching, because often it is disabled by default. This varies from drive to drive. You will have to check the cache status with a program like ASPIID from Seagate.
You may be surprised that it is not the cache size that is important, but the organization of the cache itself (write / read cache or look ahead cache).
With most EIDE drives, the PC's system memory is also used for storing the HD's firmware (e.g. software or "BIOS"). When the drive powers up, it reads the firmware from special sectors. By doing this, manufacturers save money by eliminating the need for ROM chips, but also give you the ability to easily update your drives "BIOS" if it is necessary (Like for the WD drives which had problems with some motherboard BIOS' resulting in head crashes!).
Organization of the data on the disks
You now know, a Hard disk has cylinders, heads and sectors. If you look in your BIOS you will find these 3 values listed for each Hard disk in your computer. You learned that a Hard disk don't have a fixed sector size as they had in earlier days.
Today, these values are only used for compatibility with DOS, as they have nothing to do with the physical geometry of the drive. The Hard disk calculates these values into a logical block address (LBA) and then this LBA value is converted into the real cylinder, head and sector values. Modern BIOS' are able to use LBA, so limitations like the 504 MB barrier are now gone.
Cylinder, heads and sectors are still used in DOS environments. SCSI drives have always used LBA to access data on the Hard disk. Modern operating systems access data via LBA directly without using the BIOS.
Transfer rates
In the pictures you can see the several ways how data can be stored physically on the Hard disk. With a benchmark program that calculates the transfer rate or seek time of the whole Hard disk you can see if your drive is using a 'vertical' or a 'horizontal' mapping. Depending on what kind of read/write heads and servo-motors (for positioning the actuator arm) are used it is faster to switch heads or to change tracks.
The Interface (EIDE / SCSI)
Currently there are 2 different common interfaces: EIDE and SCSI. You will find an EIDE controllers integrated with the motherboard and that EIDE harddisks are much cheaper than SCSI drives. For SCSI you need an extra controller, because there aren't a lot of motherboards with integrated SCSI controllers. Together with the higher price of a SCSI disk a SCSI system is more expensive than EIDE.
The EIDE interface has a primary and a secondary channel that will connect to two devices each, for a total of four. That could be a Hard disk, CD-ROM or disk changers. Lately there have been tape backups with EIDE connectors, but you need special backup software.
Scanners for example aren't available with EIDE interface, only with SCSI. You can connect up to 7 devices to a SCSI bus or 15 devices to a Wide SCSI. In a standard environment, the performance of single Hard disk won't improve much from the SCSI interface. Rather, the power of SCSI is that several devices can use the bus at the same time, not using the bus while they don't need it. So, we see the best benefit from SCSI when several devices are all used on the same bus.
On one EIDE channel, the 2 devices have to take turns controlling the bus. If there is a Hard disk and a CD-ROM on the same channel, the Hard disk has to wait until a request to the CD-ROM has finished. Because CD-ROM's are relatively slow, there is a degradation of performance. That's why everybody tells you to connect the CD-ROM to the secondary channel and your Hard disk to the primary. The primary and secondary channels work more or less independently of one another (it's a matter of the EIDE controller chip).
The SCSI interface comes in several types. 8-bit (50 wire data cable) or 16-bit (68 wire data cable, Wide SCSI). The clock can be 5 MHz (SCSI 1), 10 MHz (Fast SCSI), 20 MHz (Fast-20 or Ultra SCSI) or 40 MHz (Ultra-2 SCSI).


It is not only the interface transfer rate that determines how fast a Hard disk is. How fast the data can be written or read from the media, e.g. data density and rotation speed is more important. The fastest interface can't do anything faster than the 'inner values' of a Hard disk are capable of. Today, most harddisks are still under 10 Mbytes/s transfer rate physically. A faster interface is advantageous on when data is read from or written to the cache in a multitasking environment with several devices accessed simultaneously.
Multitasking environments especially benefit from SCSI, since simultaneous access occurs frequently. If you have a server or are working with large files like audio, video or disk-intense applications, you will benefit more from SCSI than EIDE. There are three reasons for this:
All modern operating systems now supports SCSI very well. Windows 3.x didn't!
Bus mastering really works better with a SCSI bus mastering controller.
The fastest harddisks with the best performance are SCSI.
If you need large capacities and the highest transfer rates available on the market you need SCSI. This is not because EIDE is incapable of this, it's because of the market. High-end disks with high capacities and high performance are intended to be used in servers and aren't build with EIDE interface. At the moment, EIDE disks are only built with up to a 5 Gigabyte capacity (there is a problem with a 4 GB barrier with some BIOS's again and for drives bigger than 8 GB you need a new BIOS that supports the INT 13 functions AH=41h bios 49h) and transfer rates of about 9 Mbytes/s. If you need more, you'll have to use SCSI. Also, SCSI harddisks have larger cache RAM than EIDE harddisks.
Performance, some thoughts
You need to know how a slow or fast Hard disk affects your overall system performance in a standard environment. If your operating system isn't constantly swapping (e.g. you have enough memory) the speed of a Hard disk is only a small part of a well balanced system. Let's say you have a Hard disk that has 30% better performance than another older one; the benefit for standard applications would be from 2% up to 18%. Sometimes, you want or need the fastest components available. Other times, more capacity and reliability is needed.
There are several programs available that test the performance of a Hard disk. Some are crap, others are good. In any case, if you have one, you get numbers that tell you something. But do you have a point of comparison? Different benchmarks mean different numbers. Different environments mean different numbers. Modern benchmarks are independent from existing data on the Hard disk (only read performance testing can be done). But a benchmark could be affected by several things:
To which channel is the Hard disk connected
Is the Hard disk alone or together with other devices connected to the controller
Under which operating system is the Hard disk tested and used
Which drivers are loaded or not loaded.
Testing at Monday or Friday etc.


Installing a New Drive
Now that you've determined what type of drive configuration you have in the previous section, you can install the new drive. This section is divided into similarly appropriate parts, with steps common to all new installations here.
Before You Begin, You Need:
A screwdriver
An open drive bay (either 51/4- or 31/2-inch)
Slide rails
3 1/2- to 5 1/4-inch mounting brackets (if you are putting the drive in a 5 1/4-inch bay)
Mounting screws (come with the drive)
Proper length ribbon cable
1. Shut down, turn off, and unplug the PC.
2. Open the system.
3. Discharge your static.
The following sections are specific to the type of drive configuration, and you should skip to the section that suits your needs.
Replacing an IDE Drive
This section describes the process of replacing a drive in a single drive system. For information on adding a new drive, skip to the next section.
TIP: It is highly recommended that you replace your old IDE controller with a new EIDE controller. The additional cost is more than worth it in performance gains.
1. Locate the old drive, unplug the power connector and the 40-pin ribbon cableRemove the 4-pin power connector.Remove the 40-pin IDE ribbon cable.
2. Locate and remove the mounting screws. These are found either on the side of the drive bay or in frontRemove the drive mounting screws.
3. Carefully slide the drive out, making sure not to snag any other cables or wires in the process.
4. Remove and save any mounting brackets, slide rails, and screws that may be attached. You can reuse them on the new drive. That's the surest way of getting a good fit.Remove the old drive.
5. Attach any mounting brackets and/or slide rails from the last step to the new drive.
6. Check the position of the key in your 40-pin ribbon cable. This key assures the correct alignment of the cable to the drive.
TIP: Don't panic if your ribbon cable does not have a key; not all do. There will be one colored wire at the side of the cable to indicate the #1 pin position, and the drive will also indicate this pin on its underside
7. Slide the new drive in place of the old one, and replace all mounting screws.
CAUTION: When securing a hard disk, be extremely careful to avoid stripping or cross-threading a mounting hole. An unevenly mounted drive will vibrate excessively. This can lead to premature drive failure.
8. Reattach the ribbon cable, noting the position of the key, or the #1 pin position.
9. Reattach the 4-pin power connector.
TROUBLESHOOTING: My system doesn't even start when I turn the power on. What happened? You may have inadvertently replaced the ribbon cable reversed (#40 wire to the #1 pin). Turn the power off and double-check that the #1 pin positions are lined up.



No comments: