Linux Know-How provides a collection of introductory texts on often needed Linux skills.

32-bit hard drive I/O

Newer Linux distributions (e.g., Mandrake 7.0) can automatically turn on the hard drive optimization: 32 bit input/output (I/O) and direct memory access (DMA). Here is how to turn on the hard drive optimization manually. (Based on by Edward Choh.)

This procedure worked fine for me, yet be warned that it can possibly harm the content of your harddrive, so do not do it if you are a real PC newbie, don't feel geeky today, or have a weak heart--I can't guarantee it will work for you.

The turning on of the 32-bit I/O and DMA has to be done by root, and I did it in a single-user mode (to minimize the damage to the file system if something went wrong and I had to reboot). I definitely would not do it on a system currently running many programs or X-windows, and would have a current backup of any precious data.

To boot your computer in a single-user mode, I type this at the lilo prompt (during bootup):

linux single

Say, I would like enable the 32-bit I/O on my first IDE harddrive, which is "hda". First, I time the harddrive current performance, and note the score:

hdparm -t /dev/hda

Now, I display my current I/O and DMA settings:

hdparm -c /dev/hda

[my system showed 0, meaning that the 32-bit I/O is turned off and the default 16-bit access is used]

hdparm -d /dev/hda

[my system showed 0 again, meaning that the harddrive DMA access is turned off].

Now, I turn on the 32 bit IO and DMA:

hdparm -c 1 /dev/hda

hdparm -d 1 /dev/hda

Now, I can time the performance of the harddrive again to compare the score with the original one:

hdparm -t /dev/hda

If everything worked OK, and the performance has improved, I can "commit" the new settings, so they can survive a soft reset:

hdparm -k 1 /dev/hda

To have the new settings in effect every time you reboot the machine, you may add a line at the end of the file /etc/rc.d/rc.local (this file is something like AUTOEXEC.BAT in DOS):

hdparm -c 1 -d 1 -k 1 /dev/hda

If something did not work as expected, or the performance did not really improve, I can reboot at any time and the old settings will be in effect as long as I did not perform the last operation.

I performed this tune-up on 4 hard drives on my home network. It was a success on 3 newer hardrives: the performance improved by 30-300% and at least one computer "feels" faster than before. One harddrive (which is always flaky) hanged the computer hard during the performance test and I had to reset the machine (no damage done).

Last Update: 2010-12-16