momo zone

调核人的blog

透过usb-sata转接器读取 S.M.A.R.T信息问题

搞了一个SATA转USB3.0,发现无法使用smartctl读取S.M.A.R.T信息
这里的问题是这类转换器准确的叫法是”SATA to USB mass storage bridge” ,接在上面的硬盘被称作”USB mass storage”,也就是说和U盘一样了,它是无法读取ATA/SATA SMART信息的。但一些厂家的bridge芯片动了些脑筋,制定了一些私有协议,smartmontool按照该私有协议封装SMART请求。然后bridge去解封再转换成ATA/SATA请求发给硬盘,这样就解决了这个问题。

google了一下发觉用smartctl -d sat -a /dev/sdx就ok。-d用来指示上述的私有协议类型。
这里sat指的是scsi to ata translation:

What is SAT?
SAT (SCSI->ATA Translation) is a mechanism whereby ATA task register commands may be sent
to a device which is seen by the operating system as a SCSI device. This is most often the case
when SATA drives are connected to an add-in PCI bus type of SATA controller card. Even though
the card is a SATA controller in most cases Windows will see the controller as if it were a SCSI
HBA, and so will not allow you to issue ATA task register level commands to the connected
devices.
Documentation on SAT can be found at the T10.org site http://www.t10.org/drafts.htm#sat3
In short, SAT uses a 12 or 16 byte SCSI cdb which contains an embedded ATA task register
command.

桥接芯片是JMS567,vid:pid 为152d:0567,给/usr/share/smartmontools/drivedb.h增加如下内容就可以直接使用smartctl了:
{ “USB: ; JMicron JMS567”, // USB->SATA(SATL)
“0x152d:0x0567”,
“”, // 0x0100
“”,
“-d sat”
},

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google photo

You are commenting using your Google account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

Connecting to %s

%d 博主赞过: