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
linux ssh Remotely Initiated Reverse SSH Tunnel
Viewed 867 times since Wed, Apr 22, 2020
rabbitmq Troubleshooting TLS-enabled Connections
Viewed 665 times since Sun, Dec 6, 2020
YUM How to use yum command on CentOS/RHEL
Viewed 3441 times since Thu, Oct 25, 2018
stunnel: Authentication
Viewed 7490 times since Fri, Sep 28, 2018
RHCS6: Reduce a Global Filesystem 2 (GFS2)
Viewed 1302 times since Sun, Jun 3, 2018
LVM basic
Viewed 1140 times since Sat, Jun 2, 2018
HowTo: Retrieve Email from a POP3 Server using the Command Line
Viewed 5621 times since Mon, Feb 18, 2019
RHEL: Displaying system info (firmware, serial numbers... )
Viewed 9233 times since Sun, May 27, 2018
What UUIDs can do for you
Viewed 816 times since Tue, Jul 17, 2018
Script to Offline and Remove A Disk In Linux
Viewed 796 times since Mon, Jan 28, 2019