Creating new ZFS pool(s)

Moderator: cah

Post Reply
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

Creating new ZFS pool(s)

Post by cah »

1. Find available devices (disks) using "format" command:

Code: Select all

orazone01:/%format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c3t3EDC40EB4E13BFC7d0 <LSI-LogicalVolume-3000 cyl 65533 alt 2 hd 64 sec 139>
          /pci@400/pci@2/pci@0/pci@e/scsi@0/iport@v0/disk@w3edc40eb4e13bfc7,0
       1. c3t3718410C46D7BFE8d0 <LSI-LogicalVolume-3000 cyl 65533 alt 2 hd 64 sec 139>
          /pci@400/pci@2/pci@0/pci@e/scsi@0/iport@v0/disk@w3718410c46d7bfe8,0
       2. c4t2d3 <drive not available>
          /pci@500/pci@2/pci@0/pci@a/SUNW,emlxs@0/fp@0,0/ssd@w202500a0b875f936,3
Specify disk (enter its number): 
2. Choose the unused device(s) to create a new pool:

Code: Select all

zpool create zonepool c3t3EDC40EB4E13BFC7d0
3. Use "zpool status -v" to check pool status and device information:

Code: Select all

orazone01:/%zpool status -v 
  pool: rpool
 state: ONLINE
 scrub: none requested
config:

        NAME                       STATE     READ WRITE CKSUM
        rpool                      ONLINE       0     0     0
          c3t3718410C46D7BFE8d0s0  ONLINE       0     0     0

errors: No known data errors

  pool: zonepool
 state: ONLINE
 scrub: none requested
config:

        NAME                     STATE     READ WRITE CKSUM
        zonepool                 ONLINE       0     0     0
          c3t3EDC40EB4E13BFC7d0  ONLINE       0     0     0

errors: No known data errors
4. Use "df" to check disk block and file information and verify new pool is in the list:

Code: Select all

orazone01:/%df -h
Filesystem             size   used  avail capacity  Mounted on
rpool/ROOT/root_ds     272G   5.8G   261G     3%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                    50G   816K    50G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/platform/sun4v/lib/libc_psr/libc_psr_hwcap2.so.1
                       266G   5.8G   261G     3%    /platform/sun4v/lib/libc_psr.so.1
/platform/sun4v/lib/sparcv9/libc_psr/libc_psr_hwcap2.so.1
                       266G   5.8G   261G     3%    /platform/sun4v/lib/sparcv9/libc_psr.so.1
fd                       0K     0K     0K     0%    /dev/fd
rpool/ROOT/root_ds/var
                       272G   199M   261G     1%    /var
swap                    50G    17M    50G     1%    /tmp
swap                    50G    56K    50G     1%    /var/run
rpool/export           272G    23K   261G     1%    /export
rpool/export/home      272G   1.1G   261G     1%    /export/home
rpool                  272G    96K   261G     1%    /rpool
zonepool               274G    21K   274G     1%    /zonepool
CAH, The Great
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

Creating new ZFS pool(s) with mirrored disks

Post by cah »

Code: Select all

%zpool create -f apppool mirror c1t2d0 c1t3d0

%zpool status -v
  pool: apppool
 state: ONLINE
 scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        apppool     ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            c1t2d0  ONLINE       0     0     0
            c1t3d0  ONLINE       0     0     0

errors: No known data errors
CAH, The Great
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

Creating new ZFS pool(s) - appint03 logpool

Post by cah »

Create a new ZFS storage pool with mirrors for 6 disks:

Code: Select all

%zpool create logpool mirror c0t2d0 c0t3d0 mirror c0t4d0 c0t5d0 mirror c0t6d0 c0t7d0 
Check pool status:

Code: Select all

%zpool status -v 
  pool: logpool
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        logpool     ONLINE       0     0     0
          mirror    ONLINE       0     0     0
            c0t2d0  ONLINE       0     0     0
            c0t3d0  ONLINE       0     0     0
          mirror    ONLINE       0     0     0
            c0t4d0  ONLINE       0     0     0
            c0t5d0  ONLINE       0     0     0
          mirror    ONLINE       0     0     0
            c0t6d0  ONLINE       0     0     0
            c0t7d0  ONLINE       0     0     0

errors: No known data errors

  pool: rpool
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        rpool       ONLINE       0     0     0
          c0t0d0s0  ONLINE       0     0     0

errors: No known data errors
Check logpool size:

Code: Select all

%df -h /logpool
Filesystem             size   used  avail capacity  Mounted on
logpool                821G    18K   821G     1%    /logpool
CAH, The Great
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

Remove a device from rpool mirror

Post by cah »

One device in the mirrored pool seemed to be broke and the server sends out email every night.

The status shows:

Code: Select all

cahtoh02:/root%zpool status
  pool: rpool
 state: DEGRADED
status: One or more devices are unavailable in response to persistent errors.
        Sufficient replicas exist for the pool to continue functioning in a
        degraded state.
action: Determine if the device needs to be replaced, and clear the errors
        using 'zpool clear' or 'fmadm repaired', or replace the device
        with 'zpool replace'.
        Run 'zpool status -v' to see device specific details.
  scan: scrub repaired 0 in 1h2m with 0 errors on Sun Jul 12 04:02:38 2015
config:

        NAME        STATE     READ WRITE CKSUM
        rpool       DEGRADED     0     0     0
          mirror-0  DEGRADED     0     0     0
            c6d0s0  UNAVAIL      0     0     0
            c5d0s0  ONLINE       0     0     0

errors: No known data errors
I decided to remove the unavailable device out of the rpool.

Code: Select all

cahtoh02:/root%zpool detach rpool c6d0s0
Check the status again:

Code: Select all

cahtoh02:/root%zpool status             
  pool: rpool
 state: ONLINE
status: The pool is formatted using an older on-disk format. The pool can
        still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'. Once this is done, the
        pool will no longer be accessible on older software versions.
  scan: scrub repaired 0 in 1h2m with 0 errors on Sun Jul 12 04:02:38 2015
config:

        NAME      STATE     READ WRITE CKSUM
        rpool     ONLINE       0     0     0
          c5d0s0  ONLINE       0     0     0

errors: No known data errors
Later I can just attach a new device to the pool as a mirror device.

Code: Select all

cahtoh02:/root%zpool create -f rpool mirror c5d0s0 c6d0s0 (or whateve the device name is)
In the meantime, I can run zpool upgrade.

Code: Select all

cahtoh02:/root%zpool upgrade rpool
This system is currently running ZFS pool version 35.

Successfully upgraded 'rpool' from version 33 to version 35
CAH, The Great
Post Reply