1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 20:25:38 +03:00
systemd/extras/scsi_id
David Zeuthen 4e9fdfccbd scsi_id: Export WWN and Unit Serial Number
Since the Unit Serial Number and the WWN are useful bits of
information export them as properties in the udev database. These
bits of information are often printed on the physical disk, see

http://people.freedesktop.org/~david/FUJITSU-MAY2036RC-sas-disk-picture.jpg

and displaying them separately in the UI (or in /dev/disk) might help
users identify the physical disk. This patch exports these bits of
information as ID_WWN and ID_SCSI_SERIAL.

Note that ata_id also use the ID_WWN property since commit
66094a4a7f (2009-11-04).

Also print out ID_SCSI=1 so users of the udev database knows the disk
speaks SCSI.

Here's the scsi_id output from one of my SAS disks with these changes:

 ID_SCSI=1
 ID_VENDOR=FUJITSU
 ID_VENDOR_ENC=FUJITSU\x20
 ID_MODEL=MAY2036RC
 ID_MODEL_ENC=MAY2036RC\x20\x20\x20\x20\x20\x20\x20
 ID_REVISION=0103
 ID_TYPE=disk
 ID_SERIAL=3500000e01b83f520
 ID_SERIAL_SHORT=500000e01b83f520
 ID_WWN=0x500000e01b83f520
 ID_SCSI_SERIAL=B3G1P8500RWT

Unfortunately we can't overload ID_SERIAL for two reasons

 1. ID_SERIAL (and ID_SERIAL_SHORT) exported by scsi_id isn't really
    the unit serial number (as defined by SCSI) - it is sometimes the
    WWN (since it is more unique than the Unit Serial Number) and
    complex rules (to make the serial unique) govern what value to
    use.

 2. It would break existing setups if the value of ID_SERIAL changed

Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-11-23 21:38:21 +01:00
..
.gitignore extras: ignore built and generated files 2007-11-08 00:13:40 +01:00
README scsi_id: remove dead files 2006-01-28 16:42:49 +01:00
scsi_id.8 scsi_id: delete no longer needed config file 2009-06-28 03:01:31 +02:00
scsi_id.c scsi_id: Export WWN and Unit Serial Number 2009-11-23 21:38:21 +01:00
scsi_id.config correct typo in extras/scsi_id/scsi_id.conf 2007-01-21 15:51:28 +01:00
scsi_id.h scsi_id: Export WWN and Unit Serial Number 2009-11-23 21:38:21 +01:00
scsi_serial.c scsi_id: Export WWN and Unit Serial Number 2009-11-23 21:38:21 +01:00
scsi.h scsi_id: remove dead files 2006-01-28 16:42:49 +01:00

scsi_id - generate a SCSI unique identifier for a given SCSI device

Please send questions, comments or patches to <patmans@us.ibm.com> or
<linux-hotplug-devel@lists.sourceforge.net>.