Zfs send/receive entire dataset to new dataset [SOLVED]

So I tried to use this command

zfs send -Rv pool1@snapshot_name | zfs receive -Fdu pool2

As discussed in this thread https://forums.freenas.org/index.php?threads/how-to-copy-one-pool-into-another.16653/

It took a couple of hours (684GB) But the folder is empty?

Is it because I didn't specify it to be copied to a specific dataset?

Check your zpool mountpoints. Sometimes when you send and receive datasets, it copies over the mountpoint and other configuration. if the mountpoints are set properly, check to make sure the dataset is mounted and if it's not, do sudo zfs mount -a to auto-mount all the unmounted datasets.

Thanks for the reply. Unfortunatly I destroyed the new dataset and I'm going to try again :) Would it be easier to just do a cp command?

Yes and no.

a cp command will take longer, and won't preserve attributes, but will copy reliably.

I would use the following: zfs send -Rv pool1@snapshot_name | zfs receive -Fd pool2

Once the transfer is complete, check your mount points because it's a bit wonky. zfs get mountpoint pool2/dataset and zfs set mountpoint=/not/porn pool2/totallynotporn

Ignore the -u option and you should be fine.

1 Like

Thanks it worked. Didn't have do the zfs set command.

Glad to hear it!