Hot opensource news

Become friendly with RAID CLI

We have a lot of RAID technologies and it’s difficult to automate creation, managment … Below we will find bases commandes for 3ware (tw-cli), Areca (cli), Hp (hpacucli), Dell (megacli).


Before starting, ensure to have the good repository in your sourcelist


echo "deb$(lsb_release -s -c) branch main" > /etc/apt/sources.list.d/hwraid.list

wget -O - | sudo apt-key add -


If you haven’t¬†lsb-release package installed, change the distrib codename manually.

Find your controller brand

lspci  | grep RAID




apt-get install tw-cli


Display controller list

tw-cli show

Display details of controller 0

tw-cli /c0 show all

Display connected physical drives

tw-cli /c0 show phy

Display raid volumes

tw-cli /c0 show unitstatus

Display volume 0 state

tw-cli /c0/u0 show

Display state of physical drive 3

tw-cli /c0/p3 show

Rescan drives connected on controller

tw-cli /c0 rescan

Remove a drive

tw-cli /c0/p0 remove

Start rebuild with the new drive

tw-cli maint rebuild c0 u0 p0


tw_cli help
tw_cli /c0 help
tw_cli /c0/u0 help





To run command you have to set the selected controller password. exemple with controller1 and password 0000

cli set curctrl=1 password=0000

Display all RAID sets information

cli rsf info
#or only for raid1
cli rsf info raid=1

Delete a raid

cli rsf delete raid=1

Display physical drive connected on the controller

cli disk info
cli disk info drv=X

Create a RAID set with drive 1 and 2

cli rsf create drv=1,2 name=raidset1

Create a volume RAID

#vsf create <raid=xx> <capacity=xxx> <level=<0:1:3:5:6>> [ch=<0>] [id=<0~15>] [lun=<0~7>] <name=xxx> [tag=<Y:N>] [cache=<Y:N>] [stripe=<4:8:16:32:64:128>] [fginit=<Y:N>]

cli vsf create raid=1 capacity=2000 level=1 name=volume1 fginit=N

Display controller configuration

cli sys showcfg

Change priority of disk in port 2 to speed up raid rebuild

cli sys changept p=2

Verify the rebuild progress

cli vsf info

Display details of raid volume 2

cli vsf info vol=2

To prevent removing the wrong drive. Active LED blinking on drive 19

cli disk identify drv=19

Network configuration

Display current IP

cli net info

Enable DHCP

cli net dhcp p=1

Fixe Ip address, netmask and gateway

cli net ipaddr p=
cli net netmask p=
cli net gateway p=

Snmp configuration

Configure comunity, email contact and host name

cli snmp community p=password
cli snmp contact
cli snmp location p=hostname

NTP configuration

Set Paris timezone

cli ntp timezone p=29
cli ntp daylightsaving p=0

Update firmware

cli sys updatefw path=ARC1880FIRM.BIN
cli sys updatefw path=ARC1880BOOT.BIN



cd arcmsr.*
make && make install
modprobe arcmsr



HP / Hpacucli


apt-get install hpacucli

#or rpm
rpm -i


Useful to know : To expand RAID size, it requires that the controller board has a battery. Otherwise, the option is not available.


Display raid controllers and serial number

hpacucli ctrl all show

Display status of raid controllers

hpacucli ctrl all show status

Display drive connected on the raid controller slot 0

hpacucli ctrl slot=0 pd all show

Display details of controller 0 (cache …)

hpacucli ctrl slot=0 show

Display configuration of controller 0

hpacucli ctrl slot=0 show config
hpacucli ctrl slot=0 show config detail

Status of raid volumes

hpacucli ctrl slot=0 logicaldrive all show status

Display features of volume (logicaldrive) 1

hpacucli ctrl slot=0 ld 1 show

Display features of a drive

#find a S:E (slot:enclosure)
hpacucli ctrl slot=0 physicaldrive all show

#Select your drive
hpacucli ctrl slot=0 physicaldrive 1I:1:1 show


Delete raid on controller 0

hpacucli ctrl slot=0 delete forced

Create a RAID 1 volume

hpacucli ctrl slot=0 create type=ld drives=1I:1:1,1I:1:2 raid=1

Expand volume size

hpacucli ctrl slot=1 ld 1 modify size=max

If you controller haven’t cache, enable drive cache

hpacucli ctrl slot=5 modify dwc=enable

Sets the array accelerator cache ratio for the controller

hpacucli ctrl slot=0 ld 1 modify arrayaccelerator=enable

hpacucli ctrl slot=0 ld 1 modify cacheratio=25/75
# The first # is the read cache %.
# The second # is the write cache %.


Convert RAID 0 to RAID 1

If you need, add new drive in your volume

hpacucli ctrl slot=0 ld 1 add drives=2I:1:1

Modify raid type to RAID1

hpacucli ctrl slot=0 ld 1 modify raid=1


Dell / Perc6


apt-get install megacli



General stat

megacli  -LDInfo -L0 -aALL

Display the number of drive attach on controller 0

megacli -PDGetNum -a0

Display the number of virtual drive on controller 0

megacli -LDGetNum -a0


Clear / Delete raid configuration

megacli  -CfgClr -aALL

Backup / restore configuration

megacli -CfgSave -f FileName -aN
megacli -CfgRestore -f FileName -aN


Manage autorebuild

#Display current value
megacli -AdpAutoRbld -Dsply -a0  

megacli -AdpAutoRbld -Dsbl -a0

megacli -AdpAutoRbld -Enbl -a0

Manage rebuild rate

#Display current value
megacli -AdpGetProp RebuildRate -a0 

#Change to 60%
megacli -AdpSetProp RebuildRate 60 -a0

Physical drive

Status of drives

megacli -PDList -a0

Display rebuild progress for a drive [ Enclosure:slot ]

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


BBU status

megacli -AdpBbuCmd -GetBbuStatus -a0 | grep -e '^isSOHGood' -e '^Charger Status' -e '^Remaining Capacity' 

Manage array

Display available drives

megacli -PDlist -a0 | grep -e '^Enclosure Device ID:' -e '^Slot Number:'

Create RAID 6 [Enclosure:slot]

megacli -CfgLdAdd -r6 [0:0,0:1,0:2,0:3,0:4,0:5,0:6] -a0

Create RAID 10 [Enclosure:slot]

megacli -CfgSpanAdd -R10 -Array0[32:0,32:1] -Array1[32:2,32:3] -a0


Enable read cache

megacli -LDSetProp -Cached -LAll -aAll

#and ReadAhead
megacli -LDSetProp ADRA -LALL -aALL

Enable drive cache

megacli -LDSetProp EnDskCache -LAll -aAll

Enable write cache

megacli -LDSetProp WB -LALL -aALL
If you haven’t a battery disable cache
megacli -LDSetProp NoCachedBadBBU -LALL -aALL


Find your product name

megacli -AdpAllInfo -aALL | grep Product

Download your firmware


On debian you have to

apt-get install rpm procmail
mkdir tmpfiles
./RAID_FRMW_LX_R216024.BIN --extract tmpfiles
cd tmpfiles/payload

Firware update

megacli -AdpFwFlash -f FW612II.rom -aALL




talset on Githubtalset on Linkedin

, , , , , ,

Leave a Reply

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