Debian Admin

Debian/Ubuntu Linux System Administration Tutorials,Howtos,Tips

  • RSS Subscribe

    subscribe to the Debian Admin RSS feed
  • Sponsors



  • Categories

  • Sponsors

  • Support DebianAdmin

    Amount $:
    Website(Optional):


  • Meta

  • Archives



Tune your hard disk for high performance Using hdparm

Posted by Admin on September 14th, 2006

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

This is small utility for Get/set hard disk parameters for Linux IDE drives. Primary use is for enabling irq-unmasking and IDE multiplemode.

Installing hdparm in Debian

#apt-get install hdparm

Reading Package Lists… Done
Building Dependency Tree… Done
Suggested packages:
apmd
The following NEW packages will be installed:
hdparm
0 upgraded, 1 newly installed, 0 to remove and 11 not upgraded.
Need to get 51.7kB of archives.
After unpacking 197kB of additional disk space will be used.
Get:1 http://mirror.ox.ac.uk stable/main hdparm 6.1-2 [51.7kB]
Fetched 51.7kB in 0s (454kB/s)
Selecting previously deselected package hdparm.
(Reading database … 13645 files and directories currently installed.)
Unpacking hdparm (from …/archives/hdparm_6.1-2_i386.deb) …
Setting up hdparm (6.1-2) …

Available options for hdparm

#hdparm –help

hdparm – get/set hard disk parameters – version v6.1

Usage: hdparm [options] [device] ..

Options:
-a get/set fs readahead
-A set drive read-lookahead flag (0/1)
-b get/set bus state (0 == off, 1 == on, 2 == tristate)
-B set Advanced Power Management setting (1-255)
-c get/set IDE 32-bit IO setting
-C check IDE power mode status
-d get/set using_dma flag
–direct use O_DIRECT to bypass page cache for timings
-D enable/disable drive defect management
-E set cd-rom drive speed
-f flush buffer cache for device on exit
-g display drive geometry
-h display terse usage information
-i display drive identification
-I detailed/current information directly from drive
–Istdin reads identify data from stdin as ASCII hex
–Istdout writes identify data to stdout as ASCII hex
-k get/set keep_settings_over_reset flag (0/1)
-K set drive keep_features_over_reset flag (0/1)
-L set drive doorlock (0/1) (removable harddisks only)
-M get/set acoustic management (0-254, 128: quiet, 254: fast) (EXPERIMENTAL)
-m get/set multiple sector count
-n get/set ignore-write-errors flag (0/1)
-p set PIO mode on IDE interface chipset (0,1,2,3,4,…)
-P set drive prefetch count
-q change next setting quietly
-Q get/set DMA tagged-queuing depth (if supported)
-r get/set device readonly flag (DANGEROUS to set)
-R register an IDE interface (DANGEROUS)
-S set standby (spindown) timeout
-t perform device read timings
-T perform cache read timings
-u get/set unmaskirq flag (0/1)
-U un-register an IDE interface (DANGEROUS)
-v defaults; same as -mcudkrag for IDE drives
-V display program version and exit immediately
-w perform device reset (DANGEROUS)
-W set drive write-caching flag (0/1) (DANGEROUS)
-x tristate device for hotswap (0/1) (DANGEROUS)
-X set IDE xfer mode (DANGEROUS)
-y put IDE drive in standby mode
-Y put IDE drive to sleep
-Z disable Seagate auto-powersaving mode
-z re-read partition table

ATA Security Options:
–security-freeze Freeze security settings (until next reset)
–security-unlock PWD Unlock drive, using password PWD (DANGEROUS)
–security-set-pass PWD Lock drive, using password PWD (DANGEROUS)
–security-disable PWD Disable drive locking, using password PWD (DANGEROUS)
–security-mode MODE Specify user/master password and high/maximum security
u user password, high security
U user password, maximum security
m master password, high security
M master password, maximum security

Hdparm Examples:-

#hdparm /dev/hda

/dev/sda:
readonly = 0 (off)
readahead = 120 (on)
geometry = 8850/255/63, sectors = 142182912, start = 0

Hard disk Performance Information

# hdparm -tT /dev/hda

/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

Hard drive set to low, slow settings:

# hdparm -cuda /dev/hda

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

If you want to know more options and how to use check hdparm man page

You can use this for ubuntu users also.

  • Share/Bookmark

Random Posts

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>