2013-10-09

Linux 下用 haparm 測試硬碟效能

Linux 下用 haparm 測試硬碟效能


hdparm -d0 /dev/sda1

/dev/sda1:
 setting using_dma to 0 (off)

/etc/rc.d/rc.local 最後面加上一行 /sbin/hdparm -d1 -c3 -m16 /dev/hda 這樣每次開機後,硬碟的 DMA 就會開啟,不必每次手動設定。

hdparm -d0 /dev/sda1

/dev/sda1:
 setting using_dma to 1 (on)

hdparm -tT /dev/sda1

/dev/sda1:
 Timing cached reads:   4778 MB in  2.00 seconds = 2392.92 MB/sec
 Timing buffered disk reads:  100 MB in  0.74 seconds = 135.26 MB/sec

如果出現 HDIO_SET_DMA failed: Inappropriate ioctl for device,下載  hdparm

# tar -zxvf hdparm-9.9.tar.gz
# cd hdparm-9.9
# make
# make install