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
Open SSL Creating Certificate Signing Request — CSR Generation
Viewed 1977 times since Mon, Feb 18, 2019
15 Linux Yum Command Examples – Install, Uninstall, Update Packages
Viewed 3487 times since Thu, Oct 25, 2018
Learn how to align an SSD on Linux
Viewed 12573 times since Fri, May 15, 2020
Deskshare TLS over Stunnel
Viewed 2859 times since Fri, Sep 28, 2018
Using grep to find string in files
Viewed 2320 times since Fri, May 15, 2020
How to automate SSH login with password? ssh autologin
Viewed 2790 times since Fri, Jun 8, 2018
Open SSL HowTo: Decode SSL Certificate
Viewed 6177 times since Mon, Feb 18, 2019
LVM: Reduce SWAP size by removing a Logical Volume
Viewed 2120 times since Sat, Jun 2, 2018
Managing temporary files with systemd-tmpfiles on Red Hat Enterprise Linux 7
Viewed 9715 times since Sun, Nov 22, 2020
Manage SSH Key File With Passphrase
Viewed 2344 times since Tue, Mar 5, 2019