{"id":1491,"date":"2013-11-04T12:42:08","date_gmt":"2013-11-04T17:42:08","guid":{"rendered":"http:\/\/www.shainmiley.com\/wordpress\/?p=1491"},"modified":"2015-02-27T14:14:06","modified_gmt":"2015-02-27T19:14:06","slug":"megacli-cheat-sheet","status":"publish","type":"post","link":"https:\/\/www.shainmiley.com\/wordpress\/2013\/11\/04\/megacli-cheat-sheet\/","title":{"rendered":"megacli cheat sheet"},"content":{"rendered":"<p>The information below is based heavily off of a post that can be found here: <\/p>\n<p><a href=\"http:\/\/erikimh.com\/megacli-cheatsheet\/\" target=\"_blank\">http:\/\/erikimh.com\/megacli-cheatsheet\/<\/a>.  <\/p>\n<p>I am providing the information on my blog in the event that the original blog post becomes unavailable at some point in the future, as we use this information quite regularly.<\/p>\n<p><em><strong>1-Gather Info:\u00c2\u00a0<\/strong><\/em><\/p>\n<p><strong>Controller information<\/strong><\/p>\n<p>megacli -AdpAllInfo -aALL<br \/>\nmegacli -CfgDsply -aALL<br \/>\nmegacli -adpeventlog -getevents -f controller-events.log -a0 -nolog<\/p>\n<p><strong>Enclosure information<\/strong><\/p>\n<p>megacli -EncInfo -aALL<\/p>\n<p><strong>Virtual drive information<\/strong><\/p>\n<p>megacli -LDInfo -Lall -aALL<\/p>\n<p><strong>Physical drive information<\/strong><\/p>\n<p>megacli -PDList -aALL<br \/>\nmegacli -PDInfo -PhysDrv [E:S] -aALL<\/p>\n<p><strong>Battery backup information<\/strong><\/p>\n<p>megacli -AdpBbuCmd -aALL<\/p>\n<p><strong>Check Battery backup warning on boot<\/strong><\/p>\n<p>megacli -AdpGetProp BatWarnDsbl -a0<\/p>\n<p><em><strong>Controller management:<\/strong><\/em><\/p>\n<p><strong>Silence active alarm<\/strong><\/p>\n<p>megacli -AdpSetProp AlarmSilence -aALL<\/p>\n<p><strong>Disable alarm<\/strong><\/p>\n<p>megacli -AdpSetProp AlarmDsbl -aALL<\/p>\n<p><strong>Enable alarm<\/strong><\/p>\n<p>megacli -AdpSetProp AlarmEnbl -aALL<\/p>\n<p><strong>Disable battery backup warning on system boot<\/strong><\/p>\n<p>megacli -AdpSetProp BatWarnDsbl -a0<\/p>\n<p><strong>Change the adapter rebuild rate to 60%:<\/strong><\/p>\n<p>megacli -AdpSetProp {RebuildRate -60} -aALL<\/p>\n<p><em><strong>2-Virtual drive management:<\/strong><\/em><\/p>\n<p><strong>Create RAID 0, 1, 5 drive<\/strong><\/p>\n<p>megacli -CfgLdAdd -r(0|1|5) [E:S, E:S, &#8230;] -aN<\/p>\n<p><strong>Create RAID 10 drive<\/strong><\/p>\n<p>megacli -CfgSpanAdd -r10 -Array0[E:S,E:S] -Array1[E:S,E:S] -aN<\/p>\n<p><strong>Remove drive<\/strong><\/p>\n<p>megacli -CfgLdDel -Lx -aN<\/p>\n<p><strong>Physical drive management<\/strong><\/p>\n<p><strong>Set state to offline<\/strong><\/p>\n<p>megacli -PDOffline -PhysDrv [E:S] -aN<\/p>\n<p><strong>Set state to online<\/strong><\/p>\n<p>megacli -PDOnline -PhysDrv [E:S] -aN<\/p>\n<p><strong>Mark as missing<\/strong><\/p>\n<p>megacli -PDMarkMissing -PhysDrv [E:S] -aN<\/p>\n<p><strong>Prepare for removal<\/strong><\/p>\n<p>megacli -PdPrpRmv -PhysDrv [E:S] -aN<\/p>\n<p><strong>Replace missing drive<\/strong><\/p>\n<p>megacli -PdReplaceMissing -PhysDrv [E:S] -ArrayN -rowN -aN<\/p>\n<p>The number N of the array parameter is the Span Reference you get using megacli -CfgDsply -aALL and the number N of the row parameter is the Physical Disk in that span or array starting with zero (it\u00e2\u20ac\u2122s not the physical disk\u00e2\u20ac\u2122s slot!).<\/p>\n<p><strong>Rebuild drive &#8211; Drive status should be &#8220;Firmware state: Rebuild&#8221;<\/strong><\/p>\n<p>megacli -PDRbld -Start -PhysDrv [E:S] -aN<br \/>\nmegacli -PDRbld -Stop -PhysDrv [E:S] -aN<br \/>\nmegacli -PDRbld -ShowProg -PhysDrv [E:S] -aN<br \/>\nmegacli -PDRbld -ProgDsply -physdrv [E:S] -aN<\/p>\n<p><strong>Clear drive<\/strong><\/p>\n<p>megacli -PDClear -Start -PhysDrv [E:S] -aN<br \/>\nmegacli -PDClear -Stop -PhysDrv [E:S] -aN<br \/>\nmegacli -PDClear -ShowProg -PhysDrv [E:S] -aN<\/p>\n<p><strong>Bad to good<\/strong><\/p>\n<p>megacli -PDMakeGood -PhysDrv[E:S] -aN<\/p>\n<p><strong>Changes drive in state Unconfigured-Bad to Unconfigured-Good.<\/strong><\/p>\n<p>Hot spare management<\/p>\n<p><strong>Set global hot spare<\/strong><\/p>\n<p>megacli -PDHSP -Set -PhysDrv [E:S] -aN<\/p>\n<p><strong>Remove hot spare<\/strong><\/p>\n<p>megacli -PDHSP -Rmv -PhysDrv [E:S] -aN<\/p>\n<p><strong>Set dedicated hot spare<\/strong><\/p>\n<p>megacli -PDHSP -Set -Dedicated -ArrayN,M,&#8230; -PhysDrv [E:S] -aN<\/p>\n<p><strong>Walkthrough: Rebuild a Drive that is marked &#8216;Foreign&#8217; when Inserted:<\/strong><\/p>\n<p><strong>Bad to good<\/strong><\/p>\n<p>megacli -PDMakeGood -PhysDrv [E:S] -aALL<\/p>\n<p><strong>Clear the foreign setting<\/strong><\/p>\n<p>megacli -CfgForeign -Clear -aALL<\/p>\n<p><strong>Set global hot spare<\/strong><\/p>\n<p>megacli -PDHSP -Set -PhysDrv [E:S] -aN<\/p>\n<p><em><strong>Walkthrough: Change\/replace a drive<\/strong><\/em><\/p>\n<p><strong>a. Set the drive offline, if it is not already offline due to an error<\/strong><\/p>\n<p>megacli -PDOffline -PhysDrv [E:S] -aN<\/p>\n<p><strong>b. Mark the drive as missing<\/strong><\/p>\n<p>megacli -PDMarkMissing -PhysDrv [E:S] -aN<\/p>\n<p><strong>c. Prepare drive for removal<\/strong><\/p>\n<p>megacli -PDPrpRmv -PhysDrv [E:S] -aN<\/p>\n<p><strong>d. Change\/replace the drive<\/strong><\/p>\n<p><strong>e. If you\u00e2\u20ac\u2122re using hot spares then the replaced drive should become your new hot spare drive<\/strong><\/p>\n<p>megacli -PDHSP -Set -PhysDrv [E:S] -aN<\/p>\n<p><strong>f. In case you\u00e2\u20ac\u2122re not working with hot spares, you must re-add the new drive to your RAID virtual drive and start the rebuilding<\/strong><\/p>\n<p>megacli -PdReplaceMissing -PhysDrv [E:S] -ArrayN -rowN -aN<br \/>\nmegacli -PDRbld -Start -PhysDrv [E:S] -aN<\/p>\n<p><em><strong>3-Gathering Standard logs<\/strong><\/em><\/p>\n<p>#rm \u00e2\u20ac\u201cf MegaSAS.log<br \/>\n#megacli -adpallinfo -a0<br \/>\n#megacli -encinfo -a0<br \/>\n#megacli -ldinfo -lall -a0<br \/>\n#megacli -pdlist -a0<br \/>\n#megacli -adpeventlog -getevents -f controller-events.log -a0 -nolog<br \/>\n#megacli -fwtermlog -dsply -a0 -nolog &gt; controller-fwterm.log<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The information below is based heavily off of a post that can be found here: http:\/\/erikimh.com\/megacli-cheatsheet\/. I am providing the information on my blog in the event that the original blog post becomes unavailable at some point in the future, as we use this information quite regularly. 1-Gather Info:\u00c2\u00a0 Controller information megacli -AdpAllInfo -aALL megacli [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/www.shainmiley.com\/wordpress\/wp-json\/wp\/v2\/posts\/1491"}],"collection":[{"href":"https:\/\/www.shainmiley.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shainmiley.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shainmiley.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shainmiley.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1491"}],"version-history":[{"count":9,"href":"https:\/\/www.shainmiley.com\/wordpress\/wp-json\/wp\/v2\/posts\/1491\/revisions"}],"predecessor-version":[{"id":1609,"href":"https:\/\/www.shainmiley.com\/wordpress\/wp-json\/wp\/v2\/posts\/1491\/revisions\/1609"}],"wp:attachment":[{"href":"https:\/\/www.shainmiley.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shainmiley.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shainmiley.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}