So how do you find out how fast is your hard disk under Linux? Is it running at SATA I (150 MB/s) or SATA II (300 MB/s) speed w/o opening computer case or chassis?
You can use hdparm command. It provides a command line interface to various hard disk ioctls supported by the stock Linux ATA/IDE/SATA device driver subsystem. Some options may work correctly only with the latest kernels (make sure you have cutting edge kernel installed). I also recommend to compile hdparm with the include files from the latest kernel source code. It provides more accurate result.
Measure hard disk data transfer speed
Login as the root and enter the following command:
$ sudo hdparm -tT /dev/sda
OR
$ sudo hdparm -tT /dev/hda
Output:
/dev/sda: Timing cached reads: 7864 MB in 2.00 seconds = 3935.41 MB/sec Timing buffered disk reads: 204 MB in 3.00 seconds = 67.98 MB/sec
For meaningful results, this operation should be repeated 2-3 times on an otherwise inactive system (no other active processes) with at least a couple of megabytes of free memory. This displays the speed of reading directly from the Linux buffer cache without disk access. This measurement is essentially an indication of the throughput of the processor, cache, and memory of the system under test. Here is for loop to run test 3 time in a row:
for i in 1 2 3; do hdparm -tT /dev/hda; done
Where,
- -t :perform device read timings
- -T : perform cache read timings
- /dev/sda : Hard disk device file
To find out SATA hard disk speed, enter:
sudo hdparm -I /dev/sda | grep SATA
Output:
* SATA-I signaling speed (1.5Gb/s)
* SATA-II signaling speed (3.0Gb/s)
Above output indicate that my hard disk can use both 1.5Gb/s or 3.0Gb/s speed. Please note that your BIOS / Motherboard must have support for SATA-II.
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- 10 Greatest Open Source Software Of 2009
- My 10 UNIX Command Line Mistakes
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
- Email this to a friend
- Download PDF version
- Printable version
- Comment RSS feed
- Last Updated: Nov/6/2007



{ 12 comments… read them below or add one }
$ sudo hdparm /dev/sda (and following)should be
$ sudo hdparm -tT /dev/sda
to get the output you show and describe (At least on most distros).
thanks for the heads up!
I am trying to install linus n the machine having SATA Hard Drive .
Please let me know the URl or the site name where I will find these drivers
help me in finding SATA Hard Drive Drivers for Linux
Thanks for the tip, works great.
Excellent, very useful tip. Thanks a lot!
in serial ata,how fast datatrnsfer?how it is possible?what is the main difference between PATA & SATA.i want deatails about SATA harddisk communication to motherboard
how can i delete a partition througn a simple command
Shri3772 ,
You probably won’t be able to install ‘linus’ on your hard drive.
What about software RAID partitions?
I’d love to compare my RAID-5 versus a single drive!
hdparm -tT /dev/md0
for raid
How to check the driver version is being used by SATA?