Category Archives: Raid Stuff

3ware Raid Controller Switch of autoverify

To Switch of the autoverify feature on a 3ware controller which can be a real performance killer do the following:

First check the current status:

tw_cli /c0/u0 show autoverify
/c0/u0 Auto Verify Policy = on

As you can see the autoverify feature is on Auto Verify Policy = on. If your raid controller is also c0 and you unit is u0 you may use the following command. Please check this first with the command:

tw_cli /c0 show

Do not just copy and paste. If c0 doesn’t work try a higher number it depends on which pci slot your controller is in.

tw_cli /c0/u0 set autoverify=off
Setting Auto-Verify Policy on /c0/u0 to [off] ... Done.

Check the autoverify settings:

tw_cli /c0/u0 show autoverify
/c0/u0 Auto Verify Policy = off

That’s it no more autoverify. Please make sure to check you raid status regularly to detect problems.

Manage HP Raid Controllers with hpacucli

This document is a quick cheat sheet on how to use the hpacucli utility to add, delete, identify and repair logical and physical disks on the HP Smart array controller. Some of these commands may need slight modifications. Please do not just copy and paste if you are not 100% sure what you are doing you may lose all of you data.


Utility Keyword abbreviations
Abbreviations chassisname = ch
controller = ctrl
logicaldrive = ld
physicaldrive = pd

drivewritecache = dwc

hpacucli utility
hpacucli # hpacucli

# hpacucli help

Note: you can use the hpacucli command in a script

Controller Commands
Display (detailed) hpacucli> ctrl all show config
hpacucli> ctrl all show config detail
Status hpacucli> ctrl all show status
Cache hpacucli> ctrl slot=0 modify dwc=disable
hpacucli> ctrl slot=0 modify dwc=enable
Rescan hpacucli> rescan

Note: detects newly added devices since the last rescan

Physical Drive Commands
Display (detailed) hpacucli> ctrl slot=0 pd all show
hpacucli> ctrl slot=0 pd 2:3 show detail

Note: you can obtain the slot number by displaying the controller configuration (see above)

Status

hpacucli> ctrl slot=0 pd all show status

hpacucli> ctrl slot=0 pd 2:3 show status

Erase hpacucli> ctrl slot=0 pd 2:3 modify erase
Blink disk LED hpacucli> ctrl slot=0 pd 2:3 modify led=on

hpacucli> ctrl slot=0 pd 2:3 modify led=off

Logical Drive Commands
Display (detailed) hpacucli> ctrl slot=0 ld all show [detail]
hpacucli> ctrl slot=0 ld 4 show [detail]
Status hpacucli> ctrl slot=0 ld all show status
hpacucli> ctrl slot=0 ld 4 show status
Blink disk LED hpacucli> ctrl slot=0 ld 4 modify led=on
hpacucli> ctrl slot=0 ld 4 modify led=off
re-enabling failed drive hpacucli> ctrl slot=0 ld 4 modify reenable forced
Create # logical drive – one disk
hpacucli> ctrl slot=0 create type=ld drives=1:12 raid=0

# logical drive – mirrored
hpacucli> ctrl slot=0 create type=ld drives=1:13,1:14 size=300 raid=1

# logical drive – raid 5
hpacucli> ctrl slot=0 create type=ld drives=1:13,1:14,1:15,1:16,1:17 raid=5

Note:

drives – specific drives, all drives or unassigned drives
size – size of the logical drive in MB
raid – type of raid 0, 1 , 1+0 and 5

Remove hpacucli> ctrl slot=0 ld 4 delete
Expanding hpacucli> ctrl slot=0 ld 4 add drives=2:3
Extending hpacucli> ctrl slot=0 ld 4 modify size=500 forced
Spare hpacucli> ctrl slot=0 array all add spares=1:5,1:7


Activate the write cache on a 3ware Raid controller

Without the write cache 3ware raid contollers can be painfuly slow. To activate the write cache do the following. First find the correct number of you raid controller. And also the unit that you would like to switch the cache on for.

tw_cli /c0 show

Unit UnitType Status %RCmpl %V/I/M Stripe Size(GB) Cache AVrfy
——————————————————————————
u0 RAID-1 OK – – – 153.385 – –

Port Status Unit Size Blocks Serial
—————————————————————
p0 OK u0 153.38 GB 321672960 WD-WCANM3649095
p1 OK u0 153.38 GB 321672960 WD-WCANM3649568

The command: tw_cli /c0 show gives you an overwiew of the first controller in the system. If you have more than one controller you can use c2 c3 and so on. Now we know that we have one raid controller and also one unit we can switch on the cache for it.

tw_cli set cache c0 u0 on

This command will switch on the write cache for the first controller 0 and unit 0. If you have more than one controller or units please repeat this step. Afterwards check that the cache has been activated:

server142:~# tw_cli /c0 show

Unit UnitType Status %RCmpl %V/I/M Stripe Size(GB) Cache AVrfy
——————————————————————————
u0 RAID-1 OK – – – 153.385 W –

Port Status Unit Size Blocks Serial
—————————————————————
p0 OK u0 153.38 GB 321672960 WD-WCANM3649095
p1 OK u0 153.38 GB 321672960 WD-WCANM3649568

Notice the W next to Cache thats it you have increased your write performance. Please remember that you can lose data if you activate the write cache without a battery backup unit. On a power loss you will lose the cached data. 3ware only produces battery backup units for the larger controllers 4 port and greater which sucks.

Add a spare disk to a 3ware Raid Controller

This guide assumes you have already installed the 3ware software tw_cli. Which is a command line tool to configure 3ware raid controllers. To use an emtpy unconfigured disk as a spare raid disk do the following:

tw_cli /c0 add type=spare disk=1

Creating new unit on controller /c0 ... Done. The new unit is /c0/u1.

The disk number is the port number of the disk you would like to use. To get a list of all the attached disks use the folllowing command:

tw_cli /c0 show

Please do not use any of these commands without exactly knowing what you are doing. You can lose all of you data or delete you entire raid array. Please check the man page:

3ware tw_cli Man Page

3ware RAID Controller

Check the card

To enter the 3ware command line interface, type tw_cli. Enter ? or help to view help. For more information about the 3ware CLI, see the man page or the 3ware knowledge base linked at the bottom of this document.

First we need some info on our setup:

Code: Getting info on setup

3ware CLI> info
List of controllers
Controller 0: 8006-2LP (2)

Here we see that we have one controller 0 with two drives. Let’s get more info on controller 0.

Code: Getting info on controller 0

3ware CLI> info c0
Controller: c0
Driver:   1.02.00.033
Model:    8006-2LP
FW:       FE7S 1.05.00.065
BIOS:     BE7X 1.08.00.048
Monitor:  ME7X 1.01.00.038
Serial #: F14902A4110263
PCB:      Rev5
PCHIP:    1.30-66
ACHIP:    3.20
# of units: 1
Unit 0: RAID 1 111.79 GB ( 234439600 blocks): DEGRADED
# of ports: 2
Port 0: WDC WD1200JD-22GBB0 WD-WMAET1426272 111.79 GB (234441648 blocks): OK(unit 0)
Port 1: WDC WD1200JD-00GBB0 WD-WMAET1626327 111.79 GB (234441648 blocks): OK(unit 0)

Now we can see the RAID at unit 0 is degraded. Let’s find out which disk is giving us a problem. For the rest of the document, I’ll exit from the program and run it as a command instead.

Code: Finding out which disk is degraded

[root@myputer ~]# tw_cli info c0 u0
Unit /c0/u0
Status:        DEGRADED
Unit Type:     RAID 1
Stripe Size:   N/A
Size: 111.79 GB (234439600 blocks)
# of subunits: 2
Subunit 0:    CBOD: OK
Physical Port: 0
Logical  Port: 0
Subunit 1:    CBOD: DEGRADED
Physical Port: 1
Logical  Port: 1

Ok, port 1 is the disk that needs our attention.

Rebuild The RAID

First we need to remove the drive. This is like unmounting a filesystem so that we can work on it.

Code: Removing the drive

[root@myputer ~]# tw_cli maint remove c0 p1
Removing port /c0/p1 ... Done.

Now let’s have the software rescan the drives.

Code: Rescaning the drives

[root@myputer ~]# tw_cli maint rescan c0
Rescanning controller /c0 for units and drives ...Done.

At this point, we need to see if the rescan picked the drive back up. If the port is N/A this is likey a bad drive and isn’t responding. You’ll need to replace the drive and rescan:

Code: Checking if the rescan picked the drive back up

(Third party note: This is confusing, ignore this block. I suspect that this is supposed to be an example of a drive that is N/A, not a continuation of the example.)

[root@myputer ~]# tw_cli info c0 u0
Unit /c0/u0
Status:        DEGRADED
Unit Type:     RAID 1
Stripe Size:   N/A
Size:         111.79 GB (234439600 blocks)
# of subunits: 2
Subunit 0:    CBOD: DEGRADED
Physical Port: N/A
Logical  Port: 0
Subunit 1:    CBOD: OK
Physical Port: 1
Logical  Port: 1

Otherwise all that’s left to do is rebuild the drive.

Code: Rebuilding the drive

[root@myputer ~]# tw_cli maint rebuild c0 u0 p1
Rebuild started on unit /c0/u0

To check the status, just give it the info option

Code: Checking the status

[root@myputer ~]# tw_cli info c0 u0
Unit /c0/u0
---------------------
Status:        REBUILDING (0%)
Unit Type:     RAID 1
Stripe Size:   N/A
Size:          111.79 GB (234439600 blocks)
# of subunits: 2
Subunit 0:    CBOD: OK
Physical Port: 0
Logical  Port: 0
Subunit 1:    CBOD: DEGRADED
Physical Port: 1
Logical  Port: 1

Since it’s rebuilding as it’s running, this could take a really long time.

More Information

3ware Knowledge Base

Man page for tw_cli

Some notes from 3ware support

They said the way it should be done:
Assuming port0 is bad
1.tw_cli maint remove c0 p0
2. remove the Old drive and Hotswap a new drive
3. tw_cli maint rescan c0
This will bring the new drive up
4. tw_cli maint createunit c0 rspare p0
5. tw_cli maint rebuild c0 u0 p0

Check our knowledge base article’s for rebuild information.
https://www.3ware.com/3warekb/article.aspx?id=11647
https://www.3ware.com/3warekb/article.aspx?id=11956
https://www.3ware.com/3warekb/article.aspx?id=11306

This Howto is copied from the old gentoo wiki. Since the wiki is down and i need this information quite often.