Jump to content

DMA & Hard drive tweaking with hdparm


iphitus
 Share

Recommended Posts

Here are a few usefull commands that can get you a bit more hard drive performance.

Use at your own risk

 

DMA

Many distros are pretty conservative and leave DMA turned off, this can be enabled with the following command as root.

 

hdparm -d1 /dev/hdX

 

Replacing hdX with the hard drive, usually hda if you only have one hard drive.

 

32 bit access

Again many distros leave this turned off and the hard drive in 16 bit. To make it run in 32 bit mode run the following command as root.

 

hdparm -c1 /dev/hdX

 

Again replacing hdX with the hard drive.

 

IDE block mode

Unless your hard drive is very old you can enable IDE block mode. To discover if your had drive supports this, run the following command as root.

 

hdparm -i /dev/hdX

 

Again replacing hdX with the hard drive.

Look for the value MaxMultiSect and enter the following

 

hdparm -m 16 /dev/hdX

 

Again replacing hdX with the hard drive and replacing 16 with the value of MaxMultiSect.

 

Testing differences

To test and see how much difference these commands made run the following command as root before and after the above commands to compare results.

 

hdparm -tT /dev/hdX

 

Again replacing hdX with the hard drive.

 

If any of this blows up your computer, makes your hands self combust, chair dissapears, mouse imp[lodes, keyboard melts, it's not my fault.

None of the above happened to me on my computer :)

 

FAQ team: reckon I could put this as a FAQ somewhere?

Link to comment
Share on other sites

Guest netstar

To add to iphitus' disclaimer:

 

Chaging hard disk access to a mode unsupported by your drive is DANGEROUS. Please check the specifications of your drive before changing drive access modes.

Link to comment
Share on other sites

  • 4 weeks later...

I just came across this command in the Gentoo installation handbook. My first question, after I noticed that even the conservative settings it offered me helped my drive, was, "How do I set that permanently/on startup?"

 

How do I set that permanently/on startup? :joker:

Link to comment
Share on other sites

I have two identical WD 80Gb 8mb cache HDDs. I did the setting routine suggested on hdc and then the test at the end. I did the test only, on my hda and the results were near enough the same. Sure the hdc results appear a little better but is that gain really significant ???.

dev/hdc:

Timing buffer-cache reads: 1924 MB in 2.00 seconds = 960.23 MB/sec

Timing buffered disk reads: 132 MB in 3.01 seconds = 43.82 MB/sec

/dev/hda:

Timing buffer-cache reads: 1860 MB in 2.00 seconds = 928.75 MB/sec

Timing buffered disk reads: 136 MB in 3.03 seconds = 44.92 MB/sec

 

This is the result of running the settings in hda and then doing the test again,

/dev/hda:

Timing buffer-cache reads: 1896 MB in 2.00 seconds = 947.20 MB/sec

Timing buffered disk reads: 134 MB in 3.04 seconds = 44.09 MB/sec

 

I don't think running these settings is really worthwhile. I think modern hard drives are pretty well running at optimum now days. Having selected LBA in the BIOS, instead of the default Auto, as recommended by Mandrake has probably set up the settings this exercise wants to achieve.

 

I am no expert so I wouldn't even know if an LBA bit me on the bum.

 

Cheers. John.

Link to comment
Share on other sites

I don't think running these settings is really worthwhile.  I think modern hard drives are pretty well running at optimum now days.  Having selected LBA in the BIOS, instead of the default Auto, as recommended by Mandrake has probably set up the settings this exercise wants to achieve. 

And yet, running the commands

Activate DMA:                                       # hdparm -d 1 /dev/hda
Activate DMA + Safe Performance-enhancing Options:  # hdparm -d 1 -A 1 -m 16 -u 1 -a 64 /dev/hda

(they're listed in the Gentoo handbook) definitely helped my hard drive a little bit, and those options are conservative and general. So while it may not help a lot, it helps, and that's enough for me. Once I figure out how to get this to run on startup, I'll take the time to read the specifications on my hard drives to get the optimal optimisation. B)

Link to comment
Share on other sites

To add it permanently, look at your /etc/sysconfig/harddisks : you can put options to tweak your hard disk "permanently" and "cleanly" (no ugly script launching hdparm during boot).

 

A bit more infos here (caution, this applies to redhat, some options may not be implemented in mandrake): http://www.redhat.com/docs/manuals/linux/R...-sysconfig.html

Link to comment
Share on other sites

  • 7 months later...
I just came across this command in the Gentoo installation handbook.  My first question, after I noticed that even the conservative settings it offered me helped my drive, was, "How do I set that permanently/on startup?"

 

How do I set that permanently/on startup? :joker:

 

 

Just add them to your rc.local

Edited by raxxal
Link to comment
Share on other sites

When I first got my Shuttle AN35N board, everything that did not expressly have UDMA support crawled. They finally came out with a bios flash upgrade - "i" I think, that supported DMA - and then everything ran fast.

 

If your bios does not have a dma on setting, this may be very worthwhile!

just my 2 cents.

Kristi

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...