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
Df command in Linux not updating actual diskspace, wrong data
Viewed 3033 times since Wed, May 30, 2018
systemd Auto-restart a crashed service in systemd
Viewed 3411 times since Fri, Jan 17, 2020
RHEL: Getting/Setting hardware clock’s time
Viewed 3212 times since Sat, Jun 2, 2018
Telnet – Send GET/HEAD HTTP Request
Viewed 3515 times since Mon, Feb 18, 2019
RHEL: iSCSI target/initiator configuration on RHEL6
Viewed 8968 times since Sat, Jun 2, 2018
How To Ping Specific Port Number
Viewed 4537 times since Mon, Jun 1, 2020
Red Hat Enterprise Linux - Allow Root Login From a Specific IP Address Only
Viewed 2969 times since Wed, Oct 3, 2018
Applescript: Run or Call a Shell Script
Viewed 4368 times since Tue, Aug 6, 2019
RHEL7: How to get started with Firewalld.
Viewed 12257 times since Wed, May 22, 2019
How to maximise SSD performance with Linux
Viewed 8796 times since Fri, May 15, 2020