ZPOOL: Grow a zpool by adding new device(s)

ZPOOL: Grow a zpool by adding new device(s)

# Tested on RHEL 6 & 7


# Even if ZFS can use individual slices or partitions, it is recommended to use whole disks.


# -------------------------------------------------------------------------------------
# Extending a concat zpool
# -------------------------------------------------------------------------------------

POOLNAME=c_pool
POOLMNTP=/c_pool
DEVICE01=/dev/sdd



# Given following zpool:

zpool status $POOLNAME
     pool: c_pool
    state: ONLINE
    scan: none requested
   config:

           NAME        STATE     READ WRITE CKSUM
           c_pool      ONLINE       0     0     0
             sdb       ONLINE       0     0     0
             sdc       ONLINE       0     0     0

   errors: No known data errors


zpool list $POOLNAME
   NAME     SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
   c_pool  19.9G   104K  19.9G     0%  1.00x  ONLINE  -



# Extend zpool

zpool add $POOLNAME $DEVICE01

# If you have an error like this one:

   invalid vdev specification
   use '-f' to override the following errors:
   /dev/sdd does not contain an EFI label but it may contain partition
   information in the MBR.

# you should use '-f' option to create the pool - first ensure that disk(s) are the
# right one(s):

# zpool add -f $POOLNAME $DEVICE01



# Check

zpool status $POOLNAME
     pool: c_pool
 state: ONLINE
    scan: none requested
   config:

           NAME        STATE     READ WRITE CKSUM
           c_pool      ONLINE       0     0     0
             sdb       ONLINE       0     0     0
             sdc       ONLINE       0     0     0
             sdd       ONLINE       0     0     0   <----

   errors: No known data errors


zpool list $POOLNAME
   NAME     SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
   c_pool  29.8G   166K  29.8G     0%  1.00x  ONLINE  -




# -------------------------------------------------------------------------------------
# Extending a mirrored zpool
# -------------------------------------------------------------------------------------

POOLNAME=m_pool
SUBMIRR1=/dev/sdd
SUBMIRR2=/dev/sde



# Given following zpool:

zpool status $POOLNAME
     pool: m_pool
    state: ONLINE
    scan: none requested
   config:

           NAME        STATE     READ WRITE CKSUM
           m_pool      ONLINE       0     0     0
             mirror-0  ONLINE       0     0     0
               sdb     ONLINE       0     0     0
               sdc     ONLINE       0     0     0

   errors: No known data errors

zpool list $POOLNAME
   NAME     SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
   m_pool  9.94G   100K  9.94G     0%  1.00x  ONLINE  -



# Extend zpool

zpool add $POOLNAME mirror $SUBMIRR1 $SUBMIRR2

# If you have an error like this one:

   invalid vdev specification
   use '-f' to override the following errors:
   /dev/sdd does not contain an EFI label but it may contain partition
   information in the MBR.

# you should use '-f' option to create the pool - first ensure that disk(s) are the
# right one(s):

# zpool add -f $POOLNAME mirror $SUBMIRR1 $SUBMIRR2



# Check

zpool status $POOLNAME
     pool: m_pool
    state: ONLINE
    scan: none requested
   config:

           NAME        STATE     READ WRITE CKSUM
           m_pool      ONLINE       0     0     0
             mirror-0  ONLINE       0     0     0
               sdb     ONLINE       0     0     0
               sdc     ONLINE       0     0     0
             mirror-1  ONLINE       0     0     0
               sdd     ONLINE       0     0     0   <----
               sde     ONLINE       0     0     0
   <----

   errors: No known data errors



zpool list $POOLNAME
   NAME     SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
   m_pool  19.9G   104K  19.9G     0%  1.00x  ONLINE  -
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
stunnel: Authentication
Viewed 9021 times since Fri, Sep 28, 2018
Easily Find Bugs In Shell Scripts With ShellCheck
Viewed 3131 times since Thu, Apr 18, 2019
How to Install and use Lsyncd on CentOS 7 / RHEL 7 rsync
Viewed 4050 times since Wed, Oct 31, 2018
LVM: Reduce root PV/VG
Viewed 4995 times since Sat, Jun 2, 2018
Linux Proxy Server Settings – Set Proxy For Command Line
Viewed 3034 times since Mon, Feb 18, 2019
ZFS: Create a new zfs filesystem
Viewed 2384 times since Sun, Jun 3, 2018
How to remove CTRL-M (^M) characters from a file in Linux
Viewed 2371 times since Thu, Feb 7, 2019
bash mistakes This page is a compilation of common mistakes made by bash users. Each example is flawed in some way.
Viewed 8864 times since Sun, Dec 6, 2020
KONTO SFTP Z CHROOTEM Z UŻYCIEM OPENSSH-SERVER NA CENTOS/RHEL6
Viewed 1653 times since Fri, Nov 30, 2018
3 Ways to Check Linux Kernel Version in Command Line
Viewed 11347 times since Fri, Apr 19, 2019