Saturday, October 10, 2009

The Linux operating system has a really nice tool for testing and optimizing your hard drive. This tool is called hdparm and can work with both IDE and ATA drives.

NOTE: hdparm does NOT work with SATA drives.

The hdparm tool is a command line only tool, and even though it should be only used by those who know their systems well, it’s not terribly difficult to use.

But why would you want to speed up your drive when modern drives are already fast enough? Some Linux installations default to slower defaults which, effectively, slow down your drives. Of course using such a tool must come with a warning.

WARNING: Using hdparm incorrectly could cause corruption of data.

You do not have to worry about installing hdparm as it should already be installed by default. The basic usage of hdparm is:

hdparm [OPTIONS] [DEVICE]

Of course, by DEVICE, I mean in the Linux vernacular which will be something like /dev/hda.

To get the basic information about your drive you would issue the command:

What about SATA?
Naturally there is a tool for the same tricks, but for SATA drives. The sdparm tool is similar in use to the hdparm tool.

The sdparm tool, however, is a bit more complex and not nearly as necessary as most SATA drives will give you pretty swift throughput. If you want to use sdparm you will notice that it is not installed by default.

You can install sdparm with the command:

# sudo apt-get install sdparm

I will dive into sdparm at a later date.

Final thoughts
If you are dealing with older, slower ATA/IDE drives you will probably notice a significant improvement when you use hdparm to speed up your throughput.

Give this a go, but I suggest testing it on a non-production machine first.