MegaCli and Linux /dev/sd*

Stephen Dowdy sdowdy at ucar.edu
Tue May 5 11:53:02 CDT 2009


Tom Limoncelli wrote, On 05/05/2009 09:19 AM:
> Does anyone know how /dev/sd? relates to the output in MegaCLI when
> using a PERC card?
> 
> Here's an example.  /dev/sde fails.  I want to look up the serial
> number of the disk so that a remote tech knows they are replacing the
> correct disk.  If I do "MegaCli -PDList -aALL" I can see all the
> serial numbers but I'm not 100% sure which slot is /dev/sde because
> the PERC card adds a layer of redirection.

Tom,

I don't have a simple solution for the "map linux device to list of
virtual disks off PERC".

If you trust non-source binaries (LSI proprietary object blob):

http://sourceforge.net/projects/megactl/

contains the program 'megasasctl' (for PERC5/6) and 'megactl' (for
PERC3/4) which can get you the info you need:


This command shows the very verbose SMART selftest log page data for
all the disks on adapter 2.  That includes the Serial Number and
selftest instances.  The headings indicate all the Virtual Disks
on the controller and the exact array mapping of the devices on
each VD.  Any device that has failed is tagged with a "*" and in
the per drive listing below will show "failed" instead of online
(possibly "ready" or "offline" if the controller has been rebooted
and forgotten about the drive, which seems to happen with the
LSI PERC controllers after a rebuild/reboot cycle) It may also
appear to show up at all if the controller board on the disk has
failed completely. (in which case you have to extract the drive
physically).

[root MegaRAID]# ./megasasctl -svv a2
a2       PERC 5/E Adapter         bios:MT28-9 fw:1.03.50-0461 encl:4 ldrv:5  rbld:75% mem:256MiB batt:good/4020mV/37C
a2d0        4TiB RAID 5   1x14 optimal
       row  0:  a2e0s0    a2e0s1    a2e0s2    a2e0s3    a2e0s4    a2e0s5    a2e0s6    a2e0s7    a2e0s8    a2e0s9    a2e0s10   a2e0s11   a2e0s12   a2e0s13
a2d1        4TiB RAID 5   1x14 optimal
       row  0:  a2e0s0    a2e0s1    a2e0s2    a2e0s3    a2e0s4    a2e0s5    a2e0s6    a2e0s7    a2e0s8    a2e0s9    a2e0s10   a2e0s11   a2e0s12   a2e0s13
a2d2        8TiB RAID 5   1x14 optimal
       row  0:  a2e16s0   a2e16s1   a2e16s2   a2e16s3   a2e16s4   a2e16s5   a2e16s6   a2e16s7   a2e16s8   a2e16s9   a2e16s10  a2e16s11  a2e16s12  a2e16s13
a2d3        8TiB RAID 5   1x14 optimal
       row  0:  a2e17s0   a2e17s1   a2e17s2   a2e17s3   a2e17s4   a2e17s5   a2e17s6   a2e17s7   a2e17s8   a2e17s9   a2e17s10  a2e17s11  a2e17s12  a2e17s13
a2d4        8TiB RAID 5   1x14 optimal
       row  0:  a2e18s0   a2e18s1   a2e18s2   a2e18s3   a2e18s4   a2e18s5   a2e18s6   a2e18s7   a2e18s8   a2e18s9   a2e18s10  a2e18s11  a2e18s12  a2e18s13
hot spares   :  a2e0s14   a2e16s14  a2e17s14  a2e18s14
a2e0s0        ATA ST3750640NS      rev:3BKS s/n:SNRemoved               698GiB  a2d0+ online
     0: timestamp  274d08h:    bg long aborted via send diagnostic    seg:0 lba:28020366639104 sk:11 asc:64 ascq:1 vs:0
     1: timestamp   86d07h:    bg long completed without error        seg:0 lba:6378026434560 sk:0 asc:0 ascq:0 vs:0
a2e0s1        ATA ST3750640NS      rev:3BKS s/n:SNRemoved               698GiB  a2d0+ online
     0: timestamp  274d08h:    bg long aborted via send diagnostic    seg:0 lba:27990301868032 sk:11 asc:64 ascq:1 vs:0
...

devices can be:

   a{A}   Adapter number A
   a{A}d{D}   Adapter number A, virtual disk D
   a{A}e{E}   Adapter A, Enclosure E
   a{A}e{E}s{S}  Adapter A, Enclosure E, Slot S

So, you can do something like:

megasasctl -svv a2e0s0

to just get info on that singular drive, or

megasasctl -svv a2e0

to just get info on that enclosure's drives

(but it doesn't do a2d2 virtual disk :-( )


FWIW,
Attached is a script to obtain the Dell Service Tags
for PowerVault MD1000 and PV22x enclosures if you have
the SG3 Utils package installed)  (that's usually
needed on a service call for a disk replacement)
(this works if you don't have or want OMSA installed)

[root MegaRAID]# ./dell_svctags
/dev/sg3 : Vendor=DELL ; Product=MD1000 ; Svctag=SvcTagRemoved
/dev/sg6 : Vendor=DELL ; Product=MD1000 ; Svctag=SvcTagRemoved
/dev/sg7 : Vendor=DELL ; Product=MD1000 ; Svctag=SvcTagRemoved
/dev/sg8 : Vendor=DELL ; Product=MD1000 ; Svctag=SvcTagRemoved
/dev/sg9 : Vendor=DELL ; Product=MD1000 ; Svctag=SvcTagRemoved

you can use 'sg_map -i' to get scsi-generic to linux sd device
mappings, but that's not quite enough to get you down to the
PERC level.

--------------------------------------------
Also enclosed is an info glomming tool to take the excessively
verbose "megacli" output and reduce it to a compact format.
It would be great if LSI could give us a tool with a useful
output, but megarc and megacli suck and aren't very parseable.
(and keep changing output formats).

e.g.
[root MegaRAID]# ./megacli-overview 1
[Adapter 1]
PD[16:0]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:1]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:2]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:3]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:4]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:5]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:6]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:7]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:8]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:9]=(ATA/ST3750330NS/MA07/SNremoved) ME=0,OE=0,PF=0,FW=Hotspare,F=None
PD[16:9]=(ATA/ST3750330NS/MA07/SNremoved) ME=0,OE=0,PF=0,FW=Hotspare,F=None
PD[16:10]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:11]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:12]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:13]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:14]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
PD[16:14]=(ATA/ST3750640NS/3BKS/SNremoved) ME=0,OE=0,PF=0,FW=Online,F=None
VD[1:0]=(DATA12,R(5,0,3),4646720MB,#14,Optimal)
VD[1:1]=(DATA13,R(5,0,3),4646720MB,#14,Optimal)
PD[enclosure:slot] = Physical disk record
   (ATA/Disk-Model/FirmwareRev/Serial-Number)
   ME= Media Error count
   OE= Other Error count
   PF= Predictive Failure
   FW= Firmware State
   F= Foreign Configuration state
VD[adapter:vd-number] = Virtual Disk info
   (Label,RaidType,size, #disks, state)

Yeah, there's a bug where some records are duplicated, i haven't
fixed...


--stephen
-- 
Stephen Dowdy  -  Systems Administrator  -  NCAR/RAL
303.497.2869   -  sdowdy at ucar.edu        -  http://www.ral.ucar.edu/~sdowdy/

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dell_svctags
Url: http://lists.us.dell.com/pipermail/linux-poweredge/attachments/20090505/4c679f11/attachment-0002.bat 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: megacli-overview
Url: http://lists.us.dell.com/pipermail/linux-poweredge/attachments/20090505/4c679f11/attachment-0003.bat 


More information about the Linux-PowerEdge mailing list