3ware RAID maintenance with tw_cli


tw_cli is the Command Line Interface (CLI) for monitoring and maintaining 3ware RAID controllers. It can be used for all maintenance operations that can be performed through the 3dmd daemon or the system BIOS.

3Ware provide comprehensive documentation for tw_cli (see below). This document does not replace that documentation. Instead, it is a quick reference to show which commands are useful for resolving common problems.

In particular, this document does not detail the full syntax of commands. That information is available in the tw_cli online help.

This document assumes a basic understanding of RAID.


Available documentation


  1. Online help: invoke the CLI and type ‘help’.
  2. The manpage (only installed with recent versions): man tw_cli
  3. http://www.3ware.com/: follow ‘Service and Support’ → ‘Software downloads’

The Web documentation at http://www.3ware.com/ is generally useful only for very advanced cases.


Important safety tips

Most operations with the CLI are safe. Generally the system will protect you from ‘fat-finger’ errors. For example, the following commands will fail if they would destroy data:


  • maint remove
  • maint deleteunit (IF the device is in use…)

The most dangerous commands are:


maint deleteunit
(if the device is not mounted)
maint createunit
Can be used to recover a severely broken array, but this is a desperate move and outside the scope of this document. Don’t do it. Call the vendor instead. (A two-minute power cycle will often get the array back if you need it urgently.)


Don’t run alarms

The alarms command shows the alarms log, but also clears it! (Stupid design.) Please don’t run this command. If you do run it, be sure to save its output for the vendor.


Principal operations


Checking the status of controller, array or disk


list controllers in the machine
info c1
list the disks on controller 1 and their grouping into RAID arrays
info c1 u2
list the disks in RAID unit 2 and their status within the array. Useful to find out which disk is bad in a DEGRADED array.
info c1 p2
list the status of an individual disk
info c1 diag
for experts: show low-level error log output for the controller


Removing a disk


    maint remove c1 p2


Re-detecting a disk


rescan c1
maint rescan c1
maint add c1 p2


Rebuilding an array

If necessary, remove and re-detect the disk as above. Then:


    maint rebuild c1 u2 p2

If this fails with tw_cli then it is probably because the controller is a 7000-series. You will get the following message

Error: (CLI:022) Invalid operation(s) for the specified controller.

In this case, try the rebuild operation with /usr/sbin/tw_cli-7.7.0


Creating a RAID unit

Sysadmins should never need to do this. In general, the machines will be delivered with the RAID configuration already setup. Sometimes, it is necessary to re-do it.

Based on the configuration, it may be necessary to do maint deleteunit to clear up old units which are in incorrect configurations. After that, you can use the maint createunit to allocate the physical disks to their units.


maint createunit c1 rraid1 p2:3
maint createunit c1 rraid5 p0:1:2:3:4:5:6


Assigning a disk as a ‘hot spare’

Sysadmins may need to do this if the original hot-spare has been used and a new disk has been added by the vendor. Create a “RAID unit” consisting of a single disk:


    maint createunit c1 rspare p2


Invoking tw_cli

If you are running only a single command, you can give it on the command line:


    [root@lxfs6111 root]# tw_cli-7.7.0 maint rebuild c1 u0 p2
    Rebuild started on unit /c1/u0

Unfortunately the version of tw_cli is not the same everywhere. If in doubt, try invoking the CLI in the order shown below.

To check whether a given version of tw_cli runs on a machine, use the ‘info’ command:


    [root@lxfs6111 root]# tw_cli-7.7.0 info

If the tw_cli version works, you will see a list of controllers in the machine. If it doesn’t work, tw_cli will report that it cannot find any controllers. Try an earlier version.



This is the most up-to-date version of the CLI. It is available on all machines installed after early 2005.



This is the previous version. It has all important functionality and is usable on most servers.

You may also find on “e0” or “e1” servers running Red Hat 7.3; in this case, you should do a 3wareFirmwareUpgrade.



This is a very old version of the CLI. It lacks important functionality, but it is sometimes the only thing that works on legacy machines (e.g. systems running RHES 2).


REFERENCE : https://twiki.cern.ch/twiki/bin/view/FIOgroup/Tw_cli

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: