The Harddisk 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 miliseconds, 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 harddisk:
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 harddisk, 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 harddisk 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 harddisk 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 surprized 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 harddisk has cylinders, heads and sectors. If you look in your BIOS you will find these 3 values listed for each harddisk in your computer. You learned that a harddisk 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 harddisk 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 harddisk. 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 harddisk. With a benchmark program that calculates the transfer rate or seek time of the whole harddisk 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 harddisk, 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 harddisk 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 harddisk and a CD-ROM on the same channel, the harddisk 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 everbody tells you to connect the CD-ROM to the secondary channel and your harddisk 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 cabel) 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).
Possibletransfer rates of the SCSI bus | ||
SCSIbus clock |
8-bit (50 wire data cable) |
16-bit (68 wire data cable, Wide SCSI) |
5 MHz (SCSI 1) | 5 MBytes/s | NA |
10 MHz (Fast SCSI, SCSI II) | 10 MByte/s | 20 MByte/s |
20 MHz (Fast-20, Ultra SCSI) | 20 MByte/s | 40 MByte/s |
40 MHz (Fast-40, Ultra-2 SCSI) | 40 MByte/s | 80 MByte/s |
The theoretical transfer rate of EIDE is up to 16.6 MByte/s in PIO mode 4 or multi DMA mode 2 (soon 33.3 MByte/s) with all the problems you may have already faced. Here you will find a table of several interfaces and their speeds. However, today's CD-ROM's often use PIO mode 3, while older device use PIO mode 0 to 2. Sometimes devices lie about the PIO mode they support. There are harddisks that say they are able to use PIO mode 2 but they only work reliably in PIO mode 1! Whenever you get errors accessing your harddisk, try to lower the PIO mode first!
Possible theoretcial transferrates of the IDE bus (ATA) | |
single word DMA 0 | 2.1 MByte/s |
PIO mode 0 | 3.3 Mbyte/s |
single word DMA 1, multi word DMA 0 | 4.2 MByte/s |
PIO mode 1 | 5.2 MByte/s |
PIO mode 2, single word DMA 2 | 8.3 MByte/s |
Possible theoretcial transferrates of the EIDE bus (ATA-2) | |
PIO mode 3 | 11.1 MByte/s |
multi word DMA 1 | 13.3 MByte/s |
PIO mode 4, multi word DMA 2 | 16.6 MByte/s |
Possible transferrates of Ultra-ATA (Ultra DMA/33) | |
multi word DMA 3 | 33.3 MByte/s |
It is not only the interface transfer rate that determines how fast a harddisk 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 harddisk are capable of. Today, most harddisks are still under 10 MByte/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 simultanoues 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! | |
Busmastering really works better with a SCSI busmastering 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 bis 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 harddisk affects your overall system performance in a standard enviroment. If your operating system isn't constantly swapping (e.g. you have enough memory) the speed of a harddisk is only a small part of a well balanced system. Let’s say you have a harddisk 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 harddisk. 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 harddisk (only read performance testing can be done). But a benchmark could be affected by several things:
To which channel is the harddisk connected | |
Is the harddisk alone or together with other devices connected to the controller | |
Under which operating system is the harddisk tested and used | |
Which drivers are loaded or not loaded. | |
Testing at Monday or Friday etc. |
The File System
It is very important and I recommend you to go through my FAT32 and Hard Disk Maintainance Guide
The Bus Master DMA Feature of the Triton
The Intel PCIsets 430 FX, HX VX and TX include the PIIX (PCI ISA IDE XCELERATOR), which is capable of transfering data between an EIDE device and the memory via DMA (Direct Memory Access) by using Bus Mastering. This means that data is transferred (more or less) directly from the HDD to main memory without using very many CPU resources. Also the new Multi Word DMA Modes introduced by the EIDE/Fast ATA specifications are able to transfer data just as fast as the new PIO (Programmed Input/Output) Modes. The advantage of using the Bus Master DMA is that it uses less CPU resources than PIO and therefore it's of particular benefit in multitasking environments, where the CPU can work on a different program while data is transferred to or from the HDD.
However, the way of the data from the harddisk into the memory is devided into two parts: From the drive to the chipset's EIDE interface and from the EIDE interface into the memory. The BIOS of the PC sets the EIDE interface of the chipset to use busmaster transfer between the drive and the interface. The busmaster driver is needed, to initiate the DMA transfers between the interface and the memory. The busmaster driver can switch on the DMA transfer between the drive and the interface, but if this isn't properly supported by the BIOS it will use PIO mode instead. However, the transfer from the EIDE interface into the memory can still use DMA.
If you want to use this feature, you'll need a driver for your specific OS. There is no option in any BIOS so far to enable or disable it, so don't bother about your BIOS, you'll just need the right driver. Since Windows 95 seems to be the most popular OS so far, here the...
Windows 95 IDE Bus Master DMA Drivers
You can find any busmaster driver available at BM Drivers.com
In the so called Windows95 service release 2 (which is only sold as an OEM-product to PC manufacturers) you now have a DMA capable driver included (name is still ESDI_506.pdr). DMA mode can be switched on or off in the drive proberty screen in system manager.
Windows98 supports Busmastering for most Chipsets
Problems with the Bus Master DMA Drivers under Windows 95
The most common problem with these drivers I came across so far are with an ATAPI CD-Rom drive or a NON EIDE HDD, which also is connected to the EIDE interface and isn't recognized by the driver. In other words: You install the driver and your CD-Rom and older harddrive have disappeared.
We also have all come across the delayed Windows 95 boot up problem, which seems to annoy a lot of impatient people. If you have a look into the System Manager you'll find a not working second IDE port in case you haven't connected anything to it. The solution to this problem is the same.
One very good answer to this problem is to get the DMA driver working on one EIDE port and the default PIO driver on the other (to connect the CD-Rom or old hard drives or to get rid of this non functioning second IDE port).
After installing the Bus Master Driver you simply have to change the registry (always back up registry before changing it !!!!!):
find HKEY_LOCAL_MACHINE/System/CurrentControlSet /control/Services/Class/hdc |
|
there should be four subdirectories 0000-0003 | |
find the one where DriverDesc is something like "Primary Bus Master IDE controller" or "Secondary Bus Master IDE controller", according to the port you want to change (should be 0002 or 0003). | |
in this subdirectory you change PortDriver from "ideatapi.mpd" to "ESDI_506.pdr" | |
if you want to, you can change DriverDesc to something like "Standard IDE/ESDI controller", to make it look more correctly in your Systems Manager | |
reboot |
Now this EIDE port is using the default PIO driver and you easily can use CD-Roms or non EIDE hard drives on this port.
A different solution to this problem seems to be keeping the data wires to the HDDs/CD-Roms as short as possible, which does the trick Mount the drives properly, they should be grounded !
Another trick that may shorten the startup time, is to start Windows95 in safe mode and delete all drives in System-Manager. Don't worry, with the next start up of Windows95 they will be recognized again.