ZPOOL: Detach a submirror from a mirrored zpool

ZPOOL: Detach a submirror from a mirrored zpool

# Tested on RHEL 6 & 7


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


# Having a mirrored zpool like following one

POOLNAME=my_pool

zpool status $POOLNAME
     pool: my_pool
    state: ONLINE
    scan: resilvered 65K in 0h0m with 0 errors on Tue Sep  1 16:37:43 2015
   config:

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

   errors: No known data errors



# we would like to detach one of the sides of the mirror

DEVICE01=/dev/sdd
DEVICE02=/dev/sde


# We detach one by one the devices from one of the sides of the mirror:

zpool detach $POOLNAME $DEVICE02


zpool status $POOLNAME
     pool: my_pool
    state: ONLINE
    scan: resilvered 65K in 0h0m with 0 errors on Tue Sep  1 16:37:43 2015
   config:

           NAME        STATE     READ WRITE CKSUM
           my_pool     ONLINE       0     0     0
             mirror-0  ONLINE       0     0     0
               sdb     ONLINE       0     0     0
               sdd     ONLINE       0     0     0
             sdc       ONLINE       0     0     0

   errors: No known data errors


zpool detach $POOLNAME $DEVICE01


zpool status $POOLNAME
     pool: my_pool
    state: ONLINE
    scan: resilvered 65K in 0h0m with 0 errors on Tue Sep  1 16:37:43 2015
   config:

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

   errors: No known data errors
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
SYS: Configure a local repository. local repo
Viewed 11588 times since Mon, Oct 29, 2018
stunnel How To Set Up an SSL Tunnel Using Stunnel on Ubuntu
Viewed 2294 times since Sun, Dec 6, 2020
Tcpdump Examples Linux
Viewed 6459 times since Fri, Nov 16, 2018
Linux Chage Command to Set Password Aging for User
Viewed 2995 times since Tue, Sep 11, 2018
Linux - How to get CPU information
Viewed 2702 times since Fri, Jun 8, 2018
LVM: Rename root VG/LV
Viewed 8255 times since Sat, Jun 2, 2018
ZFS: Create a new zfs filesystem
Viewed 3066 times since Sun, Jun 3, 2018
Top 20 OpenSSH Server Best Security Practices - good article
Viewed 11454 times since Mon, Oct 1, 2018
What is OS Watcher Utility and How to use it for Database Troubleshooting ?
Viewed 31353 times since Thu, Jun 21, 2018
How to enable Proxy Settings for Yum Command on RHEL / CentOS Servers
Viewed 13696 times since Thu, Jul 19, 2018