#!/bin/ksh NO_LOOP_BREAK=true function loop { while $NO_LOOP_BREAK; do cp /testpool/file /testpool/clone; done } zpool destroy -f testpool zpool create -o feature@block_cloning=enabled testpool /dev/da*p2 echo "Creating file" dd if=/dev/urandom of=/testpool/file bs=1M count=4000 zpool sync testpool echo "Copying entire file with FICLONE" cp /testpool/file /testpool/clone zpool sync testpool echo "looping a clone" loop & dd if=/dev/urandom of=/testpool/clone bs=1M count=4000 dd if=/dev/urandom of=/testpool/clone bs=1M count=4000 NO_LOOP_BREAK=false echo "done" zpool sync testpool