Resume support in ZFS send/receive

Posted on

Tags: ZFS, FreeBSD

Recently to migrate data from a almost dead drive, I used zfs send/receive, which to my surpise now supports resuming (in FreeBSD 12.1-RELEASE).

To initiate transfer snapshot dying-drive/dataset@backup to zroot/archive/dying-drive, I did:

# /sbin/zfs send -Le -v dying-drive/dataset@backup | /sbin/zfs receive -u -v -s -F zroot/archive/dying-drive

And then to resume the interrupted transfer(s):

# /sbin/zfs send -v -t $(zfs get -o value -H receive_resume_token zroot/archive/dying-drive) | /sbin/zfs receive -u -v -s -F zroot/archive/dying-drive

receive_resume_token has all of the source information encoded in the receive resume token required to resume the transfer, which is why no need to specify the source dataset. For more information, RTFM zfs(8).

So, thanks to ZFS, I was able to transfer all of the data. ๐Ÿ™‚