Showing posts with label tw_cli command. Show all posts
Showing posts with label tw_cli command. Show all posts

Saturday, May 11, 2013

How to Change a Degraded Drive with tw_cli commandline?


A failed RAID set looks like this:


dev306:~# /opt/3Ware/bin/tw_cli
//dev306> info c0

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    DEGRADED       -      256K    1117.56   ON     OFF      OFF   

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     372.61 GB   781422768     3PM0Q56Z   
p1     OK               u0     372.61 GB   781422768     3PM0Q3YY   
p2     OK               u0     372.61 GB   781422768     3PM0PFT7   
p3     DEGRADED         u0     372.61 GB   781422768     3PM0Q3B7 

 

 

Now I will remove this bad disk from the RAID set:


//dev306> maint remove c0 p3
Exporting port /c0/p3 ... Done.

 

 

With the bad disk identified and replaced, now I need to go back into the 3Ware CLI and find the new disk, then tell the array to start rebuilding.


dev306:~# /opt/3Ware/bin/tw_cli
//dev306> maint rescan
Rescanning controller /c0 for units and drives ...Done.
Found the following unit(s): [none].
Found the following drive(s): [/c0/p3].


//dev306> maint rebuild c0 u0 p3
Sending rebuild start request to /c0/u0 on 1 disk(s) [3] ... Done.

//dev306> info c0

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    REBUILDING     0      256K    1117.56   ON     OFF      OFF   

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     372.61 GB   781422768     3PM0Q56Z   
p1     OK               u0     372.61 GB   781422768     3PM0Q3YY   
p2     OK               u0     372.61 GB   781422768     3PM0PFT7   
p3     DEGRADED         u0     372.61 GB   781422768     3PM0Q3B7 

 

Tuesday, May 7, 2013

tw_cli ChatSheet


How do I check the health of my 3ware RAID array under any Linux distribution? How do I access 3ware RAID Array web interface?

You need to download required command line tools from 3ware support web site. You can also find the same on driver cd / floppy disk. For example, I've downloaded a file called tw_cli-linux-x86_64-9.4.1.3.tgz for my 64 bit Linux server from above site. You need to get tool according to your device.


1. First you download "tw_cli" from LSI website -> Support


2. untar the tw_cli-linu.xxxxxxx.tgz


3. find and run "tw_cli" or "tw_cli.x86" or "tw_cli.x86_64", you will enter CLI command line


4. Show raid card information
   // localhostname> show
   
    Ctl   Model        (V)Ports  Drives   Units   NotOpt  RRate   VRate  BBU
    ------------------------------------------------------------------------
    c4    9650SE-8LPML 8         6        1       0       1       1      OK

    //localhostname>


5. From above example, your raid card has been detected as c4, to show detail raid information,
     //localhostname> /c4 show
     
    Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
    ------------------------------------------------------------------------------
    u0    RAID-6    OK             -       -       256K    7450.54   RiW    ON

    VPort Status         Unit Size      Type  Phy Encl-Slot    Model
    ------------------------------------------------------------------------------
    p0    OK             u0   1.82 TB   SATA  0   -            Hitachi HDS722020AL
    p1    OK             u0   1.82 TB   SATA  1   -            Hitachi HDS722020AL
    p2    OK             u0   1.82 TB   SATA  2   -            Hitachi HDS722020AL
    p3    OK             u0   1.82 TB   SATA  3   -            WDC WD2001FASS-00W2
    p4    OK             u0   1.82 TB   SATA  4   -            WDC WD2001FASS-00W2
    p5    OK             u0   1.82 TB   SATA  5   -            WDC WD2001FASS-00W2

    Name  OnlineState  BBUReady  Status    Volt     Temp     Hours  LastCapTest
    ---------------------------------------------------------------------------
    bbu   On           Yes       OK        OK       OK       0      xx-xxx-xxxx