Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux:raid:megacli [2020/04/06 14:38]
admin created
linux:raid:megacli [2020/04/06 14:40] (current)
admin
Line 14: Line 14:
 The status of the RAID may be obtained by using the following command (show all logical devices on all controllers):​ The status of the RAID may be obtained by using the following command (show all logical devices on all controllers):​
  
-megacli -LDInfo -Lall -Aall+  ​megacli -LDInfo -Lall -Aall
  
 Example RAID 1: Example RAID 1:
 +<​file>​
 Adapter 0 -- Virtual Drive Information:​ Adapter 0 -- Virtual Drive Information:​
 Virtual Disk: 0 (Target Id: 0) Virtual Disk: 0 (Target Id: 0)
Line 34: Line 34:
  
 Exit Code: 0x00 Exit Code: 0x00
 +</​file>​
 The status of the drives may be obtained by using the following command: The status of the drives may be obtained by using the following command:
  
-megacli -PDList -Aall+   megacli -PDList -Aall
  
 As this command also generates a quantity of useless information,​ it is advisable to filter the output, e.g. using: As this command also generates a quantity of useless information,​ it is advisable to filter the output, e.g. using:
Line 46: Line 46:
 Before the array can be set up, the previous configuration may need to be deleted. To just delete the logical drive you can use CfgLdDel: Before the array can be set up, the previous configuration may need to be deleted. To just delete the logical drive you can use CfgLdDel:
  
-megacli -CfgLdDel -Lall -aAll+  ​megacli -CfgLdDel -Lall -aAll
  
 To delete everything (incl. eg. cache behaviour) use Configuration Clear: To delete everything (incl. eg. cache behaviour) use Configuration Clear:
  
-megacli -CfgClr -aAll+  ​megacli -CfgClr -aAll
  
 Usable drives must be in an Unconfigured (good) status (see above). If these are in Unconfigured (bad) status, they can be set up via: Usable drives must be in an Unconfigured (good) status (see above). If these are in Unconfigured (bad) status, they can be set up via:
  
-megacli -PDMakeGood -PhysDrv[<​Enclosure#>:<​Slot#>​] -a0+  ​megacli -PDMakeGood -PhysDrv[<​Enclosure#>:<​Slot#>​] -a0
  
 Syntax: Syntax:
  
-megacli -CfgLdAdd -r<​RAID#>​ [E0:​S0,​E1:​S1,​...] [WT|WB] [NORA|RA] [Direct|Cached] -sz<​Size>​ [-sz<​Size>​] +  ​megacli -CfgLdAdd -r<​RAID#>​ [E0:​S0,​E1:​S1,​...] [WT|WB] [NORA|RA] [Direct|Cached] -sz<​Size>​ [-sz<​Size>​] 
-RAID 0, 1 or 5+  RAID 0, 1 or 5
  
 For "​r1"​ enter "​r0"​ or "​r5"​ correspondingly (HDDs on Enclosure 252, Port 0 and 1, WriteBack on, ReadCache on adaptive, Cache also enabled without BBU): For "​r1"​ enter "​r0"​ or "​r5"​ correspondingly (HDDs on Enclosure 252, Port 0 and 1, WriteBack on, ReadCache on adaptive, Cache also enabled without BBU):
  
-megacli -CfgLdAdd -r1 [252:​0,​252:​1] WB RA Direct CachedBadBBU -a0+  ​megacli -CfgLdAdd -r1 [252:​0,​252:​1] WB RA Direct CachedBadBBU -a0
  
 Set up RAID 0, 1 or 5 as above with a size of 20 GB: Set up RAID 0, 1 or 5 as above with a size of 20 GB:
  
-megacli -CfgLdAdd -r1 [252:​0,​252:​1] WB RA Direct CachedBadBBU -sz10GB -a0 +  ​megacli -CfgLdAdd -r1 [252:​0,​252:​1] WB RA Direct CachedBadBBU -sz10GB -a0 
-RAID 10+  RAID 10
  
-megacli -CfgSpanAdd -r10 -Array0[252:​0,​252:​1] -Array1[252:​2,​252:​3] WB RA Direct CachedBadBBU -a0+  ​megacli -CfgSpanAdd -r10 -Array0[252:​0,​252:​1] -Array1[252:​2,​252:​3] WB RA Direct CachedBadBBU -a0
 Expanding an existing array Expanding an existing array
  
 After an additional drive is installed the desired volume is reconfigured accordingly. Here is an example of adding a drive to a RAID 5: After an additional drive is installed the desired volume is reconfigured accordingly. Here is an example of adding a drive to a RAID 5:
  
-megacli -LDRecon -Start -r5 -Add -PhysDrv[252:​3] -L0 -a0+  ​megacli -LDRecon -Start -r5 -Add -PhysDrv[252:​3] -L0 -a0
 Using the drives as JBOD Using the drives as JBOD
  
Line 93: Line 93:
 If the array is not bootable, it can be queried and created on a logical device: If the array is not bootable, it can be queried and created on a logical device:
  
-root@rescue ~ # megacli -AdpBootDrive -get -a0+  ​root@rescue ~ # megacli -AdpBootDrive -get -a0
  
 Adapter 0: No Virtual drive or Physical Drive is configured as boot drive. Adapter 0: No Virtual drive or Physical Drive is configured as boot drive.
  
 Exit Code: 0x00 Exit Code: 0x00
-root@rescue ~ # megacli -AdpBootDrive -set -L0 -a0+  ​root@rescue ~ # megacli -AdpBootDrive -set -L0 -a0
  
 Boot Virtual Drive is set to #0 (target id #0) on Adapter 0 Boot Virtual Drive is set to #0 (target id #0) on Adapter 0
Line 108: Line 108:
 To save the configuration of the controller and all arrays: To save the configuration of the controller and all arrays:
  
-# megacli -CfgSave -f raidcfg.txt -a0+  ​# megacli -CfgSave -f raidcfg.txt -a0
  
 To restore the configuration of the controller: To restore the configuration of the controller:
  
-root@rescue ~ # megacli -CfgRestore -f raidcfg.txt -a0+  ​root@rescue ~ # megacli -CfgRestore -f raidcfg.txt -a0
 Replacing a drive in an array if the rebuild does not start automatically Replacing a drive in an array if the rebuild does not start automatically
  
 The status of the new drive should be Unconfigured (good). This can be checked with PDList. If the status of the drive is Unconfigured (bad), it will first need to be made usable as follows: The status of the new drive should be Unconfigured (good). This can be checked with PDList. If the status of the drive is Unconfigured (bad), it will first need to be made usable as follows:
 +<​code>​
 root@rescue ~ # megacli -PDList -a0 | grep Firmware root@rescue ~ # megacli -PDList -a0 | grep Firmware
 Firmware state: Online, Spun Up Firmware state: Online, Spun Up
Line 126: Line 126:
 Firmware state: Online, Spun Up Firmware state: Online, Spun Up
 Device Firmware Level: CC45 Device Firmware Level: CC45
 +</​code>​
  
 +<​code>​
 root@rescue ~ # megacli -CfgForeign -Scan -a0 root@rescue ~ # megacli -CfgForeign -Scan -a0
  
Line 137: Line 139:
  
 Exit Code: 0x00 Exit Code: 0x00
 +</​code>​
  
-root@rescue ~ # megacli -PDMakeGood -PhysDrv [245:3] -a0+   root@rescue ~ # megacli -PDMakeGood -PhysDrv [245:3] -a0
  
 If the drive is good, it can now replace the missing drive. To do this the array and the position which are to be replaced need to be specified. These numbers may be obtained for example from megacli -CfgDsply -a0. If a drive is missing in an array, the entry Physical Disk: will show up, but no further information will be displayed. In the example, the fourth drive of the first array Array0 is now exchanged with the drive in Enclosure 245 Slot 3 ("​PhysDrv[245:​3]"​):​ If the drive is good, it can now replace the missing drive. To do this the array and the position which are to be replaced need to be specified. These numbers may be obtained for example from megacli -CfgDsply -a0. If a drive is missing in an array, the entry Physical Disk: will show up, but no further information will be displayed. In the example, the fourth drive of the first array Array0 is now exchanged with the drive in Enclosure 245 Slot 3 ("​PhysDrv[245:​3]"​):​
  
-root@rescue ~ # megacli -PdReplaceMissing -PhysDrv[245:​3] -array0 -row4 -a0+  ​root@rescue ~ # megacli -PdReplaceMissing -PhysDrv[245:​3] -array0 -row4 -a0 
 +  Adapter: 0: Missing PD at Array 0, Row 4 is replaced. 
 +  Exit Code: 0x00 
 +  root@rescue ~ # megacli -PDRbld -Start -PhysDrv[245:​3] ​-a0
  
-Adapter: 0: Missing PD at Array 0, Row 4 is replaced. +  ​Started rebuild progress on device(Encl-245 Slot-3) 
- +  Exit Code: 0x00 
-Exit Code: 0x00 +  root@rescue ~ # megacli -PDRbld -ShowProg -PhysDrv [245:3] -aAll
-root@rescue ~ # megacli -PDRbld -Start -PhysDrv[245:​3] -a0 +
- +
-Started rebuild progress on device(Encl-245 Slot-3) +
- +
-Exit Code: 0x00 +
-root@rescue ~ # megacli -PDRbld -ShowProg -PhysDrv [245:3] -aAll+
  
 Rebuild Progress on Device at Enclosure 245, Slot 3 Completed 1% in 0 Minutes. Rebuild Progress on Device at Enclosure 245, Slot 3 Completed 1% in 0 Minutes.
 
linux/raid/megacli.1586176722.txt.gz · Last modified: 2020/04/06 14:38 by admin