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
RHEL: Rename a network interface on RHEL 7
Viewed 10691 times since Sat, Jun 2, 2018
Linux - How to monitor memory usage
Viewed 3143 times since Fri, Jun 8, 2018
RHCS6: Create a new Logical Volume / Global Filesystem 2 (GFS2)
Viewed 2332 times since Sun, Jun 3, 2018
RHEL: Reserved space on a ext2/ext3/ext4 filesystem
Viewed 4560 times since Sun, May 27, 2018
Epoch & Unix Timestamp Conversion Tools
Viewed 62956 times since Fri, Jun 22, 2018
HowTo: Find Out Hard Disk Specs / Details on Linux
Viewed 3588 times since Mon, Jan 28, 2019
Linux: Disks diagnostic using smartctl
Viewed 15181 times since Wed, Jul 25, 2018
linux-training.be gives you books for free to study Linux
Viewed 5006 times since Sat, Jun 2, 2018
RHEL: Enabling standard ftp/telnet
Viewed 3555 times since Sun, May 27, 2018
stunnel Howto A Guide to create SSL access to a HTTP-only webserver with stunnel
Viewed 2772 times since Fri, Sep 28, 2018