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
RHEL: Retrieve and generate a unique SCSI identifier
Viewed 2736 times since Sat, Jun 2, 2018
python learning
Viewed 1592 times since Wed, Dec 18, 2019
Top 20 OpenSSH Server Best Security Practices ssh linux aix
Viewed 5562 times since Fri, May 15, 2020
List usernames instead of uids with the ps command for long usernames
Viewed 2033 times since Wed, Jul 25, 2018
How to Install and use Lsyncd on CentOS 7 / RHEL 7 rsync
Viewed 3906 times since Wed, Oct 31, 2018
debian How to Upgrade Debian 8 Jessie to Debian 9 Stretch
Viewed 2066 times since Sun, Sep 23, 2018
LVM basic
Viewed 1967 times since Sat, Jun 2, 2018
7 Tips – Tuning Command Line History in Bash
Viewed 4684 times since Fri, Jul 5, 2019
Linux get the list of FC HBA’s and WWPN
Viewed 2772 times since Tue, May 22, 2018
How to mount software RAID1 member using mdadm
Viewed 2787 times since Wed, Oct 3, 2018