copying datasets across zpools

Joined
Jun 27, 2022
Messages
23
Hi folks,

I'm going to be rebuilding my media zpool... and I have a secondary equal zpool for holding up the data during the rebuilding of the pool and datasets. Both attached to the same machine. What's the go to way to 1, backup my media dataset to the secondary pool? Is it just using Data Replication? shell mv command? And then 2, what's the preferred way for transferring it back?

Current dataset and pool is mnt/vdev01/myDataset
Secondary/holding pool is mnt/tank/mybackup

I will rebuild a new mnt/bank/share/media <<I want to put all data from myDataset into here ultimately.

Thanks folks for the assistance. Love the product.
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hi,

Indeed, replication is what you are looking for. In the GUI, it is designed for recurrent tasks. Instead of doing it that way, I would SSH in the box and do the zfs send | zfs receive in the cli.

What you need is something like
# zfs send tank/data@snap1 | zfs recv spool/ds01

Of course, adjust according to your own environment. Because you are doing this for the first time, I recommend you create a new dataset and put only a few MB of junk. Then you snapshot it and send / receive it in your second pool. Once comfortable, delete that junk (original, snapshots and replicated copies) and do it with the real stuff.
 
Top