Securing-Optimizing-RH-Linux-1_2_74
Comments and suggestions concerning this book should be mailed to gmourani@videotron.ca
© Copyright 1999-2000 Gerhard Mourani and Open Network Architecture ®
74
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.
To enable multiword DMA mode 2 transfers, use the command:
[root@deep /]# /sbin/hdparm -d 1 -X34 /dev/hda (or hdb, hdc etc).
This set 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 you 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=0, ECCbytes=11
BuffType=3(DualPortCache), BuffSize=32kB, MaxMultSect=8, MultSect=8
DblWordIO=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: sword0 sword1 *sword2 *mword0
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%.
You can test the results of your changes by running hdparm in performance test mode:
[root@deep /]# /sbin/hdparm -t /dev/hda (or hdb, hdc etc).
Once you have a set of "hdparm" options, don't forget to put the commands in your
"/etc/rc.d/rc.local" file to run it every time you reboot the machine.
14. Handled more connections by time with your TCP/IP
This hack just make the time default values for TCP/IP connection lower so that more
connections can be handled by time on your TCP/IP protocol. The following will decrease the