Archive for the ‘Raid’ Category

Even though the parted command shows the partition as ext3, you can format it as ext4.

(parted) mklabel gpt
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to
continue?
Yes/No? Yes                                                               
(parted) unit TB
(parted) mkpart primary 0.00TB 10.00TB
(parted) p                                                                
Model: LSI MR9261-8i (scsi)
Disk /dev/sda: 9.99TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      0.00TB  9.99TB  9.99TB  ext3         primary

(parted) quit                                                             
Information: You may need to update /etc/fstab.

[root@mh ~]# mkfs.ext4 /dev/sda1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
305025024 inodes, 2440183808 blocks
122009190 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
74469 block groups
32768 blocks per group, 32768 fragments per group
4096 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544, 1934917632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done       

[root@mh ~]# blkid
/dev/sda1: UUID="1485be35-8319-4a49-b0bd-9ee465303b41" TYPE="ext4" PARTLABEL="primary" PARTUUID="a7f0e3ef-3e72-4bc9-849a-90dde882f07f" 
/dev/sdb1: UUID="6ca14ed0-e5e0-422a-9e82-ea72fc84516b" TYPE="ext4" 
/dev/sdb2: UUID="ceb6e531-4a0a-49b9-9e59-d8f1ae4593c6" TYPE="swap" 
/dev/sdb3: UUID="ab27cea4-abc8-49d8-894f-2c39408b196f" TYPE="ext4" 
[root@mh ~]# blkid|grep sda
/dev/sda1: UUID="1485be35-8319-4a49-b0bd-9ee465303b41" TYPE="ext4" PARTLABEL="primary" PARTUUID="a7f0e3ef-3e72-4bc9-849a-90dde882f07f" 
[root@mh ~]# blkid|grep sda >> /etc/fstab
[root@mh ~]# vi /etc/fstab
[root@mh ~]# mount -a

Commands to use to partition a new 3TB disk with parted.

[ ~]# parted /dev/sdg
GNU Parted 2.1
Using /dev/sdg
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Error: /dev/sdg: unrecognised disk label                                  
(parted) mklabel gpt                                                  
(parted) mkpart primary ext3 1 -1                                         
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? C                                                          
(parted) print                                                            
Model: ASMT 2105 (scsi)
Disk /dev/sdg: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart                                                           
Partition name?  []?                                                      
File system type?  [ext2]? ext3                                           
Start? 0%                                                                 
End? 100%

Using percentages worked better than trying to specify the start/stop sectors. Not sure why.

[ ~]# mkfs.ext3 /dev/sdg1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
183148544 inodes, 732566272 blocks
36628313 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
22357 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544

[ ~]# tune2fs -c0 -i0 /dev/sdg1

The spare disk on one of my raids failed. Here’s how to replace.

[root@cp x86_64]# ./tw_cli 
//cp> info

Ctl   Model        (V)Ports  Drives   Units   NotOpt  RRate   VRate  BBU
------------------------------------------------------------------------
c8    9650SE-8LPML 8         6        1       0       1       1      -        

//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     DEVICE-ERROR     u?     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCASY8726207     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cps1> maint remove c8 p1
Removing port /c8/p1 ... Done.


//cp> info c8 

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     NOT-PRESENT      -      -           -             -
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCASY8726207     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     NOT-PRESENT      -      -           -             -
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCASY8726207     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               -      465.76 GB   976773168     WD-WMAYP5602245     
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCASY8726207     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cp> /c8/u0 start rebuild disk=1
Sending rebuild start request to /c8/u0 on 1 disk(s) [1] ... Failed.
(0x0B:0x0031): Unit is ok

//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               -      465.76 GB   976773168     WD-WMAYP5602245     
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCASY8726207     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cp> /c8 add type=spare disk=1
Creating new unit on controller /c8 ... Done. The new unit is /c8/u1.
WARNING: This Spare unit may replace failed drive of same interface type only.

//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    
u1    SPARE     OK             -       -       -       465.753   -      OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u1     465.76 GB   976773168     WD-WMAYP5602245     
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCASY8726207     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cp> 
[root@cps4 ~]# parted /dev/sda
GNU Parted 2.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: LSI 9750-8i DISK (scsi)
Disk /dev/sda: 12.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

(parted) mklabel gpt                                                      
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? Yes                                                               
(parted) mkpart primary 0 -0                                              
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Cancel                                                     

(parted) mkpart primary ext3 1 -1
(parted) print                                                            
Model: LSI 9750-8i DISK (scsi)
Disk /dev/sda: 12.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  12.0TB  12.0TB               primary

[root@cps4 ~]# mkfs -t ext3 /dev/sda1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
732422144 inodes, 2929670656 blocks
146483532 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
89407 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544, 1934917632, 
	2560000000

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@cps4 ~]# tune2fs -c0 -i0 /dev/sda1
tune2fs 1.41.12 (17-May-2010)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds

If after installing a new drive in a raid, you get a message that looks like this:

//server> info c10

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    REBUILD-PAUSED 0%      -       64K     1862.61   OFF    OFF    
u1    RAID-5    OK             -       -       64K     931.303   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCAPW2109877     
p1     OK               u0     465.76 GB   976773168     WD-WCAPW2283896     
p2     OK               u0     465.76 GB   976773168     WD-WCAPW1745426     
p3     OK               u0     465.76 GB   976773168     WD-WCAPW2222501     
p4     DEGRADED         u0     465.76 GB   976773168     WD-WMAYP5244596     
p5     OK               u1     465.76 GB   976773168     WD-WMAYP2574338     
p6     OK               u1     465.76 GB   976773168     WD-WCAPW5103350     
p7     OK               u1     465.76 GB   976773168     WD-WCAPW5251276     

Quit tw_cli and run this from the command line:

[~]# ./tw_cli sched rebuild c10 enable

The raid should then start rebuilding immediately.

I think you could also run this from inside the tw_cli program, but I didn’t try it.

/c10 set rebuild=enable
C:\Documents and Settings\Administrator\Desktop\tw_cli-windows-x86-9.4.1.3>tw_cli.exe
//EDGWIN> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1629.74   ON     OFF

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     233.76 GB   490234752     WD-WCANY2312070
p1     OK               u0     233.76 GB   490234752     WD-WCANY2311250
p2     DEVICE-ERROR     u0     233.76 GB   490234752     WD-WCANY1796905
p3     OK               u0     233.76 GB   490234752     WD-WCANY2265331
p4     OK               u0     233.81 GB   490350672     WD-WCAT1A636279
p5     OK               u0     233.81 GB   490350672     WD-WMAYP3458409
p6     OK               u0     233.76 GB   490234752     WD-WCANY2312032
p7     OK               u0     233.81 GB   490350672     WD-WCAT1H074670

//EDGWIN> maint remove c0 p2
Removing port /c0/p2 ... Done.


//EDGWIN> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    DEGRADED       -       -       64K     1629.74   OFF    OFF

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     233.76 GB   490234752     WD-WCANY2312070
p1     OK               u0     233.76 GB   490234752     WD-WCANY2311250
p2     NOT-PRESENT      -      -           -             -
p3     OK               u0     233.76 GB   490234752     WD-WCANY2265331
p4     OK               u0     233.81 GB   490350672     WD-WCAT1A636279
p5     OK               u0     233.81 GB   490350672     WD-WMAYP3458409
p6     OK               u0     233.76 GB   490234752     WD-WCANY2312032
p7     OK               u0     233.81 GB   490350672     WD-WCAT1H074670

//EDGWIN> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    DEGRADED       -       -       64K     1629.74   OFF    OFF

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     233.76 GB   490234752     WD-WCANY2312070
p1     OK               u0     233.76 GB   490234752     WD-WCANY2311250
p2     NOT-PRESENT      -      -           -             -
p3     OK               u0     233.76 GB   490234752     WD-WCANY2265331
p4     OK               u0     233.81 GB   490350672     WD-WCAT1A636279
p5     OK               u0     233.81 GB   490350672     WD-WMAYP3458409
p6     OK               u0     233.76 GB   490234752     WD-WCANY2312032
p7     OK               u0     233.81 GB   490350672     WD-WCAT1H074670

//EDGWIN> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    DEGRADED       -       -       64K     1629.74   OFF    OFF

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     233.76 GB   490234752     WD-WCANY2312070
p1     OK               u0     233.76 GB   490234752     WD-WCANY2311250
p2     NOT-PRESENT      -      -           -             -
p3     OK               u0     233.76 GB   490234752     WD-WCANY2265331
p4     OK               u0     233.81 GB   490350672     WD-WCAT1A636279
p5     OK               u0     233.81 GB   490350672     WD-WMAYP3458409
p6     OK               u0     233.76 GB   490234752     WD-WCANY2312032
p7     OK               u0     233.81 GB   490350672     WD-WCAT1H074670

//EDGWIN> rescan
Rescanning controller /c0 for units and drives ...Done.
Found the following unit(s): [none].
Found the following drive(s): [none].

//EDGWIN> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    DEGRADED       -       -       64K     1629.74   OFF    OFF

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     233.76 GB   490234752     WD-WCANY2312070
p1     OK               u0     233.76 GB   490234752     WD-WCANY2311250
p2     OK               -      233.81 GB   490350672     WD-WMAYP3479443
p3     OK               u0     233.76 GB   490234752     WD-WCANY2265331
p4     OK               u0     233.81 GB   490350672     WD-WCAT1A636279
p5     OK               u0     233.81 GB   490350672     WD-WMAYP3458409
p6     OK               u0     233.76 GB   490234752     WD-WCANY2312032
p7     OK               u0     233.81 GB   490350672     WD-WCAT1H074670

//EDGWIN> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    DEGRADED       -       -       64K     1629.74   OFF    OFF

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     233.76 GB   490234752     WD-WCANY2312070
p1     OK               u0     233.76 GB   490234752     WD-WCANY2311250
p2     OK               -      233.81 GB   490350672     WD-WMAYP3479443
p3     DEVICE-ERROR     u0     233.76 GB   490234752     WD-WCANY2265331
p4     OK               u0     233.81 GB   490350672     WD-WCAT1A636279
p5     OK               u0     233.81 GB   490350672     WD-WMAYP3458409
p6     OK               u0     233.76 GB   490234752     WD-WCANY2312032
p7     OK               u0     233.81 GB   490350672     WD-WCAT1H074670

//EDGWIN> /c0/u0 start rebuild disk=2
Sending rebuild start request to /c0/u0 on 1 disk(s) [2] ... Done.


//EDGWIN> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    REBUILDING     0       -       64K     1629.74   OFF    OFF

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     233.76 GB   490234752     WD-WCANY2312070
p1     OK               u0     233.76 GB   490234752     WD-WCANY2311250
p2     DEGRADED         u0     233.81 GB   490350672     WD-WMAYP3479443
p3     OK               u0     233.76 GB   490234752     WD-WCANY2265331
p4     OK               u0     233.81 GB   490350672     WD-WCAT1A636279
p5     OK               u0     233.81 GB   490350672     WD-WMAYP3458409
p6     OK               u0     233.76 GB   490234752     WD-WCANY2312032
p7     OK               u0     233.81 GB   490350672     WD-WCAT1H074670
[~]# ./tw_cli 
//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u?     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cp> rescan
Rescanning controller /c8 for units and drives ...Done.
Found the following unit(s): [/c8/u1].
Found the following drive(s): [none].

//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    
u1    RAID-5    INOPERABLE     -       -       64K     1862.61   OFF    OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u1     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cp> /c8/u1 del
Deleting /c8/u1 will cause the data on the unit to be permanently lost.
Do you want to continue ? Y|N [N]: Y
Deleting unit c8/u1 ...Done.


//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               -      465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cp> /c8 add type=spare disk=5
Creating new unit on controller /c8 ... Done. The new unit is /c8/u1.
WARNING: This Spare unit may replace failed drive of same interface type only.

//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    
u1    SPARE     OK             -       -       -       465.753   -      OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u1     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

This one was easy.

[root@cdfs tw_cli]# ./tw_cli
//cdfs> info c0

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    OK             -      64K     1396.95   ON     OFF      OFF      
u1    RAID-5    OK             -      64K     1396.95   ON     OFF      ON       

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WMASY6064174     
p1     OK               u0     465.76 GB   976773168     WD-WCANU1090078     
p2     OK               u0     465.76 GB   976773168     WD-WCANU1119743     
p3     OK               u0     465.76 GB   976773168     WD-WCANU1089924     
p4     OK               u1     465.76 GB   976773168     WD-WMASY8103731     
p5     SMART-FAILURE    u1     465.76 GB   976773168     WD-WCANU1109927     
p6     OK               u1     465.76 GB   976773168     WD-WCAPW5103756     
p7     OK               u1     465.76 GB   976773168     WD-WCANU1125288     

//cdfs> maint remove c0 p5
Exporting port /c0/p5 ... Done.


//cdfs> info c0

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    OK             -      64K     1396.95   ON     OFF      OFF      
u1    RAID-5    DEGRADED       -      64K     1396.95   OFF    OFF      ON       

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WMASY6064174     
p1     OK               u0     465.76 GB   976773168     WD-WCANU1090078     
p2     OK               u0     465.76 GB   976773168     WD-WCANU1119743     
p3     OK               u0     465.76 GB   976773168     WD-WCANU1089924     
p4     OK               u1     465.76 GB   976773168     WD-WMASY8103731     
p5     NOT-PRESENT      -      -           -             -
p6     OK               u1     465.76 GB   976773168     WD-WCAPW5103756     
p7     OK               u1     465.76 GB   976773168     WD-WCANU1125288     

//cdfs> rescan
Rescanning controller /c0 for units and drives ...Done.
Found the following unit(s): [none].
Found the following drive(s): [none].

//cdfs> info c0

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    OK             -      64K     1396.95   ON     OFF      OFF      
u1    RAID-5    DEGRADED       -      64K     1396.95   OFF    OFF      ON       

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WMASY6064174     
p1     OK               u0     465.76 GB   976773168     WD-WCANU1090078     
p2     OK               u0     465.76 GB   976773168     WD-WCANU1119743     
p3     OK               u0     465.76 GB   976773168     WD-WCANU1089924     
p4     OK               u1     465.76 GB   976773168     WD-WMASY8103731     
p5     OK               -      465.76 GB   976773168     WD-WCAPW2252807     
p6     OK               u1     465.76 GB   976773168     WD-WCAPW5103756     
p7     OK               u1     465.76 GB   976773168     WD-WCANU1125288     

//cdfs> /c0/u1 start rebuild disk=5 ignoreecc
Sending rebuild start request to /c0/u1 on 1 disk(s) [5] ... Done.


//cdfs> info c0

Unit  UnitType  Status         %Cmpl  Stripe  Size(GB)  Cache  AVerify  IgnECC
------------------------------------------------------------------------------
u0    RAID-5    OK             -      64K     1396.95   ON     OFF      OFF      
u1    RAID-5    REBUILDING     0      64K     1396.95   OFF    OFF      ON       

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WMASY6064174     
p1     OK               u0     465.76 GB   976773168     WD-WCANU1090078     
p2     OK               u0     465.76 GB   976773168     WD-WCANU1119743     
p3     OK               u0     465.76 GB   976773168     WD-WCANU1089924     
p4     OK               u1     465.76 GB   976773168     WD-WMASY8103731     
p5     DEGRADED         u1     465.76 GB   976773168     WD-WCAPW2252807     
p6     OK               u1     465.76 GB   976773168     WD-WCAPW5103756     
p7     OK               u1     465.76 GB   976773168     WD-WCANU1125288     

//cdfs>  

After rebooting a node with a spare drive in the raid, I got errors saying that the spare drive was an inoperable unit.

//cps1> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    
u1    RAID-5    INOPERABLE     -       -       64K     1862.61   OFF    OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u1     465.76 GB   976773168     WD-WCANU2030999     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

To fix this, I just deleted the unit (u1) and added the disk back as a spare.

//cps1> /c0/u1 del
Deleting /c0/u1 will cause the data on the unit to be permanently lost.
Do you want to continue ? Y|N [N]: Y
Deleting unit c0/u1 ...Done.


//cps1> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               -      465.76 GB   976773168     WD-WCANU2030999     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cps1> /c0 add type=spare disk=2
Creating new unit on controller /c0 ... Done. The new unit is /c0/u1.
WARNING: This Spare unit may replace failed drive of same interface type only.

//cps1> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    
u1    SPARE     OK             -       -       -       465.753   -      OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u1     465.76 GB   976773168     WD-WCANU2030999     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

That is how it should look.

I had set up one of our raids with a spare drive. A disk in this raid failed last night and the spare was used immediately. Unfortunately, I forgot that this raid had a spare, so I spent a bit of time trying to figure out why the new disk would not rebuild. But eventually, things worked again. Here’s my log:

[root@cps1 ~]# cd tw_cli
[root@cps1 tw_cli]# ./tw_cli 
//cps1> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u0     465.76 GB   976773168     WD-WCANU2030999     
p3     DEVICE-ERROR     u?     465.76 GB   976773168     WD-WCANU2021246     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

The first thing I should have noticed is that the raid was ok. Normally, if there’s a bad drive it shows up as degraded. But, I completely missed that fact and tried to rebuild it.

//cps1> maint remove c0 p3
Removing port /c0/p3 ... Done.


//cps1> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u0     465.76 GB   976773168     WD-WCANU2030999     
p3     NOT-PRESENT      -      -           -             -
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cps1> rescan
Rescanning controller /c0 for units and drives ...Done.
Found the following unit(s): [/c0/u1].
Found the following drive(s): [none].

//cps1> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    
u1    RAID-5    INOPERABLE     -       -       64K     1862.61   OFF    OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u0     465.76 GB   976773168     WD-WCANU2030999     
p3     OK               u1     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cps1> /c0/u0 start rebuild disk=3 ignoreecc
The following drive(s) cannot be used [3].
Error: (CLI:144) Invalid drive(s) specified.

I don’t need to list at all the other dumb commands I ran. All I needed to do was this.

//cps1> /c0/u1 del
Deleting /c0/u1 will cause the data on the unit to be permanently lost.
Do you want to continue ? Y|N [N]: Y
Deleting unit c0/u1 ...Done.

//cps1> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u0     465.76 GB   976773168     WD-WCANU2030999     
p3     OK               -      465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cps1> /c0 add type=spare disk=3
Creating new unit on controller /c0 ... Done. The new unit is /c0/u1.
WARNING: This Spare unit may replace failed drive of same interface type only.

//cps1> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    
u1    SPARE     OK             -       -       -       465.753   -      OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u0     465.76 GB   976773168     WD-WCANU2030999     
p3     OK               u1     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

That’s how it should look.