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 124 times since Wed, Apr 22, 2020
ZPOOL: Grow a zpool by adding new device(s)
Viewed 621 times since Sun, Jun 3, 2018
Cron YUM How to use yum-cron to automatically update RHEL/CentOS Linux
Viewed 419 times since Fri, Oct 26, 2018
RHEL: Route network packets to go out via the same interface they came in
Viewed 1033 times since Sat, Jun 2, 2018
How to use yum-cron to automatically update RHEL/CentOS Linux 6.x / 7.x
Viewed 1173 times since Tue, Dec 4, 2018
Build a simple RPM that packages a single file
Viewed 979 times since Sat, Jun 2, 2018
OEL 7 – How to disable IPv6 on Oracle Linux 7
Viewed 3396 times since Fri, Aug 3, 2018
RHEL: Crash kernel dumps configuration and analysis on RHEL 6
Viewed 1173 times since Sat, Jun 2, 2018
RHEL: Bonding network interfaces
Viewed 970 times since Sat, Jun 2, 2018
tcpdump usage examples
Viewed 445 times since Fri, Jul 27, 2018