WenJunjie Blog

sysadmin

Disk Tuning

| Comments

硬盘读取速度

# hdparm -cdt /dev/hdc    

/dev/hdc:
 IO_support   =  0 (default 16-bit)
 using_dma    =  0 (off)
 Timing buffered disk reads:   12 MB in  3.18 seconds =   3.77 MB/sec

# hdparm -d1 /dev/hdc

/dev/hdc:
 setting using_dma to 1 (on)
 HDIO_SET_DMA failed: Operation not permitted
 using_dma    =  0 (off)

  需要在系统bios设置STAT Mode  IDE->ACPI

# hdparm -c3 /dev/hdc

/dev/hdc:
 setting 32-bit IO_support flag to 1
 IO_support   =  1 (32-bit)

 -c 显示当前I/O设置
 -d 显示当前DMA设置

# hdparm -k 1 /dev/hdc  # 使设置生效

/dev/hdc:
 setting keep_settings to 1 (on)
 keepsettings =  1 (on)

 echo "/sbin/hdparm -c3 -d1 -k 1 /dev/hda" >> /etc/rc.d/rc.local 

# hdparm -i /dev/hdc

/dev/hdc:

 Model=ST3160815AS, FwRev=4.CCA, SerialNo=5RA53MZ6
 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
 BuffType=unknown, BuffSize=8192kB, MaxMultSect=16, MultSect=off
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455
 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 
 AdvancedPM=no WriteCache=enabled
 Drive conforms to: Unspecified:  ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5 ATA/ATAPI-6 ATA/ATAPI-7

 * signifies the current active mode

 # hdparm -cuda /dev/hdc

/dev/hdc:
 IO_support   =  1 (32-bit)
 unmaskirq    =  0 (off)
 using_dma    =  0 (off)
 readahead    = 256 (on)

 hdparm -I  /dev/hdc

/dev/hdc:

ATA device, with non-removable media
        Model Number:       ST3160815AS                             
        Serial Number:      5RA53MZ6
        Firmware Revision:  4.CCA   
Standards:
        Supported: 7 6 5 4 
        Likely used: 7
Configuration:
        Logical         max     current
        cylinders       16383   65535
        heads           16      1
        sectors/track   63      63
        --
        CHS current addressable sectors:    4128705
        LBA    user addressable sectors:  268435455
        LBA48  user addressable sectors:  312581808
        device size with M = 1024*1024:      152627 MBytes
        device size with M = 1000*1000:      160041 MBytes (160 GB)
Capabilities:
        LBA, IORDY(can be disabled)
        Queue depth: 32
        Standby timer values: spec'd by Standard, no device specific minimum
        R/W multiple sector transfer: Max = 16  Current = 16
        Recommended acoustic management value: 208, current value: 0
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 
             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
           *    DOWNLOAD_MICROCODE
                SET_MAX security extension
           *    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-Read-Verify feature set
           *    WRITE_UNCORRECTABLE command
           *    {READ,WRITE}_DMA_EXT_GPL commands
           *    Segmented DOWNLOAD_MICROCODE
           *    SATA-I signaling speed (1.5Gb/s)
           *    SATA-II signaling speed (3.0Gb/s)
           *    Native Command Queueing (NCQ)
           *    Phy event counters
           *    Software settings preservation
Security: 
        Master password revision code = 65534
                supported
        not     enabled
        not     locked
                frozen
        not     expired: security count
        not     supported: enhanced erase
Checksum: correct

 yum install sdparm
 # sdparm -p sn /dev/sda  #获取scsi序列号

 # hdparm -d1 -m16 -c3 /dev/hda

参考 * Howto: hdparm - linux disk tuning

Comments