How to rebuild mirror/replicate a pool

I don’t know the GUI way, but I do use a command line method to clone the OS pool on my Linux computers, (all of which use ZFS), to alternate media for recovery.

Basically this:

zfs snapshot -r ${MY_SRC_POOL}@${MY_SNAP}
zfs send  -Rpv  ${MY_SRC_POOL}@${MY_SNAP} | \
  zfs receive -dFu ${MY_DEST_POOL}

zfs destroy -rv ${MY_SRC_POOL}@${MY_SNAP}
zfs destroy -rv ${MY_DEST_POOL}@${MY_SNAP}

Replace ${MY_SNAP} with a unique snapshot name. Then replace the pool names as well.

When done, you can export the original pool and rename the new pool to be the same as the old pool. That is covered in a Resource forum post if I remember correctly.


Now on the subject of new pool creation. There is some wisdom creating the new pool with reduced features. For example, creating the new pool using an older version of TrueNAS, would allow the use of that older version of TrueNAS.

However, creating the new pool with the latest version of TrueNAS means that any feature that is active and not available on an earlier version of TrueNAS means you can’t ever use that earlier version of TrueNAS. That pool is forward compatible, not backwards compatible.


Note: I have been told that one or more of the Send or Receive parameters are redundant. Since it works anyway, I have not bothered to update my script that does the work.