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
Linux Network (TCP) Performance Tuning with Sysctl
Viewed 13143 times since Fri, Aug 3, 2018
Securing /tmp and shm partitions
Viewed 4029 times since Fri, May 15, 2020
How to deal with dmesg timestamps
Viewed 4598 times since Wed, Oct 3, 2018
logrotate How log rotation works with logrotate
Viewed 9906 times since Sun, Jan 12, 2020
RHEL7 slow ssh login
Viewed 5197 times since Tue, Aug 6, 2019
Modifying the inode count for an ext2/ext3/ext4 file system
Viewed 17216 times since Fri, Sep 18, 2020
LOGROTATE – ARCHIWIAZACJA LOGÓW
Viewed 2733 times since Fri, Nov 30, 2018
Exclude multiple files and directories with rsync
Viewed 3220 times since Wed, Oct 31, 2018
Automatic YUM Updates with Yum-cron
Viewed 11331 times since Fri, Oct 26, 2018
Linux - Cannot login from remote console but can access via ssh
Viewed 6118 times since Fri, Jun 8, 2018