Tuning IDE Hard Disk Performance
Performance increases have been reported on massive disk I/O operations by setting the IDE drivers to use DMA, 32-bit transfers and multiple sector modes. The kernel seems to use more conservative settings unless told otherwise. The magic command to change the setting of your drive is “hdparm”.
• To enable 32-bit I/O over the PCI buses, use the command: [root@deep /]# /sbin/hdparm -c 1 /dev/hda (or hdb, hdc etc).
This will usually, depending on your IDE Disk Drive model, cut the timing buffered disk reads time by 2. The “hdparm” (8) manpage says that you may need to use -c 3 for some chipsets. All (E)IDE drives still have only a 16-bit connection over the ribbon cable from the interface card.
• To enable DMA, use the command:
[root@deep /]# /sbin/hdparm -d 1 /dev/hda (or hdb, hdc etc).
This may depend on support for your motherboard chipset being compiled into your kernel. Also, this command will enable DMA support for your hard drive, it will cut the timing buffered disk reads time and will improve the performance by 2.
• To enable multiword DMA mode 2 transfers, use the command:
[root@deep /]# /sbin/hdparm -d 1 -X34 /dev/hda (or hdb, hdc etc).
This sets the IDE transfer mode for newer (E)IDE/ATA2 drives, (check your hardware manual to see if you have it).
• To enable UltraDMA mode2 transfers, use the command:
[root@deep /]# /sbin/hdparm -d 1 -X66 /dev/hda (or hdb, hdc etc)
You’ll need to prepare the chipset for UltraDMA beforehand. Also, see your manual page about “hdparm” for more information. Use this with extreme caution!
• To set multiple sector mode I/O, use the command:
[root@deep /]# /sbin/hdparm -m XX /dev/hda (or hdb, hdc etc)
Where “XX” is the maximum setting supported by your drive. The -i flag can be used to find the maximum setting supported by an installed drive: look for MaxMultSect in the output.
[root@deep /]# /sbin/hdparm -i /dev/hda (or hdb, hdc etc) /dev/hda:
Model=Maxtor 7540 AV, FwRev=GA7X4647, SerialNo=L1007YZS Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>5Mbs FmtGapReq} RawCHS=1046/16/63, TrkSize=0, SectSize=O, ECCbytes=11 BuffType=3(DualPortCache), BuffSize=32kB, MaxMultSect=8, MultSect=8 DblWordlO=yes, maxPIO=2(fast), DMA=yes, maxDMA=1 (medium) CurCHS=523/32/63, CurSects=379584528, LBA=yes, LBA=yes, LBAsects= 1054368 tDMA={min:150,rec:150}, DMA modes: swordO swordi *sword2 *mwordO IORDY=on/off, tPIO={min:240,w/IORDY:180}, PIO modes: mode3
Multiple sector mode (aka IDE Block Mode), is a feature of most modern IDE hard drives, permitting the transfer of multiple sectors per I/O interrupt, rather than the usual one sector per interrupt. When this feature is enabled, it typically reduces operating system overhead for disk I/O by 30-50%. On many systems it also provides increased data throughput of anywhere from 5% to 50%.