Due to always working on Linux, I’d like share some disk testing tools, by which, you can handle your disk very well.
How can I know disk performance?
There are two ways you can know your disk read/write performance. One is low level read/write big file (e.g. 2G) by using dd tool, the other is using hdparm command.
// write a 2G file
# date; dd if=/dev/zero of=/tmp/tmpfile bs=1024 count=2048000; date
// Read a 2G file
# date; dd if=/tmp/tmpfile of=/dev/null bs=1024 count=2048000; date
# hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 1102 MB in 2.00 seconds = 550.90 MB/sec
Timing buffered disk reads: 208 MB in 3.03 seconds = 68.74 MB/sec
How can I get hard disk parameters?
You can use hdparm command by following -iI options. We will care about which DMA we were used. If the DMA is not what we expected, we can use -X option to change it.
# hdparm -iI /dev/sda
How can I monitor hard disk at back end?
Most of ATA-3 and later ATA, IDE and SCSI-3 have build-in SMART system, which is to monitor the reliability of the hard drive and predict drive failures, and to carry out different types of drive self-tests. “smartctl” is a command line utility to perform SMART self-test and can send email alert if error happened.
// run overall-health self-assessment tests
# smartctl -d ata -H /dev/sda
martctl version 5.37 [i386-redhat-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
// read more data from hard disk
#smartctl -d ata -a /dev/sda
smartctl version 5.37 [i386-redhat-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda 7200.9 family
Device Model: ST3160812A
Serial Number: 5LS8E2F2
Firmware Version: 3.AAJ
User Capacity: 160,041,885,696 bytes
Device is: In smartctl database [for details use: -P show]
ATA Version is: 7
ATA Standard is: Exact ATA specification draft version not indicated
Local Time is: Mon Dec 24 10:54:28 2007 PST
SMART support is: Available – device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
… …
How can I know the temperature of hard disk?
We need a command utility named “hddtemp“.
# yum -y install hddtemp
Then, we can simply know the temperature of hard disk by typing
# hddtemp /dev/sda
/dev/sda: ST3160812A: 33°C
Tags: How-to, Linux by hengdu
No Comments »