Common question - clone a pool to a new pool

Hi there,

how to clone one pool to another? Capacity wise it´s the smaller one to the bigger one? This get´s me more and more frustrated.

Any help is greatly appreciated. I have to clean up a nonsensical configuration of a NAs and that´s just where to start for me.

Kind regards

It is pretty easy, IF you want to copy existing Dataset & zVols as they are now. I have a script to copy my root pool to alternate boot media on my home Linux PCs, (desktop, laptop & media server).

Here is an example;

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 source and destination pool names.

Don’t forget to set any defaults that you want the Datasets to inherit on your destination pool. Like compression or block sizes. And if you have Datasets that need non-default settings, change the source before the move.