ZFS Send to Resync?

ChrisNAS

Explorer
Joined
Apr 14, 2017
Messages
71
Hello,

I followed a guide to copy data from current pool to a new pool of new hard drives with the plan of replacing the existing drives.

To copy the data over, I used: zfs send -R <old pool>@<name of snapshot> | zfs receive -F <new pool>

That zfs send took a long time to complete and I haven't yet finalized the migration. I believe that there may be some changes in files since doing the zfs send and need to resync the two pools.

Is there a way to resync the data between the two pools again without destroying every I've already copied over? I tried creating a new snapshot of the current pool and using the command again to send it to the new pool again, but it fails with messages like:


TIME SENT SNAPSHOT
cannot receive new filesystem stream: destination has snapshots (eg. NewPool@migration)
must destroy them to overwrite it
]
]warning: cannot send 'OldPool@manual': signal received
TIME SENT SNAPSHOT
warning: cannot send 'OldPool@migration': Broken pipe
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You're missing the incremental switch (-i), which uses a second snapshot (with the original also still specified in the command) to send the differences only.

It would go something like this:

zfs send -R -i <old pool>@<name of snapshot> <old pool>@<name of second snapshot> | zfs recv -F <new pool>

I don't think you need the -F, but it might be OK to leave it.

However: that error you're getting indicates that the copy on the new pool has seen new changes after the sync, which is not good news if you want to keep doing snapshot replication...

You may be better to use rsync to pus over the changes and can then cope with changes on both sides according to the switches you use with it.

If the only change you made on the new pool was to take a snapshot of it, destroy that snapshot and try again with the incremental switch.
 
Top