Megaraid SAS Raid Controller

I have about half a dozen servers all running the Intel RS2BL080 raid controller on Oneiric server AMD64. It works fine using the megaraid_sas kernel module but when I try to use megacli to probe the card, it tells me that there are no raid controllers available.

Intel don't have Ubuntu as a supported OS, so they couldn't help me. After looking around, I have found referenced of this megaraid controller working fine for other people.

Just reaching out to anyone that might know what I am doing wrong.

$ megacli -adpCount


Controller Count: 0.

Exit Code: 0x00

$ megacli -v


  MegaCLI SAS RAID Management Tool  Ver 8.02.16 July 01, 2011

(c)Copyright 2011, LSI Corporation, All Rights Reserved.

Exit Code: 0x00

$ lspci -vv

09:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator] (rev 05)
        Subsystem: Intel Corporation RAID Controller RS2BL080
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 32 bytes
        Interrupt: pin A routed to IRQ 16
        Region 0: I/O ports at 3000 [size=256]
        Region 1: Memory at d8040000 (64-bit, non-prefetchable) [size=16K]
        Region 3: Memory at d8000000 (64-bit, non-prefetchable) [size=256K]
        [virtual] Expansion ROM at d8500000 [disabled] [size=256K]
        Capabilities: [50] Power Management version 3
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [68] Express (v2) Endpoint, MSI 00
                DevCap: MaxPayload 4096 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
                        ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset+
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+ FLReset-
                        MaxPayload 128 bytes, MaxReadReq 512 bytes
                DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
                LnkCap: Port #0, Speed 5GT/s, Width x8, ASPM L0s, Latency L0 <64ns, L1 <1us
                        ClockPM- Surprise- LLActRep- BwNot-
                LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 2.5GT/s, Width x8, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
                DevCap2: Completion Timeout: Range BC, TimeoutDis+
                DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-
                LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-, Selectable De-emphasis: -6dB
                         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
                         Compliance De-emphasis: -6dB
                LnkSta2: Current De-emphasis Level: -6dB
        Capabilities: [d0] Vital Product Data
                Unknown small resource type 00, will not decode more.
        Capabilities: [a8] MSI: Enable- Count=1/1 Maskable- 64bit+
                Address: 0000000000000000  Data: 0000
        Capabilities: [c0] MSI-X: Enable+ Count=15 Masked-
                Vector table: BAR=1 offset=00002000
                PBA: BAR=1 offset=00003800
        Capabilities: [100 v1] Advanced Error Reporting
                UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
                CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
                CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
                AERCap: First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
        Capabilities: [138 v1] Power Budgeting <?>
        Kernel driver in use: megaraid_sas
        Kernel modules: megaraid_sas

Solution 1:

Easy...

$ sudo setarch x86_64 --uname-2.6 /opt/MegaRAID/MegaCli/MegaCli64 -adpCount


Controller Count: 1.

Exit Code: 0x01

Solution 2:

MegaCli 8.02.16 and earlier do not understand uname 3.x.x [1]. This may be fixed later.

For now you need a workaround [2]:

$ mkdir fakeuname
$ cd fakeuname
$ wget http://supportex.net/files/fakeuname/fakeuname.c
$ gcc -Wall -fPIC -c fakeuname.c
$ gcc -Wall -shared -o libfakeuname.so fakeuname.o
$ sudo install -m 644 libfakeuname.so /opt/MegaRAID/MegaCli/
$ sudo -i
# cd /opt/MegaRAID/MegaCli/
# LD_PRELOAD=./libfakeuname.so ./MegaCli64 -adpCount


Controller Count: 1.

Exit Code: 0x01
  1. http://kb.lsi.com/KnowledgebaseArticle16624.aspx
  2. http://www1.opennet.ru/tips/2667_linux_kernel_version_ld_preload.shtml