ZFS: Remove an existing zfs filesystem

ZFS: Remove an existing zfs filesystem

# Tested on RHEL 6 & 7

# Choose the F.S. to remove

zfs list
   NAME           USED  AVAIL  REFER  MOUNTPOINT
   c_pool         349M  19.2G    30K  /c_pool
   c_pool/zfs01   349M   675M   349M  /zfs01
   c_pool/zfs02    30K  19.2G    30K  /filesystem02    <----
   m_pool         100K  9.78G    30K  /m_pool


ZPOOL=c_pool
ZFSFS=zfs02
MNTPT=`zfs list | grep $ZPOOL/$ZFSFS | awk '{print$NF}'`; echo $MNTPT
   /filesystem02


# Remove F.S.

zfs destroy $ZPOOL/$ZFSFS

rmdir $MNTPT


# Check

zfs list
   NAME           USED  AVAIL  REFER  MOUNTPOINT
   c_pool         349M  19.2G    30K  /c_pool
   c_pool/zfs01   349M   675M   349M  /zfs01
   m_pool         100K  9.78G    30K  /m_pool
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 Use Systemctl to Manage Systemd Services and Units
Viewed 8376 times since Mon, Dec 7, 2020
How to Analyze or Read OS Watcher Output in three easy steps -- With Example ?
Viewed 44060 times since Thu, Jun 21, 2018
Secure NTP with NTS
Viewed 9544 times since Sun, Dec 6, 2020
Extending Linux LVM partitions - scripts
Viewed 7432 times since Sun, May 20, 2018
Using renice and taskset to manage process priority and CPU affinity with Linux OEL 6.4
Viewed 4569 times since Mon, Feb 17, 2020
RHCS6: Reduce a Global Filesystem 2 (GFS2)
Viewed 4103 times since Sun, Jun 3, 2018
debian Install a newer kernel in Debian 9 (stretch) stable
Viewed 2649 times since Sun, Sep 23, 2018
HowTo: Kill TCP Connections in CLOSE_WAIT State
Viewed 17362 times since Thu, Feb 14, 2019
HOWTO: Use SSL/port 465 in smarthost stunnel
Viewed 4598 times since Fri, Sep 28, 2018
RHEL: Change system’s hostname
Viewed 4420 times since Sun, May 27, 2018