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
KONTO SFTP Z CHROOTEM Z UŻYCIEM OPENSSH-SERVER NA CENTOS/RHEL6
Viewed 2328 times since Fri, Nov 30, 2018
Linux LVM recovery
Viewed 18486 times since Wed, Jan 23, 2019
10 nmap Commands Every Sysadmin Should Know
Viewed 10598 times since Wed, May 22, 2019
Fake A Hollywood Hacker Screen in Linux Terminal linux FUN
Viewed 7156 times since Thu, Apr 18, 2019
logrotate How log rotation works with logrotate
Viewed 9569 times since Sun, Jan 12, 2020
How to convert RAW image to VDI and otherwise
Viewed 15677 times since Wed, Oct 3, 2018
Logrotate Example for Custom Logs
Viewed 3122 times since Sun, Jan 12, 2020
20 Linux Command Tips and Tricks That Will Save You A Lot of Time linux
Viewed 5393 times since Thu, Apr 18, 2019
Method 2 – Use shell scripts How to install yum cron on a CentOS/RHEL 6.x/7.x
Viewed 4673 times since Tue, Dec 4, 2018
Linux – delete the LUN and remove traces from OS
Viewed 4349 times since Tue, May 22, 2018