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?
Asked
Active
Viewed 4.0k times
2 Answers
21
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.
davidparks21
- 1,632
- 1
- 19
- 29
K7AAY
- 9,725
3
Use lshw. It'll show disk type in the description field
$ sudo lshw -class disk
*-namespace
description: NVMe namespace
physical id: 1
logical name: /dev/nvme0n1
size: 1863GiB (2TB)
capabilities: partitioned partitioned:luks
configuration: logicalsectorsize=512 sectorsize=512
*-disk
description: ATA Disk
product: Samsung SSD 870
physical id: 0.0.0
bus info: scsi@5:0.0.0
logical name: /dev/sda
version: 2B6Q
serial: S6BANF0RC01234F
size: 3726GiB (4TB)
capabilities: gpt-1.00 partitioned partitioned:gpt
configuration: ansiversion=5 guid=976d3e6c-1be0-a242-b576-9dba0d929aa4 logicalsectorsize=512 sectorsize=512
phuclv
- 30,396
- 15
- 136
- 260