Local replication does not copy the data

fabien_r

Cadet
Joined
Dec 30, 2014
Messages
5
Hi,
I created a replication task to copy all my data from my existing pool tank1 to my new pool tank2 (I installed new disks in my server). I need to run the replication task only once, then I will use only the new pool tank2.
After running the task, the replication tasks summary shows:
- status: finished
- last snapshot: No snapshots sent yet.
When I check the content of tank2 with the shell, I can find only the top level folders, but each folder is empty...
What did I miss?
Thanks for your help!
 

bkw777

Cadet
Joined
Aug 7, 2022
Messages
8
Mostly you're missing the source snapshots. The replication task doesn't do it automatically except in the one special case where you only use the basic not advanced interface to create the task, in that case it will create the initial snapshot(s) one time behind the scenes but not again on subsequent manual "run now". It just re-sends the existing snapshots after that, and only the scheduled snapshot task updates the source snapshots.

In your case I think the ui doesn't provide a simple option for this, which is a bit mindboggling since it seems like a pretty common basic need. In your case since this is a one-time operation it's probably simplest to use only use the gui to create the tank2 pool with the new disks, and then use the shell to use zfs send/receive commands to clone everything. There's a bunch of different posts with examples of that like
https://www.truenas.com/community/threads/migrate-pool-data-to-new-pool.97214/ (I don't know enough to offer recommendation that this post is especially perfect, just that it's an example that looks reasonable. I would search and read a few different similar ones and try the steps with junk temp datasets)

But to use the replication task from the gui, see: https://www.truenas.com/community/t...ails-for-disaster-recovery.78655/#post-711256

In your case, after doing the replication manually, you'll need to delete or at least disable both the snapshot and replication tasks, and then edit the new datasets on tank2 to remove the read-only flag.

I think this can't possibly be the best way to do this, but I'm just answering the question specifically about why the replication task didn't do anything.
I'm doing that because in my case I'm maintaining a backup of my entire iocage dataset from a fast-but-unsafe ssd pool to the slow-but-safe main pool. So the snapshots and replication are in fact re-run periodically and I'll only switch over to the destination dataset when one of the ssd's explodes.
 

gwpotter

Dabbler
Joined
Oct 7, 2021
Messages
10
If you are just increasing the pool size within the same machine ,just replace disks one at a time and let it resilver automatically. Once you replace all the disks the pool automatically expands to the new size.
I've down this on two separate boxes successfully
 
Top