- 论坛徽章:
- 0
|
没有VMWARE,面对多厂家阵列,LUN和业务多了,容易犯错。前两天研究了设备名和阵列关系对应的办法,准备再写个脚本,大家看看有没有用。
一、如何查看设备名对应的LUN所在阵列IP:
1、先看看LUN支持哪些SCSI PAGE页功能,嘿嘿,支持的满多,不同的厂家可能有差别,部分页的作用还在研究中,找到0X85。
# sg_inq -p 0 /dev/sdd
Only hex output supported. sg_vpd decodes more pages.
VPD INQUIRY, page code=0x00:
[PQual=0 Peripheral device type: disk]
Supported VPD pages:
0x0 Supported VPD pages
0x80 Unit serial number
0x83 Device identification
0x85 Management network addresses
0x86 Extended INQUIRY data
0xb0 Block limits (sbc2)
0xb1 Block device characteristics (sbc3)
0xb2 Thin provisioning (sbc3)
0xc0 vendor: Firmware numbers (seagate); Unit path report (EMC)
0xc1 vendor: Date code (seagate)
0xc2 vendor: Jumper settings (seagate); Software version (RDAC)
0xc3 vendor: Device behavior (seagate)
0xc9 Volume Access Control (RDAC)
2、查看LUN所在阵列管理IP地址
# sg_inq -p 0x85 /dev/sdd
VPD INQUIRY: Management network addresses page
target device that contains addressed lu, Service type: storage configuration service
http://100.175.30.32
二、查看设备名对应的LUN名称。这个显示为HEX,看看大家有没有办法转换成TEXT。
# sg_inq -p 0xc8 -v /dev/sdc
Only hex output supported. sg_vpd decodes more pages.
VPD INQUIRY, page code=0xc8:
inquiry cdb: 12 01 c8 00 fc 00
inquiry: requested 252 bytes but got 176 bytes
00 00 c8 00 ac 65 64 69 64 01 03 00 10 60 0a 0b 80 ....edid....`...
10 00 17 62 73 00 00 26 d9 44 fe 5b fb 3c 4c 55 4e ..bs..&.D.[.<LUN 20 30 30 31 5f 30 30 31 00 00 00 00 00 00 00 00 00 001_001.........
30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
三、过滤boot msg,这个比较土一点;
sd 7:0:0:0: [sdc] 2147483648 512-byte logical blocks: (1.09 TB/1.00 TiB)
四、用lsscsi查看设备名与BDF |
|