Tuesday, October 21, 2014

zpool RAID-0 operations

1)To create a pool wiht requiered version
root@solaris1:~# zpool create  -o version=10 mypool c2d7
root@solaris1:~# zpool get all mypool
NAME    PROPERTY       VALUE                SOURCE
mypool  allocated      88K                  -
mypool  altroot        -                    default
mypool  autoexpand     off                  default
mypool  autoreplace    off                  default
mypool  bootfs         -                    default
mypool  cachefile      -                    default
mypool  capacity       0%                   -
mypool  dedupditto     0                    default
mypool  dedupratio     1.00x                -
mypool  delegation     on                   default
mypool  failmode       wait                 default
mypool  free           19.9G                -
mypool  guid           3389890414850039882  -
mypool  health         ONLINE               -
mypool  listshares     off                  default
mypool  listsnapshots  off                  default
mypool  readonly       off                  -
mypool  size           19.9G                -
mypool  version        10                   local

2) To upgrade a pool from version (10) to latest version (34)
root@solaris1:~# zpool upgrade mypool
This system is currently running ZFS pool version 34.
Successfully upgraded 'mypool' from version 10 to version 34
root@solaris1:~# zpool get all mypool
NAME    PROPERTY       VALUE                SOURCE
mypool  allocated      73K                  -
mypool  altroot        -                    default
mypool  autoexpand     off                  default
mypool  autoreplace    off                  default
mypool  bootfs         -                    default
mypool  cachefile      -                    default
mypool  capacity       0%                   -
mypool  dedupditto     0                    default
mypool  dedupratio     1.00x                -
mypool  delegation     on                   default
mypool  failmode       wait                 default
mypool  free           19.9G                -
mypool  guid           3389890414850039882  -
mypool  health         ONLINE               -
mypool  listshares     off                  default
mypool  listsnapshots  off                  default
mypool  readonly       off                  -
mypool  size           19.9G                -
mypool  version        34                   default
3)To add lun to existing pool
root@solaris1:~# zpool list
NAME     SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
mypool  19.9G    73K  19.9G   0%  1.00x  ONLINE  -
rpool   9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -
root@solaris1:~# zpool add mypool c2d5
root@solaris1:~# zpool list
NAME     SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
mypool  39.8G   112K  39.7G   0%  1.00x  ONLINE  -
rpool   9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -
root@solaris1:~# zpool status mypool
  pool: mypool
 state: ONLINE
  scan: none requested
config:
        NAME    STATE     READ WRITE CKSUM
        mypool  ONLINE       0     0     0
          c2d7  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0
errors: No known data errors

4)To remove lun from raid 0 pool
A) NOT POSSIBLE
root@solaris1:~# zpool remove mypool c2d5
cannot remove c2d5: operation not supported on this type of pool

5)To export Zpool
root@solaris1:~# zpool list
NAME     SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
mypool  39.8G    79K  39.7G   0%  1.00x  ONLINE  -
rpool   9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -
root@solaris1:~# zpool export mypool
root@solaris1:~# zpool list
NAME    SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
rpool  9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -

6)To rename a pool
root@solaris1:~# zpool list
NAME       SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
rpool     9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -
testpool  39.8G   133K  39.7G   0%  1.00x  ONLINE  -
root@solaris1:~# zpool export testpool
root@solaris1:~# zpool import testpool orapool

7)to convert RAID0 ===> RAID 1
root@solaris1:~# zpool status orapool
  pool: orapool
 state: ONLINE
  scan: none requested
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0

root@solaris1:~# zpool attach orapool c2d6 c2d7
root@solaris1:~# zpool status orapool
  pool: orapool
 state: ONLINE
  scan: resilvered 36K in 0h0m with 0 errors on Thu Dec  5 15:11:01 2013
config:
        NAME        STATE     READ WRITE CKSUM
        orapool     ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            c2d6    ONLINE       0     0     0
            c2d7    ONLINE       0     0     0
          c2d5      ONLINE       0     0     0
errors: No known data errors
root@solaris1:~# zpool attach orapool c2d5 c2d4
root@solaris1:~# zpool status orapool
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME        STATE     READ WRITE CKSUM
        orapool     ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            c2d6    ONLINE       0     0     0
            c2d7    ONLINE       0     0     0
          mirror-1  ONLINE       0     0     0
            c2d5    ONLINE       0     0     0
            c2d4    ONLINE       0     0     0
8)To conver RAID1===> RAID0
root@solaris1:~# zpool status orapool
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME        STATE     READ WRITE CKSUM
        orapool     ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            c2d6    ONLINE       0     0     0
            c2d7    ONLINE       0     0     0
          mirror-1  ONLINE       0     0     0
            c2d5    ONLINE       0     0     0
            c2d4    ONLINE       0     0     0
errors: No known data errors
root@solaris1:~# zpool detach orapool c2d7
root@solaris1:~# zpool status orapool
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME        STATE     READ WRITE CKSUM
        orapool     ONLINE       0     0     0
          c2d6      ONLINE       0     0     0
          mirror-1  ONLINE       0     0     0
            c2d5    ONLINE       0     0     0
            c2d4    ONLINE       0     0     0
errors: No known data errors
root@solaris1:~# zpool detach orapool c2d4
root@solaris1:~# zpool status
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0
errors: No known data errors

9)To view zpool status
root@solaris1:~# zpool status -v orapool
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0
errors: No known data errors

root@solaris1:~# zpool status -l orapool
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0

root@solaris1:~# zpool status -x orapool
pool 'orapool' is healthy
root@solaris1:~# zpool status -T d orapool
Thursday, December  5, 2013 03:18:23 PM UTC
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0
errors: No known data errors
root@solaris1:~# zpool status -T u orapool
1386256717
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0
errors: No known data errors
root@solaris1:~# zpool status -T u orapool 1 2
1386256744
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0
errors: No known data errors
1386256745
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0
errors: No known data errors

10)To Know pools which are deported
root@solaris1:~# zpool list
NAME    SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
rpool  9.94G  5.26G  4.67G  52%  1.00x  ONLINE  -
root@solaris1:~# zpool import
  pool: orapool
    id: 2120293288987796294
 state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:
        orapool  ONLINE
          c2d6  ONLINE
          c2d5  ONLINE

11)To Destroy Pool
root@solaris1:~# zpool destroy orapool
root@solaris1:~# zpool list
NAME    SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
rpool  9.94G  5.26G  4.68G  52%  1.00x  ONLINE  -

12)To see destroyed pools
root@solaris1:~# zpool import
no pools available to import
root@solaris1:~# zpool import -D
  pool: orapool
    id: 2120293288987796294
 state: ONLINE (DESTROYED)
action: The pool can be imported using its name or numeric identifier.
config:
        orapool  ONLINE
          c2d6  ONLINE
          c2d5  ONLINE

13)To recover Destroyed Pool
root@solaris1:~# zpool list
NAME    SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
rpool  9.94G  5.26G  4.68G  52%  1.00x  ONLINE  -
root@solaris1:~# zpool import -D orapool
root@solaris1:~# zpool list
NAME      SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
orapool  39.8G   104K  39.7G   0%  1.00x  ONLINE  -
rpool    9.94G  5.26G  4.68G  52%  1.00x  ONLINE  -
root@solaris1:~# zpool status orapool
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0
errors: No known data errors
14)To ADD log devices to RAID-0 Pool
root@solaris1:~# zpool add orapool log c2d7
root@solaris1:~# zpool status orapool
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0
        logs
          c2d7  ONLINE       0     0     0
errors: No known data errors
root@solaris1:~# zpool list
NAME      SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
orapool  39.8G   106K  39.7G   0%  1.00x  ONLINE  -
rpool    9.94G  5.26G  4.68G  52%  1.00x  ONLINE  -

15)To REmove Log devices from pool
root@solaris1:~# zpool remove orapool c2d7
16)To add cache device to pool
root@solaris1:~# zpool add orapool cache c2d4
root@solaris1:~# zpool status orapool
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0
        cache
          c2d4  ONLINE       0     0     0
errors: No known data errors
17)To Remove cache devices from pool
root@solaris1:~# zpool status orapool
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0
        cache
          c2d4  ONLINE       0     0     0
errors: No known data errors
root@solaris1:~# zpool remove orapool c2d4
root@solaris1:~# zpool status orapool
  pool: orapool
 state: ONLINE
  scan: resilvered 65.5K in 0h0m with 0 errors on Thu Dec  5 15:11:22 2013
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0
errors: No known data errors

18)To see zpool io status
root@solaris1:~# zpool iostat -lv
               capacity     operations    bandwidth
pool        alloc   free   read  write   read  write
----------  -----  -----  -----  -----  -----  -----
orapool      109K  39.7G      0      1  1.45K  5.31K
  c2d6      41.5K  19.9G      0      0    724  2.47K
  c2d5      67.5K  19.9G      0      0    755  2.84K
----------  -----  -----  -----  -----  -----  -----
rpool       5.26G  4.68G      0      1  21.0K  8.04K
  mirror    5.26G  4.68G      0      1  21.0K  8.04K
    c2d1s0      -      -      0      0  10.5K  8.12K
    c2d0s0      -      -      0      0  10.9K  8.12K
----------  -----  -----  -----  -----  -----  -----
root@solaris1:~# zpool iostat
               capacity     operations    bandwidth
pool        alloc   free   read  write   read  write
----------  -----  -----  -----  -----  -----  -----
orapool      109K  39.7G      0      1  1.44K  5.28K
rpool       5.26G  4.68G      0      1  21.0K  8.04K
----------  -----  -----  -----  -----  -----  -----

19)to import a pool with missing log devices
#Zpool import -m orapool
20)to clear faults of Zpool & and recover to previous transcation.

#zpool clear -F orapool
21)To scrub a pool
root@solaris1:~# zpool scrub orapool
root@solaris1:~# zpool status
  pool: orapool
 state: ONLINE
  scan: scrub repaired 0 in 0h0m with 0 errors on Thu Dec  5 16:31:20 2013
config:
        NAME    STATE     READ WRITE CKSUM
        orapool  ONLINE       0     0     0
          c2d6  ONLINE       0     0     0
          c2d5  ONLINE       0     0     0
errors: No known data errors

No comments:

Post a Comment