In this article we will describe some simple hard drive speed tests you can perform using your Linux system and command line tool hdparm. hdparm tool is an easy to use tool to quickly asses your hard drive's speed. When performing speed tests hdparm disregards files system currently in use as it writes to a raw device. The actual real read/write speed of your hard drive will be slightly slower and dependent on file system in use. In any case the hdparm should provide you with a solid overview of your hard drive's speed. In the examples below we will use /dev/sda as our testing block device.

First and most basic test is transfer speed test. Please note that all tests should be run multiple times and average time should be calculated to get more accurate result.
# hdparm -t /dev/sda

/dev/sda:
 Timing buffered disk reads: 104 MB in  3.04 seconds =  34.25 MB/sec

The next test you want to perform is data transfer rate but this time bypassing hard drive's buffer cache memory thus reading directly from the disk.
# hdparm -t --direct /dev/sda

/dev/sda:
 Timing O_DIRECT disk reads: 100 MB in  3.00 seconds =  33.31 MB/sec
In the next example we will instruct hdparm to read data from the second half of the disk that is if the hard drive size is 100GB.
hdparm --offset 50 -t /dev/sda
/dev/sda:
 Timing buffered disk reads (offset 50 GB):  72 MB in  3.05 seconds =  23.61 MB/sec
To obtain cached reads run the following command:
# hdparm --offset 50 -T /dev/sda

/dev/sda:
 Timing cached reads:   4484 MB in  2.00 seconds = 2246.69 MB/sec


Free Linux eBooks

Do you have the right skills?

Our IT Skills Watch page reflects an up to date IT skills demand leaning towards the Linux and Unix environment. We have considered a number of skills and operating systems.

See the result...

Linux Online Training

Learn to run Linux servers and prepare for LPI certification with Linux Academy. 104 available video lessons with PDF course notes with your own server!

Go to top