I don't think there's any absolutely certain way to detect an SSHD, but if the drive is known to smartctl
, you can use smartctl -P show
.
e.g.
$ sudo smartctl -P show /dev/sda
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.6-2.dmz.2-liquorix-amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
Drive found in smartmontools Database. Drive identity strings:
MODEL: ST4000DX001-1CE168
FIRMWARE: CC44
match smartmontools Drive Database entry:
MODEL REGEXP: ST[124]000DX001-.*
FIRMWARE REGEXP: .*
MODEL FAMILY: Seagate Desktop SSHD
ATTRIBUTE OPTIONS: 188 Command_Timeout
240 Head_Flying_Hours
grep that for ^MODEL FAMILY:.*SSHD
smartctl
knows about (at least some of) the Seagate SSHDs, but not the Western Digital WD10J31X
(a 1TB laptop SSHD with 8GB cache), and probably others.
$ grep -i sshd /var/lib/smartmontools/drivedb/drivedb.h
{ "Seagate Laptop SSHD", // tested with ST500LM000-1EJ162/SM11
{ "Seagate Desktop SSHD", // tested with ST2000DX001-1CM164/CC43
if you have an SSHD that smartctl
doesn't know about, please submit a bug-report or patch.
Another thing that occurs to me is that most (all?) HDDs only support SATA2 transfer speeds, because 3.0Gbps is far more than they're capable of anyway.
So if you've determined that a drive is an HDD, you can then do something like hdparm -I /dev/XXX | grep -E 'Gen3 signaling speed|6.0Gb/s)'
to see if it's an SSHD.
e.g. on my system with a mix of WD, ST, and OCZ HDDs, SSHDs and SSDs:
$ list_disks
sda ST4000DX001-1CE168_Z303PTHA
sdb ST4000DX001-1CE168_Z303PSH6
sdc ST4000DX001-1CE168_Z302ZSGB
sdd ST4000DX001-1CE168_Z303PVZ9
sde WDC_WD10EACS-00ZJB0_WD-WCASJ2114122
sdf WDC_WD10EACS-00ZJB0_WD-WCASJ2195141
sdg WDC_WD10EARS-00Y5B1_WD-WMAV50933036
sdh ST31000528AS_9VP18CCV
sdi OCZ-VECTOR_OCZ-8RL5XW08536INH7R
sdj OCZ-VECTOR_OCZ-0974C023I4P2G1B8
$ for i in /dev/sd? ; do echo -n "$i: " ; sudo hdparm -I "$i" |
grep -E 'Gen3 signaling speed|6.0Gb/s)' || echo ; done
/dev/sda: * Gen3 signaling speed (6.0Gb/s)
/dev/sdb: * Gen3 signaling speed (6.0Gb/s)
/dev/sdc: * Gen3 signaling speed (6.0Gb/s)
/dev/sdd: * Gen3 signaling speed (6.0Gb/s)
/dev/sde:
/dev/sdf:
/dev/sdg:
/dev/sdh:
/dev/sdi: * Gen3 signaling speed (6.0Gb/s)
/dev/sdj: * Gen3 signaling speed (6.0Gb/s)
The SSHDs and the SSD report Gen3, the HDDs don't.
I'm not sure this is 100% reliable...my HDDs are a bit dated, newer HDDs might use Gen3 anyway, just so the manufacturers can standardise on a single interface chip/board.