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
Enabling automatic updates in Centos 7 and RHEL 7
Viewed 2106 times since Wed, Oct 17, 2018
Use Fail2ban to Secure Your Server
Viewed 13234 times since Fri, Jul 5, 2019
Epoch & Unix Timestamp Conversion Tools
Viewed 43153 times since Fri, Jun 22, 2018
Inxi – A Powerful Feature-Rich Commandline System Information Tool for Linux
Viewed 18590 times since Sat, Jun 2, 2018
stunnel Securing telnet connections with stunnel
Viewed 1107 times since Sun, Dec 6, 2020
ubuntu How to Reset Forgotten Root Password in Ubuntu
Viewed 2086 times since Tue, Dec 8, 2020
chrt command: Set / Manipulate Real Time Attributes of a Linux Process
Viewed 10358 times since Mon, Feb 17, 2020
6 easy steps to setup offline two factor authentication in Linux
Viewed 11226 times since Mon, Apr 6, 2020
8 Vim Tips And Tricks That Will Make You A Pro User
Viewed 2595 times since Fri, Apr 19, 2019
Linux LVM recovery
Viewed 16806 times since Wed, Jan 23, 2019