readme.fr

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).

requirement

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

Debian

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

wget -O - http://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key | sudo apt-key add -
http://hwraid.le-vert.net/wiki/DebianPackages

 

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

Find your controller brand

lspci  | grep RAID

 

3ware

 Installation

apt-get install tw-cli

Usage

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

Help

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

Areca

Installation

Documentation

Usage

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=192.168.5.5
cli net netmask p=255.255.255.0
cli net gateway p=192.168.5.1

Snmp configuration

Configure comunity, email contact and host name

cli snmp community p=password
cli snmp contact p=admin@email.com
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

Driver

wget http://www.areca.us/support/s_linux/driver/arcmsr-1.30.0X.19-20140829.zip

unzip arcmsr-1.30.0X.19-20140829.zip
cd arcmsr.*
make && make install
modprobe arcmsr

 

 

HP / Hpacucli

Installation

#debian
apt-get install hpacucli

#or rpm
rpm -i ftp://ftp.hp.com/pub/softlib2/software1/pubsw-linux/p414707558/v59422/hpacucli-8.50-6.0.noarch.rpm

Usage

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

Informations

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

Managment

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

Installation

apt-get install megacli

Documentation

Usage

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

Configuration

Clear / Delete raid configuration

megacli  -CfgClr -aALL

Backup / restore configuration

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

Rebuild

Manage autorebuild

#Display current value
megacli -AdpAutoRbld -Dsply -a0  

#Disable
megacli -AdpAutoRbld -Dsbl -a0

#Enable
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

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

Cache

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

Firmware

Find your product name

megacli -AdpAllInfo -aALL | grep Product

Download your firmware

  • http://www.dell.com/support/home/hr/en/hrdhs1/Drivers/DriversDetails?driverId=5V9YM

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
talset on Githubtalset on Linkedin

, , , , , ,

Leave a Reply

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