Philippe Simard

Menu Principal
Home
Liens externes
Photos
Ressources
Météo
Password Generator
Sujets
Musique
Bricolage
Informatique
SherBroue
Related Items



Accueil Password Generator
Hdparm Print E-mail
Written by Philippe Simard   
Saturday, 27 September 2008 10:13
Article Index
Hdparm
Changing device settings
Making the hdparm options permanent
All Pages

Hdparm


Introduction

Hdparm is a tool that allows you to set IDE device settings. This includes things such as DMA modes, transfer settings and various other settings that can help improve the speed of your hard disks and CDROMs. These settings are not enabled by default, so you will probably want to enable them. This guide is also intended to provide more up-to-date information on hdparm settings and inform the user how to check what settings are supported so that the optimum settings for the drive can be used. Many hdparm guides simply tell people to enable specific modes such as '-X33' or '-c1', and as most of these guides are now out-of-date many people end up using those older settings when better, newer options may now be used. By speeding up your hard drives you should get a faster system. It should also help solve stuttering DVD playback or extremely slow burning.

Note: much of this document is tailored towards standard IDE connected devices. If you use SATA or SCSI, look at using sdparm instead of hdparm.

Notice (RAID and such)

HDParm is the root of all evil with Software/BIOS-RAID.

Most disks do not sync evenly with DMA enabled, the more drives you have the less speed you should set.

Installing hdparm

Firstly check if hdparm is already installed on your system by typing the following as root:

emerge -n hdparm

Getting information about your different drives

Different drives have different capabilities, so in order to configure them you must know what they are capable of doing. # hdparm -i /dev/hdX should give you the information you need (replace hdX with your drive)

Udev systems also allow for drives to be accessed with a slightly more understandable filename.

For hard drives (replace X with the disc number): hdparm -i /dev/discs/disc#/disc, and for CDROMs: hdparm -i /dev/cdroms/cdrom#/cdrom

You should get something similar to the following

Code: hdparm -i /dev/hdd
Model=WDC WD80EB-28CGH2, FwRev=24.84G24, SerialNo=WD-WMA9N7936819
Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }
RawCHS=15509/16/63, TrkSize=57600, SectSize=600, ECCbytes=40
BuffType=DualPortCache, BuffSize=768kB, MaxMultSect=16, MultSect=16
CurCHS=15509/16/63, CurSects=15633072, LBA=yes, LBAsects=15633072
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 *udma2 udma3 udma4 udma5
AdvancedPM=no WriteCache=enabled
Drive conforms to: device does not report version:

* signifies the current active mode

You will want to repeat this process for each IDE HDD/CDROM you have. Pay attention to the MaxMultSect and maximum mode available from the PIO/DMA/UDMA modes.

Benchmarking devices

hdparm -tT

hdparm includes a handy benchmark mode, which should allow you to see how much of a speed improvement each of the different settings gives you. When running a benchmark it is recommended that you close all programs that could interfere with the results. Ideally do it from the console, rather than in a xterm with xorg running. To perform a benchmark, issue a command like the following - once again replacing X with your drive letter:

# hdparm -tT /dev/hdX

You should then get some speed results like the following:

Code: hdparm -tT /dev/hdX
/dev/hdd:
Timing cached reads: 496 MB in 2.00 seconds = 247.42 MB/sec
Timing buffered disk reads: 60 MB in 3.03 seconds = 19.81 MB/sec

It is recommended that you benchmark all your drives and save the results before you start tweaking them, so that you can tell how much of an improvement you are getting.

For example, the following test was run on a hard drive supporting UDMA6:

Code: hdparm -tT /dev/hdX
/dev/hda:
Timing cached reads: 1104 MB in 2.00 seconds = 551.53 MB/sec
Timing buffered disk reads: 170 MB in 3.00 seconds = 56.58 MB/sec

Here's a hard drive set to low, slow settings:

Code: # hdparm -cuda /dev/hda
/dev/hda:
IO_support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 0 (off)
readahead = 256 (on)

And here is its performance information:

Code: # hdparm -tT /dev/hda
/dev/hda:
Timing cached reads: 344 MB in 2.08 seconds = 165.37 MB/sec
Timing buffered disk reads: 10 MB in 3.48 seconds = 2.87 MB/sec

This is the same hard drive, after rebuilding the kernel with the Cotroller's drivers and DMA enabled (see below: "I get "Operation not permitted" errors on setting DMA (-d1)"):

Code: # hdparm -cuda /dev/hda
/dev/hda:
IO_support = 1 (32-bit)
unmaskirq = 1 (on)
using_dma = 1 (on)
readahead = 256 (on)

And this is the performance statistics for those settings:

Code: # hdparm -tT /dev/hda
/dev/hda:
Timing cached reads: 464 MB in 2.01 seconds = 231.06 MB/sec
Timing buffered disk reads: 54 MB in 3.06 seconds = 17.65 MB/sec
Note: The IDE Controller in this system doesn't support higher udma levels than udma4, so with a newer controller and udma6 you will probably get better improvements.

bonnie++

Sometimes hdparm -tT won't show any differences when tweaking hdparm settings, or will show inaccurate results. bonnie++ does more accurate and in-depth analysis of the hard drive speed. Here is a comparison from my system (hdparm -tT gave ~ 260/570 kbps for cached/buffered reads in BOTH cases):

Code: # hdparm -d0 -u0; bonnie++
Version  1.03       ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
minihenk 300M 3224 52 6115 14 2980 27 3588 89 5687 25 81.8 1
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 285 96 +++++ +++ 17444 91 286 95 +++++ +++ 1012 89
minihenk,300M,3224,52,6115,14,2980,27,3588,89,5687,25,81.8,1,16,285,96,+++++,+++,17444,91,286,95,+++++,+++,1012,89
Code: # hdparm -d1 -u1 -X udma5; bonnie++
Version  1.03       ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
minihenk 300M 6058 95 13055 27 5570 11 6650 88 12852 12 89.5 1
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 282 95 +++++ +++ 17567 92 288 96 +++++ +++ 1038 92
minihenk,300M,6058,95,13055,27,5570,11,6650,88,12852,12,89.5,1,16,282,95,+++++,+++,17567,92,288,96,+++++,+++,1038,92



Last Updated ( Saturday, 27 September 2008 12:43 )
 


(C) 2008 philippesimard.com. Tous droits réservés. Powered by Webboréal hébergement Web.
Your IP: 38.107.191.104

Valid XHTML 1.0 Transitional Valid CSS!