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
SPRAWDZONA KONFIGURACJA RSYSLOG I LOGROTATE, JAKO ZEWNĘTRZNEGO SERWERA SYSLOG
Viewed 3897 times since Fri, Nov 30, 2018
10 Linux nslookup Command Examples for DNS Lookup
Viewed 10310 times since Sun, Sep 30, 2018
Red Hat ADDING SWAP SPACE
Viewed 2125 times since Fri, Jun 8, 2018
ZPOOL: Grow a zpool by adding new device(s)
Viewed 6133 times since Sun, Jun 3, 2018
RHEL: Adding a boot entry to GRUB/GRUB2 configuration
Viewed 4763 times since Sun, May 27, 2018
RHEL: Extending the maximum inode count on a ext2/ext3/ext4 filesystem
Viewed 3351 times since Sun, May 27, 2018
Tips to Solve Linux & Unix Systems Hard Disk Problems
Viewed 4227 times since Fri, May 15, 2020
Securing /tmp and shm partitions
Viewed 3324 times since Fri, May 15, 2020
How do I add ethtool settings to a network device permanently?
Viewed 6702 times since Mon, May 21, 2018
Easily Monitor CPU Utilization in Linux Terminal With Stress Terminal UI
Viewed 4181 times since Thu, Apr 18, 2019