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 accurately determine when the system was booted
Viewed 2486 times since Wed, Oct 3, 2018
Use Fail2ban to Secure Your Server
Viewed 15252 times since Fri, Jul 5, 2019
HowTo: The Ultimate Logrotate Command Tutorial with 10 Examples
Viewed 5650 times since Fri, Nov 30, 2018
linux ssh How to Hide the OpenSSH Version Details when Telnet to Port 22
Viewed 5722 times since Wed, Apr 22, 2020
HowTo: Find Out Hard Disk Specs / Details on Linux
Viewed 3785 times since Mon, Jan 28, 2019
Open SSL Creating Certificate Signing Request — CSR Generation
Viewed 2073 times since Mon, Feb 18, 2019
Szybkie sprawdzenie zewnętrznego adresu IP i hosta
Viewed 3577 times since Thu, May 24, 2018
RHCS6: Debug and test multicast traffic between two hosts
Viewed 6928 times since Sun, Jun 3, 2018
20 Linux Command Tips and Tricks That Will Save You A Lot of Time linux
Viewed 5034 times since Thu, Apr 18, 2019
30 Handy Bash Shell Aliases For Linux / Unix / MacOS
Viewed 5155 times since Thu, Feb 11, 2021