Help - Search - Members - Calendar
Full Version: DMA & Hard drive tweaking with hdparm
MandrivaUsers.org > General Help > Tips and Tricks
iphitus
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.

CODE
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.

CODE
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.

CODE
hdparm -i /dev/hdX


Again replacing hdX with the hard drive.
Look for the value MaxMultiSect and enter the following

CODE
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.

CODE
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 smile.gif

FAQ team: reckon I could put this as a FAQ somewhere?
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.
Andrewski
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.gif
AussieJohn
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.
Andrewski
QUOTE (AussieJohn @ Jul 15 2004, 03:12 AM)
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
CODE
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. cool.gif
yoho
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
raxxal
QUOTE (Andrewski @ Jul 14 2004, 09:22 PM)
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.gif
*



Just add them to your rc.local
kristi
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.