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
Easily Find Bugs In Shell Scripts With ShellCheck
Viewed 3395 times since Thu, Apr 18, 2019
How to use yum-cron to automatically update RHEL/CentOS Linux
Viewed 2733 times since Wed, Oct 17, 2018
logrotate - rotates, compresses, and mails system logs.
Viewed 1803 times since Fri, Nov 30, 2018
Nagrywanie sesji SSH do pliku
Viewed 3026 times since Thu, May 24, 2018
Linux - How to monitor memory usage
Viewed 3153 times since Fri, Jun 8, 2018
debian How to check Debian CVE status using python script
Viewed 3676 times since Sun, Sep 23, 2018
3 Ways to Check Linux Kernel Version in Command Line
Viewed 11706 times since Fri, Apr 19, 2019
How to Clear RAM Memory Cache, Buffer and Swap Space on Linux
Viewed 2780 times since Mon, Nov 23, 2020
RHCS6: Basic operations on clustered services
Viewed 2757 times since Sun, Jun 3, 2018
15 Linux Yum Command Examples – Install, Uninstall, Update Packages
Viewed 3491 times since Thu, Oct 25, 2018