How do I find out my SATA link speed? How do I make sure my sata hard disk is working at 6Gbps speed and how do I verify this under Linux server running on HP hardware?
You need to go through the dmesg command output or a log file called /var/log/messages as follows:
dmesg | grep -i sata | grep 'link up'
Sample outputs:
[ 18.120000] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300) [ 39.530000] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
You can find same info using /var/log/messages:
# grep -i SATA /var/log/messages | grep --color -i 'link up'
Sample outputs:
Sep 2 14:56:50 wks01 kernel: [25518.962661] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300) Sep 2 14:56:50 wks01 kernel: [25520.158303] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) Sep 2 14:56:50 wks01 kernel: [25521.117722] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300) Sep 2 22:09:06 wks01 kernel: [ 3.451270] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) Sep 2 22:09:06 wks01 kernel: [ 3.823019] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300) Sep 2 22:09:06 wks01 kernel: [ 4.154815] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300) Sep 3 04:14:11 wks01 kernel: [ 3.486897] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) Sep 3 04:14:11 wks01 kernel: [ 3.858745] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300) Sep 3 04:14:11 wks01 kernel: [ 4.186682] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300) Sep 3 09:17:10 wks01 kernel: [ 3.538938] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) Sep 3 09:17:10 wks01 kernel: [ 3.906824] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300) Sep 3 09:17:10 wks01 kernel: [ 4.234739] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300) Sep 4 04:13:33 wks01 kernel: [ 3.510810] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) Sep 4 04:13:33 wks01 kernel: [ 3.878764] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300) Sep 4 04:13:33 wks01 kernel: [ 4.206646] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 9 comments… read them below or add one }
Hi,
How to know speed of my external usb HDD is there any specific command?
thanks
Ashwani the most reliable method is to copy a big file say 4GB or so.
From your system to external HDD and check iostat.
However, your internal HDD should be fast enough and system shouldn’t be loaded.
I trust this method :)
Interesting, but then, I would like to know more:
- How to you toggle to higher bit rate when/if possible?
- How do you link these message to your drives? For instance, you have here “ata3″ link, how does this links to any /dev/sd.. ?
TIA,
– P
You need to pass boot time kernel parameters using grub. Search libata.force using this doc. Example to force 1.5G and 3.0G: libata.force=1:3.0G,2:1.5G
You need to go through /sys/class/ata_link. Search for sata_spd file. Use lsscsi command to map ids.
Also
Thanks Vivek.
By the way, on my Debian squeeze 6.0.5, /sys/class does not contain /ata_link but it contains:
I tried to find clues, such as in /sys/class/scsi_device/2\:0\:0\:0/device/, but then I cannot make a link to ata3 or alikes. No sata_spd found yet.
I have used lsscsi, either, and I have just watched your video and your lsscsi topic.
I am still unable to link “ata3″ to an exact drive, “dmesg|grep” commands didn’t tell much, but thanks to you, I learned some new stuff. :-))
– Philippe
Philippe,
Commands discussed here depends upon your bios, hd firmware, motherboard and kernel driver. You need libata driver loaded. Linux ship with various ata driver located in /lib/modules/$(uname -r)/kernel/drivers/ata. Linux will load the correct driver at boot time as per your hardware. The examples output is taken from kernel v3.2.0 running on Debian Linux 6.0.5. For testing purpose try loading backported kernel v3.2.0.
HTH
Thanks again.
FYI, on my plain debian 6.0.5, Linux uses following modules tree:
ata_generic => libata => scsi_mod
So kernel v3.2.0 does not seem mandatory for libata
Linux runs on a Thinkpad T400 laptop (exact model 64741AG).
–P
To measure the actual speed of an external USB disk:
I use dd command from dev/null to a file on that USB disk, using block size parameter set to 1MB, and count set to 1000. This creates a 1 GB file, so averages disk speed, and eliminates buffering.
The above is for write speed
from a 1 GB file on the USB disk to /dev/null, you can test read speed
Hi Guys,
My SATA link shows 1.5 GB
[ 1.204017] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
However when I check the read write speed I get
/dev/sda1:
Timing cached reads: 412 MB in 2.01 seconds = 205.47 MB/sec
Timing buffered disk reads: 166 MB in 3.03 seconds = 54.80 MB/sec
And when I copy a file over a 1 Gbps network connection I get around 30 to 40 mbps. What could be the bottle neck as I believe the network file transfer speeds should be able to reach over 105-110 Mbps.