MegaCLI is a pain… a real pain. I’m not a fan of the syntax, it’s not easily readable, did I say it was a pain?

Well, our OCP Knox Units are connected via the LSI MEGARAID SAS 9286CV-8E (SGL) controller, so I’ve been using MegaCLI quite a bit lately. Here is a collection of my working examples:

List All Devices

Create raid 1 volume with disk 0 and 1

Create raid 5 volume with disk 0-14

Create individual raid 0 volumes on drives 2-14

List  all volumes

Create raid 50 volume

Bring physical drive 14 online

Show physical drive status

Enable JBOD support – this is necessary for vSphere vSAN technology

Set global hot spare

Delete all volumes

Clear foreign configs

List drive state

Enable drive location LED

The following two tabs change content below.

Eric Sarakaitis

Virtualization Engineer at CBTS
I'm Eric, I love to cook, sing, garden and enjoy cold beverages!

13 Comments

  1. […] MegaCLI working examples cheat sheet […]

  2. aventaler says:

    I was wondering if you can Help me…

    I am tryingto change CCscheduler starttime… but something goes wrong.

    c:Program Files (x86)MegaRAID Storage ManagerMegaCLI>MegaCli -AdpCcSched -inf
    o -aAll

    No more interfaces
    Adapter #0

    Operation Mode: Concurrent
    Execution Delay: 10
    Next start time: 01/13/2014, 15:00:00
    Current State: Stopped
    Number of iterations: 12
    Number of VD completed: 1
    Excluded VDs : None
    Exit Code: 0x00

    c:Program Files (x86)MegaRAID Storage ManagerMegaCLI>MegaCli -AdpCcSched -Mod
    eConc -SetStartTime 20140114 01 -aALL
    Invalid input at or near token 2014/01/14

    Exit Code: 0x01

    Any Idea?

    • esarakaitis says:

      which scsi controller are you using?

      MegaCli -AdpCcSched -Dsbl|-Info|{-ModeConc | -ModeSeq [-ExcludeLD -LN|-L0,1,2]
      [-SetStartTime yyyymmdd hh ] [-SetDelay val ] } -aN|-a0,1,2|-aALL
      MegaCli -AdpCcSched -SetStartTime yyyymmdd hh -aN|-a0,1,2|-aALL
      MegaCli -AdpCcSched -SetDelay val -aN|-a0,1,2|-aALL

  3. robadidon says:

    HEllo,

    Is it possible to add new drives in a RAID50 (production system) ? SHould I create new array and include it into existing raid ?

  4. frodosumkin says:

    Good post. But need to describe it at least a little bit, for instance – http://sysadm.pp.ua/linux/megaraid-assembling-raid6.html . Some more details about configuration process. Thanks

  5. glen says:

    Hi,

    I tried to change the concurrent schedule using the command below but encountered also the same error “invalid input at or near token 20160930. We have changed it last feb using the same syntax and was successful. I cannot figure out how come it doesn’t work now?

    C:\Program Files (x86)\MegaRAID Storage Manager\MegaCLI>megacli64 -adpccsched -s
    etstarttime 20160930 00 -aall
    Invalid input at or near token 20160930

    Exit Code: 0x01

Leave a Reply

Your email address will not be published. Required fields are marked *