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
How log rotation works with logrotate
Viewed 5040 times since Fri, Nov 30, 2018
Linux: Disks diagnostic using smartctl
Viewed 15281 times since Wed, Jul 25, 2018
What UUIDs can do for you
Viewed 1904 times since Tue, Jul 17, 2018
HowTo: Create CSR using OpenSSL Without Prompt (Non-Interactive)
Viewed 14274 times since Mon, Feb 18, 2019
6 easy steps to setup offline two factor authentication in Linux
Viewed 13503 times since Mon, Apr 6, 2020
Find All Large Files On A Linux System
Viewed 2347 times since Mon, Oct 29, 2018
How to create a Systemd service in Linux
Viewed 3118 times since Mon, Dec 7, 2020
Linux – Securing your important files with XFS extendend attributes
Viewed 7661 times since Wed, Jul 25, 2018
ZPOOL: Detach a submirror from a mirrored zpool
Viewed 2843 times since Sun, Jun 3, 2018
10 Linux cryptsetup Examples for LUKS Key Management (How to Add, Remove, Change, Reset LUKS encryption Key)
Viewed 5343 times since Tue, Jul 31, 2018