Changes between Initial Version and Version 1 of twRAID


Ignore:
Timestamp:
05/02/18 14:26:32 (6 years ago)
Author:
niles
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • twRAID

    v1 v1  
     1 
     2=== Setting up a RAID with 3ware's tw_cli tool === 
     3 
     4You typically start off just having plugged in your new disks, so your RAID might look something like : 
     5 
     6{{{ 
     7[root@netdrms02 ~]# tw_cli /c0 show 
     8 
     9Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy 
     10------------------------------------------------------------------------------ 
     11u0    RAID-1    OK             -       -       -       223.507   RiW    ON      
     12 
     13VPort Status         Unit Size      Type  Phy Encl-Slot    Model 
     14------------------------------------------------------------------------------ 
     15p0    OK             -    3.63 TB   SATA  0   -            WDC WD4002FYYZ-01B7  
     16p1    OK             -    3.63 TB   SATA  1   -            WDC WD4002FYYZ-01B7  
     17p2    OK             -    3.63 TB   SATA  2   -            WDC WD4002FYYZ-01B7  
     18p3    OK             -    3.63 TB   SATA  3   -            WDC WD4002FYYZ-01B7  
     19p4    OK             -    3.63 TB   SATA  4   -            WDC WD4002FYYZ-01B7  
     20p5    OK             -    3.63 TB   SATA  5   -            WDC WD4002FYYZ-01B7  
     21p6    OK             u0   223.57 GB SATA  6   -            INTEL SSDSC2BB240G7  
     22p7    OK             u0   223.57 GB SATA  7   -            INTEL SSDSC2BB240G7  
     23}}} 
     24 
     25We can see that there are six new Western Digital disks and two already existing INTEL disks. 
     26 
     27By the way, if your controller does not show up as /c0 then do "tw_cli show" to see available controllers, which in this case shows : 
     28 
     29{{{ 
     30[root@netdrms02 ~]# tw_cli show 
     31 
     32Ctl   Model        (V)Ports  Drives   Units   NotOpt  RRate   VRate  BBU 
     33------------------------------------------------------------------------ 
     34c0    9750-8i      8         8        4       0       1       1      -         
     35}}} 
     36 
     37Anyway, we are on controller /c0. We want to add a new RAID. I decided to add RAID type 5 using the first 4 disks, and using the last two new disks as spares. First, add the new RAID using the first 4 disks : 
     38 
     39{{{ 
     40[root@netdrms02 ~]# tw_cli /c0 add type=raid5 disk=0-3 stripe=256 name=INTERNAL autoverify 
     41Creating new unit on controller /c0 ... Done. The new unit is /c0/u1. 
     42Naming unit /c0/u1 to [INTERNAL] ... Done. 
     43Setting AutoVerify=ON for the new unit ... Done. 
     44Setting default Storsave policy to [balance] for the new unit ... Done. 
     45Setting default Command Queuing policy for unit /c0/u1 to [on] ... Done. 
     46Setting write cache = ON for the new unit ... Done. 
     47Warning: You do not have a battery backup unit for /c0/u1 and the enabled 
     48write cache (default) may cause data loss in the event of power failure. 
     49}}} 
     50 
     51And after that we have : 
     52 
     53{{{ 
     54[root@netdrms02 ~]# tw_cli /c0 show 
     55 
     56Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy 
     57------------------------------------------------------------------------------ 
     58u0    RAID-1    OK             -       -       -       223.507   RiW    ON      
     59u1    RAID-5    OK             -       -       256K    11175.8   RiW    ON      
     60 
     61VPort Status         Unit Size      Type  Phy Encl-Slot    Model 
     62------------------------------------------------------------------------------ 
     63p0    OK             u1   3.63 TB   SATA  0   -            WDC WD4002FYYZ-01B7  
     64p1    OK             u1   3.63 TB   SATA  1   -            WDC WD4002FYYZ-01B7  
     65p2    OK             u1   3.63 TB   SATA  2   -            WDC WD4002FYYZ-01B7  
     66p3    OK             u1   3.63 TB   SATA  3   -            WDC WD4002FYYZ-01B7  
     67p4    OK             -    3.63 TB   SATA  4   -            WDC WD4002FYYZ-01B7  
     68p5    OK             -    3.63 TB   SATA  5   -            WDC WD4002FYYZ-01B7  
     69p6    OK             u0   223.57 GB SATA  6   -            INTEL SSDSC2BB240G7  
     70p7    OK             u0   223.57 GB SATA  7   -            INTEL SSDSC2BB240G7  
     71 
     72}}} 
     73 
     74So we then want to add the last two disks as spares : 
     75 
     76{{{ 
     77[root@netdrms02 ~]# tw_cli /c0 add type=spare disk=4 
     78Creating new unit on controller /c0 ... Done. The new unit is /c0/u2. 
     79WARNING: This Spare unit may replace failed drive of same interface type only. 
     80 
     81[root@netdrms02 ~]# tw_cli /c0 add type=spare disk=5 
     82Creating new unit on controller /c0 ... Done. The new unit is /c0/u3. 
     83WARNING: This Spare unit may replace failed drive of same interface type only. 
     84}}} 
     85 
     86Which gives us : 
     87 
     88{{{ 
     89[root@netdrms02 ~]# tw_cli /c0 show 
     90 
     91Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy 
     92------------------------------------------------------------------------------ 
     93u0    RAID-1    OK             -       -       -       223.507   RiW    ON      
     94u1    RAID-5    OK             -       -       256K    11175.8   RiW    ON      
     95u2    SPARE     OK             -       -       -       3726.01   -      OFF     
     96u3    SPARE     OK             -       -       -       3726.01   -      OFF     
     97 
     98VPort Status         Unit Size      Type  Phy Encl-Slot    Model 
     99------------------------------------------------------------------------------ 
     100p0    OK             u1   3.63 TB   SATA  0   -            WDC WD4002FYYZ-01B7  
     101p1    OK             u1   3.63 TB   SATA  1   -            WDC WD4002FYYZ-01B7  
     102p2    OK             u1   3.63 TB   SATA  2   -            WDC WD4002FYYZ-01B7  
     103p3    OK             u1   3.63 TB   SATA  3   -            WDC WD4002FYYZ-01B7  
     104p4    OK             u2   3.63 TB   SATA  4   -            WDC WD4002FYYZ-01B7  
     105p5    OK             u3   3.63 TB   SATA  5   -            WDC WD4002FYYZ-01B7  
     106p6    OK             u0   223.57 GB SATA  6   -            INTEL SSDSC2BB240G7  
     107p7    OK             u0   223.57 GB SATA  7   -            INTEL SSDSC2BB240G7  
     108}}} 
     109 
     110 
     111At this point it's worth checking the settings on the new RAID : 
     112 
     113{{{ 
     114[root@netdrms02 ~]# tw_cli /c0/u1 show all 
     115/c0/u1 status = OK 
     116/c0/u1 is not rebuilding, its current state is OK 
     117/c0/u1 is not verifying, its current state is OK 
     118/c0/u1 is not initialized. 
     119/c0/u1 Write Cache = on 
     120/c0/u1 Read Cache = Intelligent 
     121/c0/u1 volume(s) = 1 
     122/c0/u1 name = INTERNAL              
     123/c0/u1 serial number = K3GVTMABEA21C600C615  
     124/c0/u1 Ignore ECC policy = off        
     125/c0/u1 Auto Verify Policy = on         
     126/c0/u1 Storsave Policy = balance      
     127/c0/u1 Command Queuing Policy = on         
     128/c0/u1 Rapid RAID Recovery setting = all 
     129 
     130Unit     UnitType  Status         %RCmpl  %V/I/M  VPort Stripe  Size(GB) 
     131------------------------------------------------------------------------ 
     132u1       RAID-5    OK             -       -       -     256K    11175.8    
     133u1-0     DISK      OK             -       -       p0    -       3725.28    
     134u1-1     DISK      OK             -       -       p1    -       3725.28    
     135u1-2     DISK      OK             -       -       p2    -       3725.28    
     136u1-3     DISK      OK             -       -       p3    -       3725.28    
     137u1/v0    Volume    -              -       -       -     -       11175.8    
     138}}} 
     139 
     140Looks good. 
     141 
     142When we created the RAID, it should have attached itself on the bus. The steps from here on in are similar to those for other RAID controllers. Use "dmesg" to figure out where it is attached : 
     143 
     144{{{ 
     145[root@netdrms02 ~]# dmesg | tail -6 
     146[4656757.804513] sd 0:0:1:0: [sdc] 23437436928 512-byte logical blocks: (11.9 TB/10.9 TiB) 
     147[4656757.804557] sd 0:0:1:0: Attached scsi generic sg6 type 0 
     148[4656757.849486] sd 0:0:1:0: [sdc] Write Protect is off 
     149[4656757.849494] sd 0:0:1:0: [sdc] Mode Sense: 23 00 10 00 
     150[4656757.880591] sd 0:0:1:0: [sdc] Write cache: disabled, read cache: enabled, supports DPO and FUA 
     151[4656758.017518] sd 0:0:1:0: [sdc] Attached SCSI disk 
     152}}} 
     153 
     154So it is attached at /dev/sdc. Build a partition on it : 
     155 
     156{{{ 
     157[root@netdrms02 ~]# parted /dev/sdc 
     158GNU Parted 3.1 
     159Using /dev/sdc 
     160Welcome to GNU Parted! Type 'help' to view a list of commands. 
     161(parted) mklabel gpt                                                       
     162(parted) mkpart primary xfs 0% 100%                                        
     163(parted) quit                                                              
     164Information: You may need to update /etc/fstab. 
     165}}} 
     166 
     167Then make a filesystem on that partition : 
     168 
     169{{{ 
     170[root@netdrms02 ~]# mkfs -t xfs /dev/sdc1 
     171meta-data=/dev/sdc1              isize=512    agcount=11, agsize=268435455 blks 
     172         =                       sectsz=512   attr=2, projid32bit=1 
     173         =                       crc=1        finobt=0, sparse=0 
     174data     =                       bsize=4096   blocks=2929679104, imaxpct=5 
     175         =                       sunit=0      swidth=0 blks 
     176naming   =version 2              bsize=4096   ascii-ci=0 ftype=1 
     177log      =internal log           bsize=4096   blocks=521728, version=2 
     178         =                       sectsz=512   sunit=0 blks, lazy-count=1 
     179realtime =none                   extsz=4096   blocks=0, rtextents=0 
     180}}} 
     181 
     182Mount it to test, and then unmount it : 
     183 
     184{{{ 
     185[root@netdrms02 ~]# mkdir /internalRAID; mount -t xfs /dev/sdc1 /internalRAID 
     186[root@netdrms02 ~]# df -h 
     187Filesystem               Size  Used Avail Use% Mounted on 
     188/dev/mapper/centos-root   50G  8.7G   42G  18% / 
     189devtmpfs                  63G     0   63G   0% /dev 
     190tmpfs                     63G  8.0K   63G   1% /dev/shm 
     191tmpfs                     63G  634M   63G   1% /run 
     192tmpfs                     63G     0   63G   0% /sys/fs/cgroup 
     193/dev/sdb1               1014M  292M  723M  29% /boot 
     194/dev/mapper/centos-home  169G  388M  169G   1% /home 
     195/dev/sda1                117T   12T  106T  10% /SUM01 
     196tmpfs                     13G   12K   13G   1% /run/user/42 
     197tmpfs                     13G     0   13G   0% /run/user/1000 
     198/dev/sdc1                 11T   33M   11T   1% /internalRAID 
     199 
     200[root@netdrms02 ~]# umount /internalRAID 
     201}}} 
     202 
     203Get the UUID for that partition with  blkid : 
     204 
     205{{{ 
     206[root@netdrms02 ~]# blkid /dev/sdc1 
     207/dev/sdc1: UUID="dadbf9b9-1110-4df0-933a-887ffdb3860c" TYPE="xfs" PARTLABEL="primary" PARTUUID="18fe5bbf-5798-4b62-8407-628bc5fb84ad"  
     208}}} 
     209 
     210And edit /etc/fstab to add the mount. The new entry is the last one that mounts at /internalRAID : 
     211 
     212{{{ 
     213[root@netdrms02 ~]# vi /etc/fstab 
     214[root@netdrms02 ~]# cat /etc/fstab  
     215 
     216# 
     217# /etc/fstab 
     218# Created by anaconda on Wed Jan 31 16:02:17 2018 
     219# 
     220# Accessible filesystems, by reference, are maintained under '/dev/disk' 
     221# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info 
     222# 
     223/dev/mapper/centos-root /                       xfs     defaults        0 0 
     224UUID=d0c1aad0-8c6a-4881-87d7-deb96c160c2a /boot                   xfs     defaults        0 0 
     225/dev/mapper/centos-home /home                   xfs     defaults        0 0 
     226/dev/mapper/centos-swap swap                    swap    defaults        0 0 
     227 
     228# SUMS partition 
     229UUID=2b598aba-0b60-4966-a443-90c9ca730974 /SUM01           xfs     defaults        1 1 
     230 
     231# Internal RAID 
     232UUID=dadbf9b9-1110-4df0-933a-887ffdb3860c /internalRAID    xfs     defaults        1 1 
     233 
     234}}} 
     235 
     236Then mount everything : 
     237 
     238{{{ 
     239[root@netdrms02 ~]# mount -a 
     240[root@netdrms02 ~]# df -h 
     241Filesystem               Size  Used Avail Use% Mounted on 
     242/dev/mapper/centos-root   50G  8.7G   42G  18% / 
     243devtmpfs                  63G     0   63G   0% /dev 
     244tmpfs                     63G  8.0K   63G   1% /dev/shm 
     245tmpfs                     63G  634M   63G   1% /run 
     246tmpfs                     63G     0   63G   0% /sys/fs/cgroup 
     247/dev/sdb1               1014M  292M  723M  29% /boot 
     248/dev/mapper/centos-home  169G  388M  169G   1% /home 
     249/dev/sda1                117T   12T  106T  10% /SUM01 
     250tmpfs                     13G   12K   13G   1% /run/user/42 
     251tmpfs                     13G     0   13G   0% /run/user/1000 
     252/dev/sdc1                 11T   33M   11T   1% /internalRAID 
     253}}} 
     254 
     255Yay! Big new disk. 
     256 
     257Niles Oien May 2018 
     258 
     259 
     260