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


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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值