![3Ware 720-0192-00 Manual Download Page 17](http://html1.mh-extra.com/html/3ware/720-0192-00/720-0192-00_manual_3236248017.webp)
Chapter 1. Introduction to the 3ware Command Line Interface
9
3ware SAS/SATA RAID Controller CLI Guide, Version 9.5.2
Scripting examples
Following is a scripting example for a 4-port controller using a text file called
config_unit.txt, containing three commands. This example sets up a 4-port
controller with two units, each with 2 drives mirrored. It then prints the
configurations for verification. The commands included in the script file are:
/c0 add type=raid1 disk=0-1
/c0 add type=raid1 disk=2-3
/c0 show
Following is a scripting example for a 12-port controller using a text file
called config_unit.txt, containing three commands. This example sets up a 12-
port controller with two units: one with the first 2 drives mirrored, and another
with the remaining drives in a RAID 5 array. It then prints the configurations
for verification. The commands included in the script file are:
/c0 add type=raid1 disk=0-1
/c0 add type=raid5 disk=2-11
/c0 show
To run either of the scripts, enter:
tw_cli -f config_unit.txt
Outputting the CLI to a Text File
You can have the output of the 3ware CLI, including errors, sent to a text file
by adding 2>&1 to the end of the line. This could be useful, for example, if
you want to email the output to LSI Technical Support.
Examples
tw_cli /c2/p0 show >> controller2port0info.txt 2>&1
or
tw_cli /c0 show diag >> Logfile.txt 2>&1
Conventions
The following conventions are used through this guide:
•
In text,
monospace font
is used for code and for things you type.
•
In descriptions and explanations of commands, a bold font indicates the
name of commands and parameters, for example,
/c0/p0 show all
.
•
In commands, an italic font indicates items that are variable, but that you
must specify, such as a controller ID, or a unit ID, for example,
/c0/p0
show
attribute
, and
/cx/px show all
•
In commands, brackets around an item indicates that it is optional.
•
In commands, ellipses (...) indicate that more than one parameter at a time
can be included, for example,
/c0/p0 show
attribute [attribute ...]
, or that
Summary of Contents for 720-0192-00
Page 3: ......