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
ubuntu How to Reset Forgotten Root Password in Ubuntu
Viewed 3076 times since Tue, Dec 8, 2020
How to convert RAW image to VDI and otherwise
Viewed 15190 times since Wed, Oct 3, 2018
Linux Linux Network Statistics Tools / Commands
Viewed 9321 times since Mon, Sep 21, 2020
Learn Linux System Auditing with Auditd Tool on CentOS/RHEL
Viewed 4501 times since Fri, Apr 5, 2019
How to accurately determine when the system was booted
Viewed 2433 times since Wed, Oct 3, 2018
Linux Health Check Commands
Viewed 3312 times since Fri, Jun 8, 2018
How To Create a Linux Swap File
Viewed 2594 times since Fri, Jun 8, 2018
ZPOOL: Grow a zpool by adding new device(s)
Viewed 6184 times since Sun, Jun 3, 2018
Fedora 32: Simple Local File-Sharing with Samba CIFS Linux
Viewed 8973 times since Sun, Dec 6, 2020
How to deal with dmesg timestamps
Viewed 3721 times since Wed, Oct 3, 2018