"Speed up" Linux with hdparm

By Vincent Danen, TechRepublic
31 January 2005 01:05 PM
Tags: disk drive, storage, hdd, hard drive, ide
TechRepublic
These days, most hard drives are of the ATA100 or ATA133 specification. The theoretical transfer rate of an ATA100 drive is 100 MBps; an ATA133 drive's theoretical transfer rate is 133 MBps. Of course, these are theoretical rates.

Many Linux systems use conservative defaults that could be slowing down your system. At the very least, these defaults could be preventing your system from reaching the maximum speeds that your hardware allows.

Like most parts of a Linux system, how Linux interacts with your IDE hard drives is configurable. You can accomplish this using the hdparm tool, which allows you to customise many aspects of any given IDE hard drive device.

Of course, using hdparm requires caution because your drive could end up corrupting data or failing if you configure it incorrectly.

To get the information of your device, execute the following:

hdparm /dev/hda

To get more extended information, use the following:

hdparm -i /dev/hda

Replace /dev/hda with the IDE device name of the drive you wish to report on. (hda is the first drive on the first IDE bus.)

Look for the multcount, IO_support, and using_dma fields. These fields help you determine if your drive is using its full capabilities.

Let's assume that the device in question is an ATA100 or ATA133 drive using an 80-wire cable. To determine the speed of the drive, execute the following:

# hdparm -Tt /dev/hda

/dev/hda:
Timing buffer-cache reads: 968 MB in 2.00 seconds = 484.00 MB/sec
Timing buffered disk reads: 88 MB in 3.05 seconds = 28.85 MB/sec

The results show that the drive is operating at a fairly decent speed. If your drive is an ATA100 or ATA133 drive and you're getting speeds of 1 to 2 MBps, then your drive isn't using DMA mode, which you can tell from the hdparm information noted above. You can also tell this by looking for the using_dma keyword. (It should have a value of 1 for on.)

To tweak the speed, execute the following:

# hdparm -d1 -c1 -m16 /dev/hda

This turns on DMA mode, specifies the maximum number of disk sectors to transfer in a single request (older drives should use -m8), and enables 32-bit transfers to the ATA controller. Using hdparm /dev/hda should reveal (among other things) the following lines:

/dev/hda:
multcount = 16 (on)
IO_support = 1 (32-bit)
using_dma = 1 (on)

Some new drives don't enable these settings on their own, so you'll need to use hdparm to achieve the maximum speed your drive will permit.

This tip is from TechRepublic's free Linux NetNote newsletter.

TechRepublic is the online community and information resource for all IT professionals, from support staff to executives. We offer in-depth technical articles written for IT professionals by IT professionals. In addition to articles on everything from Windows to e-mail to firewalls, we offer IT industry analysis, downloads, management tips, discussion forums, and e-newsletters.

©2005 TechRepublic, Inc.

Advertisement

Talkback 0 comments

Latest Videos

Sponsored content

Power Centre - Content from our premier sponsors

Blogs

  • Suzanne Tindal IT: Govt's cost-cutting bitch
    The government needs to stop looking at IT as a necessary evil or the place to remove costs when the Treasurer comes calling.
  • Array Can complaints on mobile content be cut?
    On 1 July this year the new Mobile Premium Services Code was introduced. It sounds like it's had a good impact, but is it enough?
  • Array NZ farmers: Bleating about broadband
    As we know, farmers are such bleaters. They bleat as much as the four-legged woolly things in their paddocks. If it's not the weather, it's the strength of the dollar! Nothing is ever right. Likewise with rural broadband.
  • More blogs »

Tags

Back to top

Featured