#788700 lsscsi truncates the human readable device name

Package:
lsscsi
Source:
lsscsi
Description:
list all SCSI devices (or hosts) currently on system
Submitter:
Russell Coker
Date:
2015-06-27 00:12:13 UTC
Severity:
normal
#788700#5
Date:
2015-06-14 12:05:40 UTC
From:
To:
# lsscsi
[0:0:0:0]    disk    ATA      HITACHI HTS72323 B70B  /dev/sda
# cat ./sda/device/vpd_pg83
      E3834563JNUVKNDATA     HITACHI HTS723232A7A364                       E3834563JNUVKP̦
#

The above shows the way the "HITACHI HTS723232A7A364" disk in my laptop is
truncated to "HITACHI HTS72323" by lsscsi.  It even does this when the terminal
window is significantly wider than 80 columns (so there's no line wrap issue).

The problem with this is that if you buy a bunch of disks from the same
manufacturer at the same time then lsscsi will truncate their names to all
be the same.  This makes lsscsi unusable for identifying the failing disk
from a RAID array that needs to be replaced and also causes problems when ZFS
uses full SCSI device names to identify disks instead of names like sda3
(this is possibly a bug in ZFS and a configuration issue - but lsscsi should
help the sysadmin work around bugs in other parts of the storage stack).

#788700#10
Date:
2015-06-27 00:10:53 UTC
From:
To:
Hi Russell,

Thanks for the report, here's what upstream has to say.
------- Forwarded Message Matt, There is no fix that I can see! The ATA field that is getting truncated is longer than the corresponding SCSI field (INQUIRY command response "product identification" field which is 16 bytes long). In this case the "HITACHI HTS72323" entry is 16 bytes long and has been truncated (to the right) as defined by the SAT and SPC-4 standards. lsscsi lists SCSI devices and the "1 line per device" output to carefully tweaked to align vertically and not spill too far to the right. And extra information is appended to the lines with some options (e.g. 'lsscsi -s'). lsscsi does sysfs data-mining and does not issue SCSI commands. This allows normal users to execute lsscsi. The VPD information (page 0x83 as shown in the bug report) only became available in sysfs around lk 3.15 (and its in binary!). Page 0x83 is the device identification VPD page which has flexible field lengths and the capability of providing a lot more information (e.g. WWID and various other unique identifiers). Only some of the information that page provides is mandatory (according to modern standards (SPC-4)). Thoughts? Better documentation (man page)? Doug Gilbert
------- End of Forwarded Message I agree with Doug this should at least be documented, so leaving this bug open until that is solved. Thanks,