Why Does a Lun World Wide ID Starts with the Number 3 in Linux dm-multipath

Question: Why Does a Lun World Wide ID Starts with the Number 3?

When mapping a lun to the server with wwid -> 640xxxxxxxxxxxxxxxxxxxxxx, but from the `multipath -ll`, all wwid begin with 3 like 3640xxxxxxxxxxxxxxxxxxxxxx.

# multipath -ll

3640xxxxxxxxxxxxxxxxxxxxxx dm-27 HUAWEI,XSG1
size=400G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 14:0:0:28 sdbg 67:160 active ready running
|- 16:0:0:28 sdge 131:160 active ready running
|- 14:0:1:28 sdds 71:160 active ready running
`- 16:0:1:28 sdiq 135:160 active ready running

3640xxxxxxxxxxxxxxxxxxxxxx dm-95
size=88G features='1 queue_if_no_path' hwhandler='0' wp=rw
3640xxxxxxxxxxxxxxxxxxxxxx dm-74 HUAWEI,XSG1
size=200G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 14:0:0:75 sdkl 66:400 active ready running
|- 16:0:0:75 sdlj 68:272 active ready running
|- 14:0:1:75 sdkx 67:336 active ready running
`- 16:0:1:75 sdlv 68:464 active ready running

This issue has been explained in the man page of scsi_id:

– scsi_id queries a SCSI device via the SCSI INQUIRY vital product data (VPD) page 0x80 or 0x83 and uses the resulting data to generate a value that is unique across all SCSI devices that properly support page 0x80 or page 0x83.
– If a result is generated it is sent to standard output, and the program exits with a zero value. If no identifier is output, the program exits with a non-zero value.
– scsi_id is primarily for use by other utilities such as udev that require a unique SCSI identifier.
– By default all devices are assumed blacklisted, the –whitelisted option must be specified on the command line or in the config file for any useful behavior.
– SCSI commands are sent directly to the device via the SG_IO ioctl interface.
– In order to generate unique values for either page 0x80 or page 0x83, the serial numbers or worldwide names are prefixed as follows.

Identifiers based on page 0x80 are prefixed by the character ‘S’, the SCSI vendor, the SCSI product (model) and then the the serial number returned by page 0x80. For example:

# /lib/udev/scsi_id --page=0x80 --whitelisted --device=/dev/sda
SIBM 3542 1T05078453

Identifiers based on page 0x83 are prefixed by the identifier type followed by the page 0x83 identifier. For example, a device with a NAA (Name Address Authority) type of 3 (also in this case the page 0x83 identifier starts with the NAA value of 6):

# /lib/udev/scsi_id --page=0x83 --whitelisted --device=/dev/sda
3600a0b80000b174b000000d63efc5c8c
Related Post