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
stunnel bacula
Viewed 2833 times since Fri, Sep 28, 2018
RHEL: Force system to prompt for password in Single User mode
Viewed 8592 times since Sat, Jun 2, 2018
Fake A Hollywood Hacker Screen in Linux Terminal linux FUN
Viewed 7699 times since Thu, Apr 18, 2019
Index » Community Contributions » System encryption using LUKS and GPG encrypted keys for arch linux
Viewed 4462 times since Fri, Jul 13, 2018
RHEL: Checking HBAs
Viewed 16273 times since Sun, May 27, 2018
linux-training.be gives you books for free to study Linux
Viewed 5590 times since Sat, Jun 2, 2018
How To Find Largest Top 10 Files and Directories On Linux / UNIX / BSD find
Viewed 4621 times since Mon, Oct 29, 2018
LVM basic
Viewed 2848 times since Sat, Jun 2, 2018
haproxy linux
Viewed 3166 times since Sun, Dec 6, 2020
HowTo: Kill TCP Connections in CLOSE_WAIT State
Viewed 17281 times since Thu, Feb 14, 2019