LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Hardware (http://www.linuxquestions.org/questions/forumdisplay.php?f=18)
-   -   algorithm to get scsi id as page 0x83 (http://www.linuxquestions.org/questions/showthread.php?t=4175496427)

konstan 02-27-2014 09:49 AM

algorithm to get scsi id as page 0x83
 
What is the algorithm used to create page 0x83 SCSI id?

Code:

# scsi_id --whitelisted --page=0x83  --device=/dev/sdjj
3600a0980443175414a3f4443364d5638
#

that is used in the corresponding soft link /dev/disk/by-id/scsi-3600a0980443175414a3f4443364d5638 out of the disk type, vendor, model, serial etc. as in

Code:

# scsi_id -g -x /dev/sdjj
ID_SCSI=1
ID_VENDOR=NETAPP
ID_VENDOR_ENC=NETAPP\x20\x20
ID_MODEL=LUN_C-Mode
ID_MODEL_ENC=LUN\x20C-Mode\x20\x20\x20\x20\x20\x20
ID_REVISION=8200
ID_TYPE=disk
ID_SERIAL_RAW="3600a0980443175414a3f4443364d5638"
ID_SERIAL=3600a0980443175414a3f4443364d5638
ID_SERIAL_SHORT=600a0980443175414a3f4443364d5638
ID_WWN=0x600a098044317541
ID_WWN_VENDOR_EXTENSION=0x4a3f4443364d5638
ID_WWN_WITH_EXTENSION=0x600a0980443175414a3f4443364d5638
ID_SCSI_SERIAL=D1uAJ?DC6MV8
#
# scsi_id --whitelisted --page=0x80  --device=/dev/sdjj
SNETAPP  LUN C-Mode    D1uAJ?DC6MV8
#

I remember seeing a pseudo code somewhere on the web couple of month ago, but can no longer find it :( Thanks!

konstan 03-02-2014 02:57 PM

Looks like this is how it goes:

Code:

3600a098044316475463f444336434c6e serial (page 0x83 inquiry)
        44316475463f444336434c6e scsi serial (base64.b16encode('D1duF?DC6CLn').lower())
 600a098044316475 WWN
  00a098 OUI (NetApp)
3 scsi disk



All times are GMT -5. The time now is 01:14 AM.