MegaCLI maintenance notes
megacli -pdlist -a0 | fgrep -i "device id:"
smartctl -d megaraid,N -a /dev/sda
Get list of device ID's, and then use smartctl to get SMART attributes and status.
N is the device ID from the megacli command, and a is usually "a" to indicate the (first) drive in the RAID device (not actually /dev/sda as in /dev).
megacli -cfgforeign -clear -aall
Clear foreign configurations on all physical drives. Useful in response to an error like "The specified physical disk does not have the appropriate attributes to complete the requested command."
megacli -fwtermlog -dsply -a0
Show firmware terminal log (to see what the adaptor has been doing, times are in GMT)
megacli -adpallinfo -aall | less
Show all information for all adaptors
megacli -pdlist -a0 | less
List information about all physical disks attached to adaptor #0
megacli -ldinfo -lall -a0 | less
List information about all logical/virtual disks on adaptor #0
megacli -ldpdinfo -a0 | less
List all logical drives and associated physical drives on adaptor #0
megacli -cfglddel -l3 [-force] -a0
megacli -cfglddel -l11 [-force] -a0
Delete configuration for logical/virtual disk 3/11 on adaptor #0
megacli -cfgldadd -r0 '[32:3]' -a0
Add configuration for single logical disk (RAID 0), enclosure 32, slot 3 on adaptor 0
288 megacli -pdlist -a0 | less 289 megacli -h | less 304 megacli -h | less 306 megacli -adpallinfo -all 307 megacli -adpallinfo -aall 308 megacli -adpallinfo -aall | less 309 megacli -pdlist -a0 310 megacli -pdlist -a0 | less 311 megacli -ldinfo -lall -a0 313 megacli -LdPdInfo -aall 314 megacli -LdPdInfo -aall | less 316 megacli -pdgetnum -a0 317 megacli -cfgldadd -r0 '[e0:s0]' 318 megacli -cfgldadd -r0 '[E0:s0]' 319 megacli -cfgldadd -r0 '[0:0]' 320 megacli -cfgldadd -r0'[0:0]' 321 megacli -cfgldadd -r0'[e0:e0]' 322 megacli -cfgldadd -r0'[E0:S0]' 323 megacli -cfgldadd -r0 '[E0:S0]' 324 megacli -cfgldadd -r0 '[E0:S0]' -a0 325 megacli -cfgldadd -r0 'E0:S0' -a0 326 megacli -cfgldadd -r0 '[0:0]' -a0 327 megacli -pdlist -a0 | less 328 megacli -cfgldadd -r0 '[32:0]' -a0 329 megacli -ldinfo -lall -a0 | less 335 megacli --pdlist -a0 | less 336 megacli -pdlist -a0 | less 337 megacli -ldpdinfo -a0 | less 338 megacli -cfglddel -l3 -a0 339 megacli -cfglddel -l3 -a0 -force 340 megacli -cfglddel -l3 -force -a0 341 megacli -cfglddel -l11 -a0 342 megacli -cfglddel -l11 -force -a0 345 megacli -ldinfo -lall -a0 | less 346 megacli -ldpdinfo -a0 | less 347 megacli -cfgldadd -r0 '[32:3]' -a0