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 : How to deal with “CLOSE_WAIT” and “TIME_WAIT” connection
Viewed 26570 times since Thu, Feb 14, 2019
Top 20 OpenSSH Server Best Security Practices ssh linux aix
Viewed 6137 times since Fri, May 15, 2020
A tcpdump Tutorial and Primer with Examples
Viewed 5463 times since Sun, Jun 17, 2018
Jak wygenerować silne hasła jednorazowe w Linuksie?
Viewed 2457 times since Thu, May 24, 2018
RHEL: Manually encrypting a filesystem with LUKS
Viewed 3972 times since Sun, May 27, 2018
HowTo: The Ultimate Logrotate Command Tutorial with 10 Examples
Viewed 5512 times since Fri, Nov 30, 2018
LVM: Mount LVM Partition(s) in Rescue Mode
Viewed 5021 times since Sat, Jun 2, 2018
OpenSSL – sprawdzanie czy klucz pasuje do certyfikatu
Viewed 2817 times since Thu, May 24, 2018
Linux Health Check Commands
Viewed 3311 times since Fri, Jun 8, 2018
www.unixarena.com
Viewed 2566 times since Fri, Jul 27, 2018