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
本文介绍如何在Red Hat Enterprise Linux (RHEL) 5和6中使用scsi_id命令为SCSI设备生成唯一标识符(WWID),确保即使在系统变更后设备名称仍保持一致。对于RHEL5,可以通过特定命令获取磁盘和磁带设备的WWID;对于RHEL6,介绍了获取指定设备WWID的方法。
2497

被折叠的 条评论
为什么被折叠?



