Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Let's say I know the drive I want is on Adapter 8, Virtual Drive 0, is there a way to get the Linux device name (e.g. /dev/sdt)? I am on RHEL 6.2.

-pdlist displays a WWN value for each physical drive, but that doesn't help much. -ldinfo doesn't print a WWN or any other identifying value.

# ./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
share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

You should be able to compare the disk serial number from -pdlist with the output from lshw.

# MegaCLI -pdlist -a0 | grep "Inquiry Data:"
Inquiry Data:       XXXXXXXXXXXXHitachi YYYYYYYY                 ZZZZZZ
...

Then search the output of lshw for the serial number. The device name will be in the logical name field.

I can't verify this because all of my disks are in a volume.

Identifying Logical Drives

Compare the Target Id from MegaCLI with the scsi bus target for the device. In lshw it is bus info.

# 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, ReadAhead, Direct, 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, 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, ReadAhead, Direct, 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

From lshw:

# lshw
...
              *-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
share|improve this answer
    
I just tried this, but I have IBM drives and for me it looks like there's no correlation between the serial number that shows up in -pdlist and the serial number that shows up lshw. Thanks for the tip though. –  twblamer Apr 19 '12 at 16:05
    
It may be that your controller card is not exposing the real serial number and makes a volume serial number for each disk. –  Jeff Strunk Apr 19 '12 at 16:09
    
I should add this is a JBOD setup with each drive configured in a RAID0 array of one drive. So I would expect the physical drive's serial number to be hidden, but I'm wondering if I can get some info out of the logical drive config. –  twblamer Apr 19 '12 at 16:25
    
I just checked a bunch of MegaCLI options, but I couldn't find any logical drive serial numbers. –  Jeff Strunk Apr 19 '12 at 16:28
1  
Looks like JBOD is disabled on the adapter by default, but I can enable it: ./MegaCli64 -AdpSetProp -EnableJBOD 1 -a0 –  twblamer May 2 '12 at 20:23
show 2 more comments

There is an alternate tool called lsiutil that has been discontinued. If it works for your card, it may be easier to use: http://www.lsi.com/downloads/Public/Obsolete/Obsolete%20Common%20Files/LSIUtil_1.62.zip

Once you select your controller card, option 42 is supposed to display the OS names. I use this on Solaris, and the disks are in real JBOD mode instead of a bunch of single disk RAID 0 logical drives.

share|improve this answer
    
I downloaded that zip and it doesn't look like it works for my card+OS, unfortunately. Seems like I might be stuck. –  twblamer Apr 19 '12 at 17:07
add comment

I have been dealing with this across a number of new servers recently and I've come up with a solution that at least works for us. We are not using RAID on the card, just treating the drives as JBOD. They are all SAS drives. The /dev/disk/by-id mappings appear to be off-by-one from the SAS Address. This seems bizarre, but it works across 10 servers I've tested on.

https://github.com/chicks-net/megamap is a short Perl script that implements the discovery above. It produces a map of Linux drive sd* to megaRaid drive ID and also displays the WWN from Linux.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.