免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2440 | 回复: 0
打印 上一主题 下一主题

[RAID与磁盘阵列] 通过设备名/dev/sdc找到LUN名称和阵列IP的方法 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-12-26 13:03 |只看该作者 |倒序浏览
没有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
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP