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
Manage Linux Password Expiration and Aging Using chage
Viewed 6637 times since Tue, Sep 11, 2018
How to maximise SSD performance with Linux
Viewed 10148 times since Fri, May 15, 2020
20 IPtables Examples For New SysAdmins
Viewed 3190 times since Fri, May 15, 2020
SSH: Execute Remote Command or Script – Linux
Viewed 3323 times since Mon, Feb 18, 2019
Enabling or disabling a repository using Red Hat Subscription Management
Viewed 14927 times since Mon, Oct 29, 2018
systemd Auto-restart a crashed service in systemd
Viewed 4704 times since Fri, Jan 17, 2020
Tropienie pożeracza dysku
Viewed 3114 times since Thu, May 24, 2018
Inxi – A Powerful Feature-Rich Commandline System Information Tool for Linux
Viewed 19998 times since Sat, Jun 2, 2018
Configuring VLAN interfaces in Linux
Viewed 7313 times since Mon, May 21, 2018
Method 2 – Use shell scripts How to install yum cron on a CentOS/RHEL 6.x/7.x
Viewed 5282 times since Tue, Dec 4, 2018