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
Learn Linux System Auditing with Auditd Tool on CentOS/RHEL
Viewed 5578 times since Fri, Apr 5, 2019
Linux – Securing your important files with XFS extendend attributes
Viewed 8223 times since Wed, Jul 25, 2018
RHEL: Change system’s hostname
Viewed 4383 times since Sun, May 27, 2018
Linux - How to get network speed and statistic of ethernet adapter in Linux
Viewed 2863 times since Fri, Jun 8, 2018
Using renice and taskset to manage process priority and CPU affinity with Linux OEL 6.4
Viewed 4504 times since Mon, Feb 17, 2020
How To Add Swap Space on Ubuntu 16.04
Viewed 3132 times since Fri, Jun 8, 2018
A tcpdump Tutorial and Primer with Examples
Viewed 6680 times since Sun, Jun 17, 2018
Linux 16 Useful Bandwidth Monitoring Tools to Analyze Network Usage in Linux
Viewed 17674 times since Mon, Sep 21, 2020
Telnet – Send GET/HEAD HTTP Request
Viewed 4499 times since Mon, Feb 18, 2019
Using stunnel to Encrypt Database Connections
Viewed 5664 times since Fri, Sep 28, 2018