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
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
相关文章推荐
- Genymotion提示To find out the cause of the problem,start the virtual device from VirtualBox
- The Windows Driver Model Simplifies Management of Device Driver I/O Requests(WDM对设备驱动I/O请求管理的简化)
- Genymotion 运行Android虚拟机出现错误:Unable to staart the virtual device.To find out the cause of the problem
- The unique identifier of the win32 class is the class name
- The way it is connected with wristwatches connected with almost any bunch of Diesel-engined is unique
- org.hibernate.NonUniqueObjectException: a different object with the same identifier value was alread
- OPatch - Where Can I Find the Latest Version of OPatch
- ch4.6: find the LCA of 2 nodes in a binary tree with 3 different methods
- hdu 1595 find the longest of the shortest(spfa)(存储并枚举最短路径的边)
- org.hibernate.NonUniqueObjectException: a different object with the same identifier value was alread
- Using the HID class eases the job of writing USB device drivers
- HDU 1595 find the longest of the shortest
- give two sorted array, find the k-th smallest element of union of A and B
- 关于使用FileUpload控件报 Could not find a part of the path "X\1.jpg"
- hdu1595(spfa) find the longest of the shortest
- org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the sessio
- nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
- Spring 配置文件报错: cvc-elt.1: Cannot find the declaration of element ""beans""
- cannot find the definition (implementation) of this function 解决方法
- Could not load file or assembly 'App_Web_xxxx' or one of its dependencies. The system cannot find the file specified.