How to check if an attached SSD device is SATA or PCIe on Linux?

10

3

I have a machine with both SATA and PCIe SSDs attached. Is there a set of Linux commands (on Ubuntu or CentOS) that I can use to check if a given SSD is SATA or PCIe?

Safdar Iqbal

Posted 2015-04-08T23:06:12.223

Reputation: 103

Answers

9

lsblk -io NAME,TYPE,SIZE,MOUNTPOINT,FSTYPE,MODEL

will identify all the block devices, i.e., drives. Then, run

sudo hdparm -I /dev/sd*X* | grep SATA 

where X is each drive letter found. If the result contains SATA, well, it's the SATA drive.

Alternatively,

lspci

will identify all the PCI devices, including PCIe.

Or, you can look for the NVMe logo on the drive.

K7AAY

Posted 2015-04-08T23:06:12.223

Reputation: 6 962

2I have a M2 drive that I'm pretty sure is using PCIe (it's in the M2 slot on the mobo), but it says SATA all over the place on the second command. I don't understand, I thought it was PCI. There's also a sata controller listed in the lspci – wordsforthewise – 2017-11-16T22:11:55.357

1Many M.2 SSDs simply have a SATA interface. This is most probaby the reason why your M.2 drive is displayed as a SATA device. M.2 SSDs with SATA interface are BTW not faster than regular SATA SSDs (I found out the hard way after I had bought an M.2 and thought it would be much faster than my regular SSD). – zepp.lee – 2018-09-28T11:22:14.157