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
RHEL: Change system’s hostname
Viewed 1426 times since Sun, May 27, 2018
LVM: Recovering Physical Volume Metadata
Viewed 1069 times since Sat, Jun 2, 2018
Sample logrotate configuration and troubleshooting part 2
Viewed 869 times since Fri, Nov 30, 2018
stunnel: Authentication
Viewed 978 times since Fri, Sep 28, 2018
OpenSSL: Find Out SSL Key Length – Linux Command Line
Viewed 1211 times since Mon, Feb 18, 2019
debian Install a newer kernel in Debian 9 (stretch) stable
Viewed 710 times since Sun, Sep 23, 2018
HowTo: Find Out Hard Disk Specs / Details on Linux
Viewed 1015 times since Mon, Jan 28, 2019
Tropienie pożeracza dysku
Viewed 1113 times since Thu, May 24, 2018
linux ssh Remotely Initiated Reverse SSH Tunnel
Viewed 579 times since Wed, Apr 22, 2020
How setting the TZ environment variable avoids thousands of system calls
Viewed 1829 times since Mon, May 21, 2018