16 February 2018

Solaris 11.4 Beta: Fast (asynchronous) ZFS destroy

A destroy of a larger ZFS filesystem takes some time.
If you would like to destroy and re-create a filesystem
you need to wait till the destroy is done.

This was the case in the past. Solaris 11.4 Beta
includes a new feature: It destroys ZFS filesystems asynchronously.

You can re-create your filesystem quickly. The destroy
runs in the background. Using zpool monitor you
see how long the background destroy takes.

# zfs list destroytest/fs1
NAME USED AVAIL REFER MOUNTPOINT
destroytest/fs1 22.1G 17.1G 22.1G /fs1


# time zfs destroy destroytest/fs1; zfs create -o mountpoint=/fs1 destroytest/fs1

real 0m0.654s
user 0m0.005s
sys 0m0.621s




# zpool monitor -t destroy destroytest 5
POOL PROVIDER TOTAL SPEED TIMELEFT
destroytest destroy 22.1G 0 unknown
destroytest destroy 20.1G 401M 51s
destroytest destroy 13.5G 872M 15s
destroytest destroy 10.8G 767M 14s
destroytest destroy 4.92G 878M 5s



If you need to wait till the filesystem is destroyed completely
you can use the new -s flag.

# time zfs destroy -s destroytest/fs1


real 0m26.438s
user 0m0.005s
sys 0m0.509s



Learn more about the new Solaris 11.4 Beta on

2 comments:

  1. OpenZFS has had this feature since 2012 :)

    http://open-zfs.org/wiki/Features#Asynchronous_Filesystem_and_Volume_Destruction

    ReplyDelete
  2. Original S12 builds started in 2012. :-)
    This is the list of ZFS related features in the S11.4 beta build. More to come!
    https://blogs.oracle.com/zfs/oracle-solaris-114-data-management-features

    ReplyDelete