SDB:(E)IDE hard disk is slow
Symptom:
You operate an (E)IDE hard disk in your system. However, the data throughput to this disk isn't as fast as you would like it to be :-(
Cause:
A possible cause is that improper settings for the harddisk keep it from performing at its best.
Solution:
You can try to tune your hard disk by means of the [[SDB:(E)IDE hard disk is slow#hdparm /sbin/hdparm
]] command (package: base
). After you've found the optimal settings, you can include the corresponding /sbin/hdparm
commands into your /sbin/init.d/boot.local
, e.g. like this:
echo -en "\nboot.local: Tuning the IDE hard disks..." if [ -x /sbin/hdparm ] then # Put the hdparm commands HERE else echo " FAILED: /sbin/hdparm not found." fi
Tip: A popular hard disk benchmark is bonnie
. You can use it to estimate the results of your tuning measures. SuSE Linux version 6.3 and newer contain bonnie
in an equally-named package. The original home page is http://www.textuality.com/bonnie.
A description of some particularly useful options follows. See the hdparm
manual page for the complete overview. You should read it anyway before going into action, in particular the warnings!
hdx
represents your IDE disk (replace it with hda
, hdb
... as needed):
-
hdparm -i /dev/hdx
Provides the settings of /dev/hdx
as the IDE driver in the kernel sees them.
-
hdparm -I /dev/hdx
Provides the settings of /dev/hdx
by asking the hard drive directly.
-
hdparm -m /dev/hdx
resp.hdparm -m nnn /dev/hdx
Queries / sets the number of sectors accessed for each interrupt issued for /dev/hdx
. Feasible values for nnn
are: 0 (deactivates multi-sector access) or a power of 2 (2,4,8,16,...) up to the maximal allowed value given by MaxMultSect=
in the output of hdparm -I /dev/hdx
.
Note: Activating multi-sector access is generally favourable. However, the biggest value for nnn
isn't necessarily the best one! Some trial and benchmarking is recommended.
-
hdparm -c /dev/hdx
resp.hdparm -c n /dev/hdx
Queries / sets the 32 bit data transfer between the bus and the IDE controller (n=0
: deactivated; n=1
: activated).
Generally, activating 32 bit transfer provides better performance. Again, trial and benchmarking is recommended for each individual hard disk.
-
hdparm -d /dev/hdx
resp.hdparm -d n /dev/hdx
Queries / sets using DMA for the data transfer (n=0
: deactivated; n=1
: activated).
Virtually all modern IDE disks support data transfer via DMA (Check: output of hdparm -I /dev/hdx
). This reduces CPU load considerably and might result in a dramatic performance increase! As usual, trial and benchmarking is recommended for each individual hard disk.
<keyword>EIDE,EnhancedIDE,harddisk,slow,hdparm</keyword>