Monday, July 30, 2007

UltraDMA - speedup your harddisk howto

How to speed up your harddrive read access?
How to change your harddrive access parameters?
How to measure your harddrive read access?
How to show your hardrive geometry and identification?
How to enable your harddrive UDMA (Ultra DMA) setting?

This document would cover mostly changing IDE/ATA harddrive parameters. If you have Western Digital drives, skip this document and have a further consultation from your hardware provider.

First you need to know which harddrive device you have from your system. As root:

# cat /boot/grub/
(hd0) /dev/sda

You need to remember the word from the second column which maps to your harddrive device. In the above example, we have /dev/sda .

We need to see what options are already enabled with the harddrive. We are going to make use of linux hdparm command, which is installed by default, as follows:

# hdparm /dev/sda

Now, in order for us to know each harddrive paramater changes, we need to measure and take note of our current harddrive read access and transfer rate for comparisons later on.

Now, let us get more harddrive information.

# hdparm -giI /dev/sda

The above would give you more data like harddrive geometry, read/write modes, IO buffers, timer/DMA values and more.

After getting these values, we can now do our initial harddrive read test and again take note of returned result by issuing:

# hdparm -tT /dev/sda
Timing cached reads: 888 MB in 2.00 seconds = 443.96 MB/sec
Timing buffered disk reads: 120 MB in 3.02 seconds = 39.77 MB/sec

Executing hdparm without any arguments, would show you available help options.

You can make experiments with different hdparm parameter changes. Just make notes of every read tests like the one shown above for comparison purposes. By referencing to those results, you would definitely arrive to a conclusion on which harddrive parameters makes your harddrive reads and performs fastest!

man hdparm:
hdparm provides a command line interface to various hard disk ioctls supported by the stock linux ATA/IDE device driver subsystem. Some options may work correctly only with the latest kernels. For best results, compile hdparm with the include files from the latest kernel source code

To enable DMA settings (UltraDMA) :

# hdparm -d1 /dev/sda

and to disable DMA would be :

# hdparm -d0 /dev/sda

See the effects immediately:

# hdparm /dev/sda

To make it permanent, besides from /etc/rc.local, you can place these parameter settings directly to a file /etc/sysconfig/harddisks .

Hope it helps


Sign up for PayPal and start accepting credit card payments instantly.
ILoveTux - howtos and news | About | Contact | TOS | Policy