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
CONFIGURE FOR ASM Linux
Viewed 6277 times since Sat, Jun 2, 2018
15 Linux Yum Command Examples – Install, Uninstall, Update Packages
Viewed 4531 times since Thu, Oct 25, 2018
RHEL: Resize/disable /dev/shm filesystem
Viewed 16777 times since Sun, May 27, 2018
stunnel How To Encrypt Traffic to Redis with Stunnel on Ubuntu 16.04
Viewed 2999 times since Sun, Dec 6, 2020
Automatic YUM Updates with Yum-cron
Viewed 11461 times since Fri, Oct 26, 2018
How to configure an SSH proxy server with Squid
Viewed 4353 times since Sun, Dec 6, 2020
How setting the TZ environment variable avoids thousands of system calls
Viewed 11063 times since Mon, May 21, 2018
RHCS6: Basic operations on clustered services
Viewed 3442 times since Sun, Jun 3, 2018
Zabijanie wszystkich procesów użytkownika
Viewed 3394 times since Thu, May 24, 2018
Linux - How to shutdown or reboot
Viewed 2799 times since Fri, Jun 8, 2018