AMCC 9500S, 9550SX Using a single command with output, Using an input file to execute a script

Page 13

Working with 3ware CLI

Using a single command with output

You can use 3ware CLI with line arguments, processing a single command at a time. To do so, simply enter the command and the arguments.

Single commands can be useful when you want to perform a task such as redirecting the output of the command to a file. It also allows you to use the command line history to eliminate some typing.

Syntax

tw_cli <command_line_arguments>

Example

tw_cli /c0 show diag > /tmp/3w_diag.out

Using an input file to execute a script

You can operate 3ware CLI scripts by executing a file. The file is a text file containing a list of CLI commands which you have entered in advance. Each command must be on a separate line.

Syntax

tw_cli -f <filename>

Where <filename> is the name of the text file you want to execute.

Example

tw_cli -f clicommand.txt

This example executes the file clicommand.txt, and runs the CLI commands included in that file.

Scripting example

Following is a scripting example 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 the script, enter:

tw_cli -f config_unit.txt

www.3ware.com

7

Image 13
Contents 3ware Serial ATA RAID Controller Command Line InterfaceCopyright Table of Contents 3ware Serial ATA RAID Controller CLI Guide Cx/ux set autoverify=onoff 3ware Serial ATA RAID Controller CLI Guide About this CLI Guide Features of the CLI Introduction to the 3ware Command Line InterfaceTerminology Supported Operating Systems Installing the 3ware CLI on Windows Installing the 3ware CLI To install 3ware CLI on Windows Permissions Required to Run CLITo start CLI, do one of the following Installing the 3ware CLI on Linux and FreeBSDWorking with 3ware CLI Using the command interface interactivelyTo use the CLI interactively Using an input file to execute a script Using a single command with outputScripting example Conventions Outputting the CLI to a Text FileRAID Concepts Understanding RAID Levels and ConceptsRAID Available RAID ConfigurationsRAID 1 Configuration Example RAID 5 Configuration Example RAID 6 Configuration Example RAID 10 Configuration Example Jbod Single DiskPossible Configurations Based on Number of Drives RAID Configuration TypesDetermining What RAID Level to Use Hot SpareDrive Capacity Using Drive Capacity EfficientlySupport for Over 2 Terabytes CLI Syntax Reference Common Tasks Mapped to CLI CommandsCLI Syntax Reference Port Tasks Syntax OverviewC1 add type=raid1 disk=0-1 Focus Object Shell Object CommandsExample ShowShow ver Show diag Show alarms reverseShow rebuild Show selftest Show verifyRescan FlushCommit Cx show Controller Object CommandsCx show Cx show attribute attribute Cx show driver Cx show biosCx show model Cx show firmwareCx show pcb Cx show serialCx show pchip Cx show achipCx show numunits Cx show numportsCx show ctlbus Cx show exportjbodCx show stagger Cx show spinupCx show ondegrade Cx show autocarveCx show memory Cx show carvesizeCx show unitstatus Cx show autorebuildCx show drivestatus Cx show allunitstatus3JV3MVTA Cx show allSupported RAID Types Supported Stripe Sizes KB Supported Model-Unit Types for ignoreECC Cx rescan noscan Cx flush Cx commitCx show alarms reverse Cx show rebuild Cx show diagRAID-5 Initializing Cx show verify Cx show selftest Cx add rebuild=dddhhduration Setting Up a Rebuild ScheduleCx add verify=dddhhduration Setting Up a Verify ScheduleCx add selftest=dddhh Setting Up a Selftest ScheduleCx del rebuild=slotid Cx set rebuild=enabledisable1..5Cx del verify=slotid Cx del selftest=slotidCx set selftest=enabledisable task=UDMASMART Cx set verify=enabledisable1..5Cx set ondegrade=cacheofffollow Cx set exportjbod=onoffCx set spinup=nn Cx set autocarve=onoff Cx set stagger=nnCx set carvesize=1024..2048 Cx set autodetect=onoff disk=p-pall Cx set autorebuild=onoffCx start mediascan Cx stop mediascan Unit Object CommandsCx/ux show Cx/ux show rebuildstatus Cx/ux show statusCx/ux show verifystatus Cx/ux show name Cx/ux show initializestatusCx/ux show serial Cx/ux show qpolicyCx/ux show identify Cx/ux show storsaveCx/ux show autoverify Cx/ux show cacheCx/ux show ignoreECC Cx/ux show volumesCx/ux show all Cx/ux remove noscan quiet Cx/ux start rebuild disk=pp-p...ignoreECC Cx/ux del noscan quietCx/ux pause rebuild Cx/ux start verifyCx/ux resume rebuild Supported RAID Logical Unit Types for VerificationCx/ux flush Cx/ux stop verifyCx/ux set autoverify=onoff Cx/ux set cache=onoff quietCx/ux set ignoreECC=onoff Cx/ux set identify=onoffSupported RAID Types for Caching Cx/ux set qpolicy=onoff Cx/ux set name=stringCx/ux set storsave=protectbalanceperform quiet Example 3ware Serial ATA RAID Controller CLI Guide Valid Migration Paths Supported Stripe Sizes Example of splitting a mirror Migration ProcessExample of capacity expansion Example of migrate output Cx/px show Port Object CommandsCx/px show model Cx/px show statusCx/px show serial Cx/px show firmwareCx/px show lspeed Cx/px show ncqCx/px show capacity Cx/px show smartCx/px show all Cx/px set identify=onoff Cx/px remove noscan quietCx/bbu show BBU Object CommandsCx/bbu show status Cx/bbu show attribute attributeCx/bbu show lasttest Cx/bbu show batinstCx/bbu show volt Cx/bbu show tempCx/bbu show serial Cx/bbu show bootloaderCx/bbu show fw Cx/bbu show pcbCx/bbu disable quiet Cx/bbu enableCx/bbu test quiet Ex show Enclosure Object CommandsEx show controllers Ex show attribute attributeEx show fans Ex show slotsEx show temp Ex show allEx/slotx show identify Ex/slotx showEx/slotx set identify=onoff Help with specific commands Help CommandsEx/fanx show Ex/tempx showAttribute attribute Help Help with attributesHelp show Help updateHelp flush Help rescanHelp /cx Help focusHelp /cx/ux Help /cx/pxReturn Code Command LoggingHelp /ex/fanx Help /ex/tempxIf you type