您的位置:首页 > 产品设计 > UI/UE

Find unique identifier of the SCSI device - 查找scsi设备的wwid

2014-03-27 18:22 543 查看
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/persistent_naming.html

For RHEL 5:

# /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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐