linux – MegaCli:获取逻辑驱动器的/ dev / sd *设备名称

前端之家收集整理的这篇文章主要介绍了linux – MegaCli:获取逻辑驱动器的/ dev / sd *设备名称前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
假设我知道我想要的驱动器是适配器8,虚拟驱动器0,有没有办法获取 Linux设备名称(例如/ dev / sdt)?我在RHEL 6.2上.

-pdlist显示每个物理驱动器的WWN值,但这没有多大帮助. -ldinfo不打印WWN或任何其他标识值.

# ./MegaCli64 -pdlist -a8 | grep WWN
WWN: 500051610003776C
WWN: 5000516100037BFC
WWN: 5000516100038090
WWN: 50005161000284F4
WWN: 5000516100037C0C
WWN: 5000516100037C5C
WWN: 50005161000310C8
WWN: 5000516100037F4C

# ls -1dt /dev/disk/by-id/wwn*
/dev/disk/by-id/wwn-0x600605b0043e52d01721fd142c12c84d
/dev/disk/by-id/wwn-0x600605b0043e52d01721fd142c0973e6
/dev/disk/by-id/wwn-0x600605b0043e52d01721fd132c002573
/dev/disk/by-id/wwn-0x600605b0043e52d01721fd122bf6e2f6
/dev/disk/by-id/wwn-0x600605b0043e52d01721fd122beda52a
/dev/disk/by-id/wwn-0x600605b0043e52d01721fd112be46f10
/dev/disk/by-id/wwn-0x600605b0043e52d01721fd112bdb3ffb
/dev/disk/by-id/wwn-0x600605b0043e52d01721fd102bd20f14

# ./MegaCli64 -v                       
 MegaCLI SAS RAID Management Tool  Ver 8.03.08 Mar 15,2012

解决方法

您应该能够将-pdlist中的磁盘序列号与lshw的输出进行比较.
# MegaCLI -pdlist -a0 | grep "Inquiry Data:"
Inquiry Data:       XXXXXXXXXXXXHitachi YYYYYYYY                 ZZZZZZ
...

然后在lshw的输出搜索序列号.设备名称将位于逻辑名称字段中.

我无法验证这一点,因为我的所有磁盘都在卷中.

识别逻辑驱动器

将MegaCLI的Target Id与设备的scsi总线目标进行比较.在lshw中它是公共汽车信息.

# MegaCli -ldinfo -Lall -aall 


Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :
RAID Level          : Primary-6,Secondary-0,RAID Level Qualifier-3
Size                : 7.275 TB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 6
Span Depth          : 1
Default Cache Policy: WriteBack,ReadAhead,Direct,No Write Cache if Bad BBU
Current Cache Policy: WriteBack,No Write Cache if Bad BBU
Access Policy       : Read/Write
Disk Cache Policy   : Disabled
Ongoing Progresses:
  Check Consistency        : Completed 17%,Taken 89 min.
Encryption Type     : None


Virtual Drive: 1 (Target Id: 1)
Name                :
RAID Level          : Primary-6,Taken 89 min.
Encryption Type     : None

来自lshw:

# lshw -class disk
...
              *-enclosure UNCLAIMED
               description: SCSI Enclosure
               product: Bobcat
               vendor: LSI CORP
               physical id: 1.75.0
               bus info: scsi@0:1.117.0
               version: 0504
               configuration: ansiversion=5
          *-disk:0
               description: SCSI Disk
               product: MR9260-16i
               vendor: LSI
               physical id: 2.0.0
               bus info: scsi@0:2.0.0
               logical name: /dev/sda
               version: 2.12
               serial: svDASJ-f8kM-4qp5-BswW-3IKC-DDyA-djz8N7
               size: 7450GiB
               capacity: 7450GiB
               capabilities: lvm2
               configuration: ansiversion=5
          *-disk:1
               description: SCSI Disk
               product: MR9260-16i
               vendor: LSI
               physical id: 2.1.0
               bus info: scsi@0:2.1.0
               logical name: /dev/sdb
               version: 2.12
               serial: NHUvUy-1tm4-aGYW-g6DZ-t1Z9-gxW8-JhvFfL
               size: 7450GiB
               capacity: 7450GiB
               capabilities: lvm2
               configuration: ansiversion=5

猜你在找的Linux相关文章