How to: Linux check IDE / SATA hard disk transfer speed

by Vivek Gite · 12 comments

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:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 12 comments… read them below or add one }

1 Jonas 11.06.07 at 1:50 pm

$ 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).

2 vivek 11.06.07 at 2:25 pm

thanks for the heads up!

3 Shri3772 03.01.08 at 5:12 am

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

4 Shri3772 03.01.08 at 5:13 am

help me in finding SATA Hard Drive Drivers for Linux

5 nick 11.08.08 at 12:22 am

Thanks for the tip, works great.

6 Pablo 05.11.09 at 8:27 am

Excellent, very useful tip. Thanks a lot!

7 manolekshmi 07.24.09 at 9:31 am

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

8 santhanaraj.k 08.19.09 at 5:19 am

how can i delete a partition througn a simple command

9 adg 09.15.09 at 11:57 am

Shri3772 ,
You probably won’t be able to install ‘linus’ on your hard drive.

10 Markus Ewald 09.24.09 at 5:41 am

What about software RAID partitions?
I’d love to compare my RAID-5 versus a single drive!

11 andrius 09.25.09 at 7:44 am

hdparm -tT /dev/md0

for raid

12 sanjay 10.09.09 at 10:07 am

How to check the driver version is being used by SATA?

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post:

Next post: