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 aix Killing a process and all of its descendants
Viewed 4359 times since Tue, May 5, 2020
Stunnel Setup
Viewed 18424 times since Fri, Sep 28, 2018
PROCESSOR AND MEMORY INFORMATION
Viewed 6068 times since Sat, Jun 2, 2018
6 rsync Examples to Exclude Multiple Files and Directories using exclude-from
Viewed 5586 times since Wed, Oct 31, 2018
“Too many authentication failures” with SSH
Viewed 6510 times since Mon, May 21, 2018
Yum Update: DB_RUNRECOVERY Fatal error, run database recovery
Viewed 4605 times since Fri, Jan 17, 2020
Linux Kernel /etc/sysctl.conf Security Hardening
Viewed 24085 times since Fri, Aug 3, 2018
RHEL: Checking HBAs
Viewed 15566 times since Sun, May 27, 2018
List usernames instead of uids with the ps command for long usernames
Viewed 2876 times since Wed, Jul 25, 2018
How do I add ethtool settings to a network device permanently?
Viewed 7242 times since Mon, May 21, 2018