ZPOOL: Remove an existing zpool

ZPOOL: Remove an existing zpool

# Tested on RHEL 6 & 7


# WARNING: Pay special attention to any existing F.S. on the pool.
# 'destroy' command will remove all pool's F.S. without asking for confirmation


POOLNAME=my_pool
POOLMNTP=`zfs list $POOLNAME | tail -1 | awk '{print$NF}'`; echo $POOLMNTP


# Check

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

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

   errors: No known data errors



zfs list | grep $POOLNAME
   my_pool         381K  9.78G    33K  /my_pool
   my_pool/zfs01    30K  9.78G    30K  /my_pool/zfs01
   my_pool/zfs02    30K  9.78G    30K  /my_pool/zfs02
   my_pool/zfs03    30K  9.78G    30K  /my_pool/zfs03



# (are you sure?!) Remove zpool

zpool destroy $POOLNAME

rmdir $POOLMNTP
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
How to run command or code in parallel in bash shell under Linux or Unix
Viewed 3123 times since Tue, Aug 6, 2019
SYS: Configure a local repository. local repo
Viewed 10872 times since Mon, Oct 29, 2018
RHEL: How to rebuild and/or patch a RPM package
Viewed 8563 times since Sat, Jun 2, 2018
logrotate Log Rotate Configuration
Viewed 3108 times since Sun, Jan 12, 2020
Procedura powiekszania OCFS2 online
Viewed 5380 times since Fri, Jun 8, 2018
INSTALACJA MIB SNMP W SYSTEMIE CENTOS/RHEL 6
Viewed 12891 times since Fri, Nov 30, 2018
linux aix Killing a process and all of its descendants
Viewed 3694 times since Tue, May 5, 2020
YUM CRON RHEL7: Configure automatic updates.
Viewed 1914 times since Fri, Oct 26, 2018
Epoch & Unix Timestamp Conversion Tools
Viewed 61890 times since Fri, Jun 22, 2018
RHEL: Services basic management - systemd
Viewed 18557 times since Sat, Jun 2, 2018