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: Extending a multipath LUN
Viewed 4480 times since Sun, May 27, 2018
How to use yum-cron to automatically update RHEL/CentOS Linux 6.x / 7.x
Viewed 4736 times since Tue, Dec 4, 2018
20 Practical Examples of RPM Commands in Linux rpm
Viewed 7700 times since Mon, Feb 18, 2019
Prosty skaner portów TCP w bash
Viewed 3016 times since Thu, May 24, 2018
LVM: Reduce an existing Logical Volume / Filesystem
Viewed 3372 times since Sat, Jun 2, 2018
How To: Create Self-Signed Certificate – OpenSSL
Viewed 2722 times since Mon, Feb 18, 2019
6 rsync Examples to Exclude Multiple Files and Directories using exclude-from
Viewed 4549 times since Wed, Oct 31, 2018
HowTo: Find Out Hard Disk Specs / Details on Linux
Viewed 3050 times since Mon, Jan 28, 2019
chrt command: Set / Manipulate Real Time Attributes of a Linux Process
Viewed 10646 times since Mon, Feb 17, 2020
Open SSL HowTo: Decode SSL Certificate
Viewed 5874 times since Mon, Feb 18, 2019