Megaleecher.Net

Making technology work for you...

Get Your Free Subscription By Email:

Hdparm - Command Line Performance Tuning And Benchmarking Tool For SATA/IDE Hard-Disk Drives

hdparm is a powerful command-line utility for Linux and Windows operating systems to set and view ATA hard disk drive hardware parameters. The utility also allows users to test disk read/write performance with cached and buffered modes. The utility allows users to view and change SATA/IDE disk-drive hardware parameters like drive caches, sleep mode, power management, acoustic management, and DMA settings which are generally set to suboptimal conservative defaults to their optimal settings for best performance. Checkout the example output below for disk information command followed by disk performance test.

root@myserver:~#  hdparm -I /dev/sdc

/dev/sdc:

ATA device, with non-removable media
        Model Number:       WDC WD2002FYPS-02W3B0
        Serial Number:      WD-WCXXXXX64757
        Firmware Revision:  04.01G01
        Transport:          Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5,                  SATA Rev 2.6
Standards:
        Supported: 8 7 6 5
        Likely used: 8
Configuration:
        Logical         max     current
        cylinders       16383   16383
        heads           16      16
        sectors/track   63      63
        --
        CHS current addressable sectors:   16514064
        LBA    user addressable sectors:  268435455
        LBA48  user addressable sectors: 3907029168
        Logical/Physical Sector size:           512 bytes
        device size with M = 1024*1024:     1907729 MBytes
        device size with M = 1000*1000:     2000398 MBytes (2000 GB)
        cache/buffer size  = unknown
        Nominal Media Rotation Rate: 5400
Capabilities:
        LBA, IORDY(can be disabled)
        Queue depth: 32
        Standby timer values: spec'd by Standard, with device specific minimum
        R/W multiple sector transfer: Max = 16  Current = 0
        Advanced power management level: 128
        Recommended acoustic management value: 128, current value: 254
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4
             Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
        Enabled Supported:
           *    SMART feature set
                Security Mode feature set
           *    Power Management feature set
           *    Write cache
           *    Look-ahead
           *    Host Protected Area feature set
           *    WRITE_BUFFER command
           *    READ_BUFFER command
           *    NOP cmd
           *    DOWNLOAD_MICROCODE
           *    Advanced Power Management feature set
                Power-Up In Standby feature set
           *    SET_FEATURES required to spinup after power up
                SET_MAX security extension
           *    Automatic Acoustic Management feature set
           *    48-bit Address feature set
           *    Device Configuration Overlay feature set
           *    Mandatory FLUSH_CACHE
           *    FLUSH_CACHE_EXT
           *    SMART error logging
           *    SMART self-test
           *    General Purpose Logging feature set
           *    WRITE_{DMA|MULTIPLE}_FUA_EXT
           *    64-bit World wide name
           *    IDLE_IMMEDIATE with UNLOAD
           *    WRITE_UNCORRECTABLE_EXT command
           *    {READ,WRITE}_DMA_EXT_GPL commands
           *    Segmented DOWNLOAD_MICROCODE
           *    Gen1 signaling speed (1.5Gb/s)
           *    Gen2 signaling speed (3.0Gb/s)
           *    Native Command Queueing (NCQ)
           *    Phy event counters
           *    Idle-Unload when NCQ is active
           *    NCQ priority information
           *    DMA Setup Auto-Activate optimization
           *    Software settings preservation
           *    SMART Command Transport (SCT) feature set
           *    SCT Long Sector Access (AC1)
           *    SCT LBA Segment Access (AC2)
           *    SCT Error Recovery Control (AC3)
           *    SCT Features Control (AC4)
           *    SCT Data Tables (AC5)
                unknown 206[12] (vendor specific)
                unknown 206[13] (vendor specific)
Security:
        Master password revision code = 65534
                supported
        not     enabled
        not     locked
        not     frozen
        not     expired: security count
                supported: enhanced erase
        424min for SECURITY ERASE UNIT. 424min for ENHANCED SECURITY ERASE UNIT.                 
Logical Unit WWN Device Identifier: 50014ee25b269017
        NAA             : 5
        IEEE OUI        : 0014ee
        Unique ID       : 25b269017
Checksum: correct

root@myserver:~# hdparm -Tt /dev/sdc

/dev/sdc:
 Timing cached reads:   27130 MB in  2.00 seconds = 13583.27 MB/sec
 Timing buffered disk reads: 312 MB in  3.02 seconds = 103.42 MB/sec

How to install hdparm:

  • Linux - Use a package manager like Yum or apt-get to install, for example on Debian/Ubuntu with apt-get install hdparm. Source-code for compilation is available at - http://sourceforge.net/projects/hdparm/.
  • Windows - Check this and this.

Usage:

  • Read the manpage at - http://man7.org/linux/man-pages/man8/hdparm.8.html
  • Common examples (must use with root privileges and chnage /dev/sda with your disk drive location):
    • Get disk information hdparm -I /dev/sda.
    • Turn on DMA (this alone can result in double or triple data throughput) hdparm -d1 /dev/sda.
    • Test Disk Performance hdparm -Tt /dev/sdc.

Caution: Do note that hdparm is a powerful tool interacting directly with your hardware, it can crash a computer and make data corruption with misuse of certain parameters. Do read the manpage carefully.

Add new comment

This is just one of the many helpful tips we have posted, You can find more stories here,
Do subscribe to updates using your favorite RSS feed reader or using the secure FeedBurner email update form on top of this post.