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
www.unixarena.com
Viewed 3120 times since Fri, Jul 27, 2018
Top 4 Reasons for Node Reboot or Node Eviction in Real Application Cluster (RAC) Environment
Viewed 109578 times since Thu, Jun 21, 2018
Turbocharge PuTTY with 12 Powerful Add-Ons – Software for Geeks #3
Viewed 16014 times since Sun, Sep 30, 2018
Prosty skaner portów TCP w bash
Viewed 4065 times since Thu, May 24, 2018
How to encrypt a partition using LUKS?
Viewed 2696 times since Fri, Jul 13, 2018
Jak ustawić LVM, jak robić snapshoty oraz automatycznie powiększać LV, czyli małe howto
Viewed 5731 times since Sun, May 20, 2018
Understanding logrotate utility part 1
Viewed 2575 times since Fri, Nov 30, 2018
RHEL: Displaying/setting kernel parameters - ’sysctl’
Viewed 4153 times since Sat, Jun 2, 2018
CONFIGURE FOR ASM Linux
Viewed 6332 times since Sat, Jun 2, 2018
how to list all hard disks in linux from command line
Viewed 5544 times since Mon, Jan 28, 2019