hdparm provides  a command line interface to various kernel interfaces supported by the Linux SATA/PATA/SAS “libata” subsystem and  the  older IDE driver subsystem.  Many newer (2008 and later) USB drive enclosures now also support “SAT” (SCSI-ATA Command Translation) and therefore may also  work  with  hdparm.

To see how your hard disk does compare:

# hdparm -tT /dev/sda

/dev/sda:

Timing cached reads:   2176 MB in  2.00 seconds = 1088.50 MB/sec
Timing buffered disk reads:  178 MB in  3.01 seconds =  59.16 MB/sec

Note: Some tweaks may even make your HD unstable. So note down the numbers so you can set them back to the old values if needed !

# hdparm /dev/sda

/dev/sda:

multcount      =  8 (on)
IO_support    =  1 (32-bit)
readonly        =  0 (off)
readahead      =  256 (on)

geometry       =  38913/255/63, sectors = 625142448, start = 0

To find additional info about your HDD,

# hdparm -i /dev/sda

/dev/sda:

Model=Hitachi, FwRev=FB4OC40C, SerialNo=081104FB2400LEHVU6XA

Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }

RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4

BuffType=DualPortCache, BuffSize=7114kB, MaxMultSect=16, MultSect=8
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=625142448
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 *udma6

AdvancedPM=yes: mode=0×80 (128) WriteCache=enabled

Drive conforms to: unknown:  ATA/ATAPI-2,3,4,5,6,7

* signifies the current active mode

This will show you what are the possible settings for your hard disk.

Run the following command as root,

# hdparm -c3 -d1 /dev/sda

Again: enabling DMA can in some cases lead to serious instability, so if needed.

To disable DMA,

# hdparm -d0 /dev/sda

After tweaking you run,

# hdparm -tT /dev/hda

Compare this to above output. You will identify better HDD performance.

Note: Please use this carefully.

Related Articles: