Many people don't realize they can improve the performance of their hard-disks under Linux with a quick command. For this, I'm supposing you have an IDE interface.

The first thing to do is:

hdparm /dev/hda
You should see something like this:

 multcount    =  0 (off)
 I/O support  =  0 (default 16-bit)
 unmaskirq    =  0 (off)
 using_dma    =  X
 keepsettings =  0 (off)
 nowerr       =  0 (off)
 readonly     =  0 (off)
 readahead    =  8 (on)
 geometry     = NNNN/NNN/NNN, sectors = NNNNNNN, start = 0

The line that interests us is the one that says:

using_dma    =  X

If X is "1" chances are there's little room for improvement. A value of "0" however, means that your system is not using DMA to access the hard-drive. You can obtain a significant performance improvement of up to 4X with a simple command.

Try first:

hdparm -t /dev/hda
This will tell you how many MB/sec (megabytes per second) your drive can transfer. Now, do:

hdparm -d 1 -k 1 /dev/hda

and repeat the

hdparm -t /dev/hda
command to measure the performance difference.

In my case, the transfer-rate jumped from 4MB/sec to 17MB/sec. A worthy increase.

After that, all you have to do it to put the command on your rc.local file so it get executed every time the system boots.

Whoah, watch it there. Enabling DMA without doing some intense testing afterwards can result in severe data corruption, or a complete lock up of the disk driver.

Some hard drives don't know how to do DMA well when connected to some controllers. Therefore, it is a good idea to always test, using heavy reading and writing on the disk when it doesn't have data you care about on it yet, before assuming your turning on DMA was successful. I had an old Quantum Fireball drive which would appear to work fine when DMA was turned on (and even perform faster) but would eventually lock up completely, requiring a hard reboot and a rather messy fsck.

When tweaking for performance, test, test, and test until you can't test anymore. Then, make sure you have good backups. }:).

Log in or register to write something here or to contact authors.