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
ZFS: Create a new zfs filesystem
Viewed 1291 times since Sun, Jun 3, 2018
Using stunnel and TinyProxy to obfuscate HTTP traffic
Viewed 3022 times since Fri, Sep 28, 2018
CentOS / RHEL 7 : Configuring an NFS server and NFS client Linux NFS
Viewed 14187 times since Fri, Feb 21, 2020
LVM: Remove a Filesystem / Logical Volume
Viewed 1246 times since Sat, Jun 2, 2018
Linux ssh Hide OpenSSH Version Banner
Viewed 12898 times since Wed, Apr 22, 2020
Linux Kernel /etc/sysctl.conf Security Hardening
Viewed 21576 times since Fri, Aug 3, 2018
RHEL: Bonding network interfaces
Viewed 1859 times since Sat, Jun 2, 2018
Linux Audit The Linux security blog about Auditing, Hardening, and Compliance lynis
Viewed 921 times since Thu, Jan 16, 2020
stunnel: Authentication
Viewed 7490 times since Fri, Sep 28, 2018
Using Kerberos security with Server for NFS
Viewed 6358 times since Wed, Jun 27, 2018