Fast ZFS Based File Copying

Just a quick try on my new Solaris 11.4… The reflink() function creates a new file with the content of an existing file without reading or writing the underlying data blocks.

root@t7primary01:/downloads# uname -a
SunOS t7primary01 5.11 11.4.0.15.0 sun4v sparc sun4v
root@t7primary01:/downloads# df -h .
Filesystem             Size   Used  Available Capacity  Mounted on
rpool/downloads        1.1T    52G       999G     5%    /downloads
root@t7primary01:/downloads# ls -lh zones.dump
-rw-r--r--   1 root     root         50G Jul 30 09:49 zones.dump
root@t7primary01:/downloads# time cp -z zones.dump zones.dump.zfs.reflink

real	0m11.481s
user	0m0.001s
sys	0m1.932s
root@t7primary01:/downloads# df -h .
Filesystem             Size   Used  Available Capacity  Mounted on
rpool/downloads        1.1T   102G       998G    10%    /downloads
root@t7primary01:/downloads# ls -lh zones.dump*
-rw-r--r--   1 root     root         50G Jul 30 09:49 zones.dump
-rw-r--r--   1 root     root         50G Aug 31 17:29 zones.dump.zfs.reflink
root@t7primary01:/downloads#

That’s cool, isn’t it… might be confusing but seems to be something like a relinking clone which could be very usefull saving space and time…

seems to be here but not really… may become confusing πŸ™‚
used my zfsize:

root@t7primary01:/downloads# $HOME/scripts/zfsize -z rpool/downloads
ZFS = rpool/downloads
Mountpoint = /downloads
TempDir = /tmp
This may take a while ...
FILE	SIZE
/downloads/zones.dump	51331.97 MB
/downloads/zones.dump.zfs.reflink	51331.97 MB
root@t7primary01:/downloads#

2 thoughts on “Fast ZFS Based File Copying”

  1. Hey pressy! I wrote reflink while working at Oracle. It manipulates the dedup tables (DDT) to make the copy.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.