https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/persistent_naming.html
# /sbin/scsi_id -g -u -s /block/sdc ; for disks
# /sbin/scsi_id -g -u -s /class/scsi_tape/nst0 ; for tapes
Note: the above command ” -u -s /bock/sdc” : generates a unique id for the /block/sdc (/dev/sdc). The mount point must not be included. So, use /block/sdc, not /sys/block/sdc.
The scsi_id command issues a SCSI INQUIRY command to the device to access the vital product data (VPD) page 0×83 data, which contains, amongst other information, the device World Wide IDentifier (WWID). If page 0×83 does not exist on the device then page 0×80 data is used which contains the unit serial number. Because the unit serial number may not be unique across vendors, other information from the standard inquiry page are utilized to create a unique identifier.
The result of the scsi_id command (the long string of characters) is the unique identifier (WWID or serial number based) of the device that is currently mapped to /dev/sdc (/sys/block/sdc). This unique identifier will be the same for each path to the device and for each partition on the device. The unique identifier will not change if other devices are added to or removed from the system.
For RHEL6:
To get the WWID of /dev/sda,
# scsi_id --whitelisted --replace-whitespace --device=/dev/sda