Migrating volumes via replication

Status
Not open for further replies.

elangley

Contributor
Joined
Jun 4, 2012
Messages
109
Hello All,

Running: FreeNAS-9.3-STABLE-201602031011

A volume (/data) has been migrated to a different FreeNAS installation using Replication. The volume exists and there is one snapshot.

Now I want to use (/data) as a production volume. I am deleting the replication job.

How can the snapshot be deleted yet retain the volume for use as live data permanently?

TIA,

~eric
 

PhilipS

Contributor
Joined
May 10, 2016
Messages
179
I'm not sure if I am following, but you should be able to delete the snapshot from the web interface in storage, snapshots.
To be able to write to a replicated dataset, you will need to turn off the readonly attribute on the dataset from the shell:

zfs set readonly=off data
 

elangley

Contributor
Joined
Jun 4, 2012
Messages
109
Thanks Phil,

I deleted the replication job and even though I did not change 'zfs set readonly=off' writes are possible to the replicated volume with no issues.

Was also able to delete the replicated snapshots with no issue.

~eric
 

PhilipS

Contributor
Joined
May 10, 2016
Messages
179
FWIW, If you create the replication target dataset prior to setting up a replication task, then the dataset will not be set readonly=on (it would be set to inherit). The issue with doing this in a normal scenario is that someone can write data to the target and then have it wiped out by a subsequent replication and lose that data.
 

elangley

Contributor
Joined
Jun 4, 2012
Messages
109
FWIW, If you create the replication target dataset prior to setting up a replication task, then the dataset will not be set readonly=on (it would be set to inherit). The issue with doing this in a normal scenario is that someone can write data to the target and then have it wiped out by a subsequent replication and lose that data.

Not sure how that would work. You simply tell the PUSH system which dataset to replicate to. I created a dataset named 'remote' that was writable since there is no way to set readonly in the GUI.

Is there a way to view what the current 'readonly=' setting is for a volume.

Thanks, I am aware of the overwrite issue with replicated data as the most recent snapshot becomes the volume data.

~e
 

PhilipS

Contributor
Joined
May 10, 2016
Messages
179
Not sure how that would work. You simply tell the PUSH system which dataset to replicate to. I created a dataset named 'remote' that was writable since there is no way to set readonly in the GUI.
If the dataset specified in "Remote ZFS Volume/Dataset" does not exist on the remote side, the replication script will create it. When it does it will create it with the readonly attribute set to "on". Since you created a dataset on the remote, the script saw that it was already present and used it.

Not sure why they don't allow to set readonly through the GUI - maybe a feature request should be put in for this to be added to the dataset options in advanced mode. Edit: Feature request https://bugs.pcbsd.org/issues/22304

Is there a way to view what the current 'readonly=' setting is for a volume.
There is a column in storage, volumes that shows the readonly attribute (at least there is in 9.10.2) or from the shell: zfs get readonly <dataset>
 
Last edited:

PhilipS

Contributor
Joined
May 10, 2016
Messages
179
Status
Not open for further replies.
Top