Is it advantageous to use zfs send/receive in this situation (source and destination are all within the same host/PC)?

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

mrjayviper

Member
Jul 28, 2017
62
2
8
54
TLDR: I need to destroy and recreate my pool. I'm wondering what advantages is available to me when using zfs send/receive vs good old rsync. I've search the net but cannot find the answer. This is with the assumption zfs send/receive is available to me.

I need to recreate my pool as I've made mistakes in its creation.

-------------------------------------------------------------------

setup:
  1. 8-drive raidz1 pool (around 9.5TB in used spaced according to du -d1-h) (let's call this spool and no datasets on this one)
  2. 4-drive raidz1 pool (around 8.5TB in total space) (let's call this dpool1 and no datasets on this one as well.
  3. 1-drive striped pool (around 2TB in total space) (let's call this dpool2 and no datasets on this one as well.)
  4. Because i don't have enough disks to I have to temporarily copy the contents of spool to several pools.
  5. There are 5 main folders in spool. The biggest folder in spool is around 9TB. This folder has 10 subfolders. To maximize space, I transferred (via rsync) 9 subfolders to dpool1 and this consumed around 8.3TB space. To make it easy to explain, let's call the folder not copied to dpool1 as "not-copied-subfolder"
  6. Any leftover contents that hasn't been copied to dpool1 were transferred to dpool2 via rsync.
  7. In the new pool, I will be creating 5 datasets to correspond to the 5 main folders mentioned in no.5. Am I able to use zfs send/receive to transfer the data from dpool1-2 using this method? I have a feeling it's not possible because looking at the oracle documentation and "man zfs", it clearly mentioned the word snapshot.
  8. In the remote possibility that no.7 is possible, can I use zfs send/receive to transfer the "not-copied-subfolder" I had to copy to dpool2 back into it's original folder?
Thank you.
 

gea

Well-Known Member
Dec 31, 2010
3,238
1,236
113
DE
ZFS replication allows you to transfer or sync a ZFS filesystem below another ZFS filesystem (a pool itself is a ZFS filesystem) on same or different server. Main advantage over rsync is superiour performance, security (transfer is protected via checksums) and that it preserves ZFS properties.

Replication is based on snaps. This means that you create a ZFS snap of a filesystem and send the snap (this is a freeze of the filesystem on creation time) to a destination.

ex
snap of tank1/data -> tank2 results in tank2/data

you can zfs send recursively to include daughter filesystems ex