Intro

Dell uses raid controllers from LSI.

The megactl utility should therefore work with all PERC raid controllers.

The Dell-provided CLI-raid-utility is for Ubuntu 16.04 and rather old, so I decided to try out this third-party utility instead.

This guide has been tested on PERC7 as well and found to work.

 

 

Assumptions

Using Debian Buster with a Dell R710 and PERC 6/i.

root@dragonborn:~# lspci -nn
...
03:00.0 RAID bus controller [0104]: LSI Logic / Symbios Logic MegaRAID SAS 1078 [1000:0060] (rev 04)
...

root@dragonborn:~# lsb_release -a          
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
root@dragonborn:~#

 

 

 

Howto

  1. Add repo to OS.
    # echo "deb http://hwraid.le-vert.net/debian buster main" > /etc/apt/sources.list.d/hwraid.list

  2. Add repo key.
    # mkdir /root/Downloads
    # cd /root/Downloads
    # wget https://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key
    # apt-key add hwraid.le-vert.net.gpg.key
  3. Install megaraid-status and megacli.
    # apt update
    # apt-get install megaraid-status megacli
  4. If the installation from §3 fails for some reason on Debian Buster, try downloading the packages below, using the url in the repo-file. Then install them with dpkg, followed by a apt install -f and or apt --fix-broken install.

    In other words, use this url; https://hwraid.le-vert.net/debian/pool-buster/.

    Note that the Debian Buster-packages works on Debian Bullseye as well (as of 2023-05-15).

    # cd /root/Downloads
    # apt-get install -f ./megactl_0.4.1+svn20090725.r6-7+Debian.buster.10_amd64.deb

    megacli_8.07.14-2+Debian.buster.10_amd64.deb
    megaraid-status_0.13+Debian.buster.10_all.deb
    libc6-i386
    megactl_0.4.1+svn20090725.r6-7+Debian.buster.10_amd64.deb
    daemon
  5. Done. Test it out with the commanda in the tips and tricks part.

 

 

 

Command tricks and tips

In no particular order. These three command should get you going fairly quick.

 

Print the current controller status

root@dragonborn:~# megasasctl
a0       PERC 6/i Integrated      encl:1 ldrv:1  batt:FAULT, charging
a0d0      9312GiB RAID 5   1x6  optimal
a0e32s0    1863GiB  a0d0  online   
a0e32s1    1863GiB  a0d0  online   
a0e32s2    1863GiB  a0d0  online   
a0e32s3    1863GiB  a0d0  online   errs: media:0  other:22
a0e32s4    1863GiB  a0d0  online   
a0e32s5    1863GiB  a0d0  online   

root@dragonborn:~#

 

 

General raid status

root@dragonborn:~# megaraidsas-status
-- Arrays informations --
-- ID | Type | Size | Status
a0d0 | RAID 5 | 9312GiB | optimal

-- Disks informations
-- ID | Model | Status | Warnings
a0e32s0 | SEAGATE ST32000444SS 1863GiB | online
a0e32s1 | SEAGATE ST2000NM0001 1863GiB | online
a0e32s2 | SEAGATE ST32000444SS 1863GiB | online
a0e32s3 | SEAGATE ST32000444SS 1863GiB | online | errs: media:0 other:19
a0e32s4 | SEAGATE ST32000444SS 1863GiB | online
a0e32s5 | SEAGATE ST32000444SS 1863GiB | online
root@dragonborn:~#

 

 

Show logical drive 0 on adapter 0 status and type

Of particular interest is the Ongoing Progresses line, This raid array is initializing, and has been doing so for a while.

root@dragonborn:~# megacli -LDInfo -L0 -a0

Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :raid5-data
RAID Level          : Primary-5, Secondary-0, RAID Level Qualifier-3
Size                : 9.093 TB
Sector Size         : 512
Parity Size         : 1.818 TB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 6
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Disk's Default
Ongoing Progresses:
 Background Initialization: Completed 53%, Taken 379 min.
Encryption Type     : None
Is VD Cached: No



Exit Code: 0x00
root@dragonborn:~#

 

Display and adjust automatic rebuild status on adapter 0

root@dragonborn:~# megacli -AdpAutoRbld -Dsply -a0
                                     
Adapter 0: AutoRebuild is Enabled.

Exit Code: 0x00

 

Info on rebuild rate on https://jackal777.wordpress.com/2015/05/29/adjust-raid-rebuild-rate/.

root@dragonborn:~# megacli -AdpGetProp RebuildRate -a0
                                     
Adapter 0: Rebuild Rate = 30%

Exit Code: 0x00
root@dragonborn:~# megacli -AdpSetProp RebuildRate 60 -a0
                                     
Adapter 0: Set rebuild rate to 60% success.

Exit Code: 0x00
root@dragonborn:~# megacli -AdpGetProp RebuildRate -a0    
                                     
Adapter 0: Rebuild Rate = 60%

Exit Code: 0x00
root@dragonborn:~#

The rebuild rate can be set for software raids as well. The keywords to note here are speed_limit_max and speed_limit_min.
Preferably set the max and min values to the same high number.

See eg this site for more information; https://www.cyberciti.biz/tips/linux-raid-increase-resync-rebuild-speed.html.

 

Show the physical disks on  adapter 0

The line Firmware state is of interest, this line states what the drive is doing, if anything.

 

# megacli -PDList -a0

Adapter #0

Enclosure Device ID: 32
Slot Number: 0
Drive's position: DiskGroup: 0, Span: 0, Arm: 0
Enclosure position: N/A
Device Id: 0
WWN:
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.818 TB [0xe8d00000 Sectors]
Sector Size: 0
Firmware state: Online, Spun Up
Device Firmware Level: 0006
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x5000c50021457ca9
SAS Address(1): 0x0
Connected Port Number: 0(path0)
Inquiry Data: SEAGATE ST32000444SS 00069WM1TD7F
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: Unknown
Link Speed: Unknown
Media Type: Hard Disk Device
Drive Temperature :32C (89.60 F)
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: Unknown
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : No


Enclosure Device ID: 32
Slot Number: 1
Drive's position: DiskGroup: 0, Span: 0, Arm: 1
Enclosure position: N/A
Device Id: 1
WWN:
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.818 TB [0xe8d00000 Sectors]
Sector Size: 0
Firmware state: Online, Spun Up
Device Firmware Level: XQB6
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x5000c500415c7c75
SAS Address(1): 0x0
Connected Port Number: 1(path0)
Inquiry Data: SEAGATE ST2000NM0001 XQB6Z1P20GQ7
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: Unknown
Link Speed: Unknown
Media Type: Hard Disk Device
Drive Temperature :33C (91.40 F)
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: Unknown
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : No


Enclosure Device ID: 32
Slot Number: 2
Drive's position: DiskGroup: 0, Span: 0, Arm: 2
Enclosure position: N/A
Device Id: 2
WWN:
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.818 TB [0xe8d00000 Sectors]
Sector Size: 0
Firmware state: Online, Spun Up
Device Firmware Level: 0005
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x5000c50020ec234d
SAS Address(1): 0x0
Connected Port Number: 2(path0)
Inquiry Data: SEAGATE ST32000444SS 00059WM0FQ40
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: Unknown
Link Speed: Unknown
Media Type: Hard Disk Device
Drive Temperature :32C (89.60 F)
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: Unknown
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : No


Enclosure Device ID: 32
Slot Number: 3
Drive's position: DiskGroup: 0, Span: 0, Arm: 3
Enclosure position: N/A
Device Id: 3
WWN:
Sequence Number: 2
Media Error Count: 0
Other Error Count: 23
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.818 TB [0xe8d00000 Sectors]
Sector Size: 0
Firmware state: Online, Spun Up
Device Firmware Level: 0005
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x5000c50020e33c5d
SAS Address(1): 0x0
Connected Port Number: 3(path0)
Inquiry Data: SEAGATE ST32000444SS 00059WM0DWNJ
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: Unknown
Link Speed: Unknown
Media Type: Hard Disk Device
Drive Temperature :32C (89.60 F)
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: Unknown
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : No


Enclosure Device ID: 32
Slot Number: 4
Drive's position: DiskGroup: 0, Span: 0, Arm: 4
Enclosure position: N/A
Device Id: 4
WWN:
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.818 TB [0xe8d00000 Sectors]
Sector Size: 0
Firmware state: Online, Spun Up
Device Firmware Level: 0006
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x5000c500214572bd
SAS Address(1): 0x0
Connected Port Number: 4(path0)
Inquiry Data: SEAGATE ST32000444SS 00069WM1TCNP
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: Unknown
Link Speed: Unknown
Media Type: Hard Disk Device
Drive Temperature :33C (91.40 F)
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: Unknown
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : No


Enclosure Device ID: 32
Slot Number: 5
Drive's position: DiskGroup: 0, Span: 0, Arm: 5
Enclosure position: N/A
Device Id: 5
WWN:
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.818 TB [0xe8d00000 Sectors]
Sector Size: 0
Firmware state: Online, Spun Up
Device Firmware Level: 0005
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x5000c50020d36d4d
SAS Address(1): 0x0
Connected Port Number: 5(path0)
Inquiry Data: SEAGATE ST32000444SS 00059WM0GBJN
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: Unknown
Link Speed: Unknown
Media Type: Hard Disk Device
Drive Temperature :32C (89.60 F)
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: Unknown
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : No


Exit Code: 0x00

 

If a drive is rebuilding, show the progress as below.

In this case the rebuilding drive is 32,1; ie enclosure id 32 and slot/drive 1.

# megacli -PDRbld -ShowProg -PhysDrv [32:1] -aALL

Rebuild Progress on Device at Enclosure 32, Slot 1 Completed 51% in 10 Minutes.

 

Find and blink a specific disk in a particular bay

For use when you eg need to replace a disk and it's difficult to see which one is shining amber instead of green.

First, only show bad drives

# megasasctl -H
a0 PERC 6/i Integrated encl:1 ldrv:1 batt:good
a0e32s0 1863GiB a0d0 online errs: media:0 other:34 predictive-failure
write errors: corr: 0 delay: 0 rewrit: 0 tot/corr: 0 tot/uncorr: 0
read errors: corr:547Mi delay: 1Ki reread: 0 tot/corr:547Mi tot/uncorr: 1
verify errors: corr: 6Mi delay: 1Ki revrfy: 0 tot/corr: 6Mi tot/uncorr: 0
temperature: current:0C threshold:68C
a0e32s2 1863GiB a0d0 online errs: media:0 other:8 predictive-failure
write errors: corr: 0 delay: 0 rewrit: 0 tot/corr: 0 tot/uncorr: 0
read errors: corr: 79Mi delay: 1Ki reread: 0 tot/corr: 79Mi tot/uncorr: 0
verify errors: corr: 2Mi delay: 64 revrfy: 0 tot/corr: 2Mi tot/uncorr: 0
temperature: current:0C threshold:68C

Legend
a0: denotifies which raid controller if there are more than one.
e32: denotifies which bay.
s0, s2: denotifies which disk in the above bay.

 

Then seek out the specific drives.

In bay 32 on raid controller a0, blink disk in slot 0 until turned off.
# megacli -PdLocate -start -physdrv[32:0] -a0
# megacli -PdLocate -stop -physdrv[32:0] -a0

In bay 32 on raid controller a0, blink disk in slot 2 until turned off.
# megacli -PdLocate -start -physdrv[32:2] -a0
# megacli -PdLocate -stop -physdrv[32:2] -a0

 

Battery status

More info about the battery. Keeping an eye on it may be a good idea.

See eg https://crtech.tips/understanding-your-perc-battery/ for more pertinent info.

root@dragonborn:~# megacli -AdpBbuCmd -GetBbuStatus -aALL

BBU status for Adapter: 0

BatteryType: BBU
Voltage: 4059 mV
Current: 79 mA
Temperature: 23 C
Battery State: Optimal
BBU Firmware Status:

 Charging Status              : Charging
 Voltage                                 : OK
 Temperature                             : OK
 Learn Cycle Requested                   : No
 Learn Cycle Active                      : No
 Learn Cycle Status                      : OK
 Learn Cycle Timeout                     : No
 I2c Errors Detected                     : No
 Battery Pack Missing                    : No
 Battery Replacement required            : No
 Remaining Capacity Low                  : No
 Periodic Learn Required                 : No
 Transparent Learn                       : No
 No space to cache offload               : No
 Pack is about to fail & should be replaced : No
 Cache Offload premium feature required  : No
 Module microcode update required        : No


GasGuageStatus:
 Fully Discharged        : No
 Fully Charged           : No
 Discharging             : No
 Initialized             : Yes
 Remaining Time Alarm    : No
 Discharge Terminated    : No
 Over Temperature        : No
 Charging Terminated     : No
 Over Charged            : No
Relative State of Charge: 96 %
Charger Status: In Progress
Remaining Capacity: 1198 mAh
Full Charge Capacity: 1252 mAh
isSOHGood: Yes

Exit Code: 0x00


root@dragonborn:~# megacli -AdpBbuCmd -a0

BBU status for Adapter: 0

BatteryType: BBU
Voltage: 4065 mV
Current: 0 mA
Temperature: 24 C
Battery State: Optimal
BBU Firmware Status:

 Charging Status              : None
 Voltage                                 : OK
 Temperature                             : OK
 Learn Cycle Requested                   : No
 Learn Cycle Active                      : No
 Learn Cycle Status                      : OK
 Learn Cycle Timeout                     : No
 I2c Errors Detected                     : No
 Battery Pack Missing                    : No
 Battery Replacement required            : No
 Remaining Capacity Low                  : No
 Periodic Learn Required                 : No
 Transparent Learn                       : No
 No space to cache offload               : No
 Pack is about to fail & should be replaced : No
 Cache Offload premium feature required  : No
 Module microcode update required        : No


GasGuageStatus:
 Fully Discharged        : No
 Fully Charged           : Yes
 Discharging             : Yes
 Initialized             : Yes
 Remaining Time Alarm    : No
 Discharge Terminated    : No
 Over Temperature        : No
 Charging Terminated     : Yes
 Over Charged            : No
Relative State of Charge: 100 %
Charger Status: Complete
Remaining Capacity: 1252 mAh
Full Charge Capacity: 1252 mAh
isSOHGood: Yes
 Battery backup charge time : 0 hours

BBU Capacity Info for Adapter: 0

 Relative State of Charge: 100 %
 Absolute State of charge: 70 %
 Remaining Capacity: 1252 mAh
 Full Charge Capacity: 1252 mAh
 Run time to empty: Battery is not being charged.   
 Average time to empty: Battery is not being charged.   
 Estimated Time to full recharge: Battery is not being charged.   
 Cycle Count: 38
Max Error = 2 %
Remaining Capacity Alarm = 180 mAh
Remining Time Alarm = 10 Min

BBU Design Info for Adapter: 0

 Date of Manufacture: 08/09, 2009
 Design Capacity: 1800 mAh
 Design Voltage: 3700 mV
 Specification Info: 49
 Serial Number: 3149
 Pack Stat Configuration: 0x0014
 Manufacture Name: SMP-PA1.9
 Firmware Version   :  
 Device Name: DLFR463
 Device Chemistry: LION
 Battery FRU: N/A
 Transparent Learn = 0
 App Data = 0

BBU Properties for Adapter: 0

 Auto Learn Period: 90 Days
 Next Learn time: Fri May 29 15:34:32 2020
 Learn Delay Interval:0 Hours
 Auto-Learn Mode: Enabled

Exit Code: 0x00
root@dragonborn:~#

 

 

 

 

 

Sources

https://www.dell.com/support/home/us/en/04/drivers/driversdetails?driverid=52r3d (Ubuntu 16.04)

https://cetre.co.uk/blog/monitoring-perc-raid-controllers-and-storage-arrays-on-dell-poweredge-servers-with-debian-and-ubuntu/

http://hwraid.le-vert.net/wiki/LSIMegaRAIDSAS

https://jackal777.wordpress.com/2015/05/29/adjust-raid-rebuild-rate/

https://crtech.tips/understanding-your-perc-battery/

https://www.cyberciti.biz/tips/linux-raid-increase-resync-rebuild-speed.html

https://www.advancedclustering.com/act_kb/how-to-locate-a-physical-disk-in-an-lsi-raid-array/

 

 

 

 

 

 

 

 

 

Stop Spam Harvesters, Join Project Honey Pot

 

Get a free SSL certificate!

 

The leading nonprofit defending digital privacy, free speech, and innovation.

 

The Linux Foundation provides a neutral, trusted hub for developers and organizations to code, manage, and scale open technology projects and ecosystems.

 

Kubuntu is an operating system built by a worldwide community of developers, testers, supporters and translators.

 

 43ef5c89 CanonicalUbuntudarktext