Any way to check SAS link speed from Linux?

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

llowrey

Active Member
Feb 26, 2018
170
142
43
Is there a way to query the SAS link speed from Linux? I've checked dmsg and all sorts of places in sysfs but can't find anything that indicates link speed.

I have LSI3008 HBAs, backplanes with LSI SAS3x36 expanders, and HGST He8 drives so I should be 12gbps across the board. I would like to verify that.
 

llowrey

Active Member
Feb 26, 2018
170
142
43
I use smartctl -x /dev/sdX | grep 'negotiated logical link rate:'
That worked. Thanks!

It doesn't appear to work for SATA drives, though.

I did subsequently find a much less convenient method which is to cat sysfs files like:

/sys/class/sas_phy/phy-7:0:14/negotiated_linkrate
 

Stephan

Well-Known Member
Apr 21, 2017
1,033
801
113
Germany
You need a recent lsiutil which supports 3008 chip. Run it, select device (1), (e) to enable expert mode menus, (68) to show port state summary:

Firmware Settings
-----------------
SAS WWID: 50060REDACTED
Multi-pathing: Disabled
SATA Native Command Queuing: Enabled
SATA Write Caching: Enabled
SATA Maximum Queue Depth: 32
SAS Max Queue Depth, Narrow: 0
SAS Max Queue Depth, Wide: 0
Device Missing Report Delay: 0 seconds
Device Missing I/O Delay: 0 seconds
Phy Parameters for Phynum: 0 1 2 3 4 5 6 7
Link Enabled: Yes Yes Yes Yes Yes Yes Yes Yes
Link Min Rate: 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5
Link Max Rate: 6.0 6.0 6.0 6.0 6.0 6.0 6.0 6.0
SSP Initiator Enabled: Yes Yes Yes Yes Yes Yes Yes Yes
SSP Target Enabled: No No No No No No No No
Port Configuration: Auto Auto Auto Auto Auto Auto Auto Auto
Interrupt Coalescing: Enabled, timeout is 10 us, depth is 4


Might need a different option for the expander itself.
 

Stephan

Well-Known Member
Apr 21, 2017
1,033
801
113
Germany
For stuff connected directly turns out you want (16) "Display attached devices". I am using lsiutil 1.72:

Type NumPhys PhyNum Handle PhyNum Handle Port Speed
Adapter 8 1 0002 --> 0 000a 1 6.0