Deleting old replicated data

Russell Coight

Explorer
Joined
Jul 3, 2014
Messages
53
Hello,

I have two FreeNAS servers, 1 replicating to the other. They're currently running 11.2 but have been in production since about 9.3.

The source ran out of space so I deleted some data that is now backed up elsewhere and deleted the related snapshots and the free space is OK.

The replication task is failing because the destination is still full.

I tried to just delete the files manually from the destination but the file system is read only.

I've found in several threads that I can run:

zfs set readonly=off <dataset>

Is this the only way to do it or is there a better way? Should I set the dataset to readonly again after deleting?

Thanks
 

FlangeMonkey

Contributor
Joined
Dec 6, 2012
Messages
111
I'd want to test this and its dependant on your environment, but I've resolved this before on different platforms, not FreeNAS.

As the snapshots are replicated, you could try deleting the more recent snapshots to clear space at the destination, basically putting it back in time to a place with more space, your new snapshots on the source can then be replicated. You'll need to keep them consistent, so at least one same snapshot at source and destination. I'd test this... There are risks that you'll end up reseeding the data.
 

Russell Coight

Explorer
Joined
Jul 3, 2014
Messages
53
Do you mean deleting the recent snapshots from the source or destination? All of the snapshots were deleted off the source to free up the space initially.
 

PhilipS

Contributor
Joined
May 10, 2016
Messages
179
All of the snapshots were deleted off the source to free up the space initially
If there are no common snapshots between your source and destination, then replication will have to start over from scratch, since there is no longer a common point of reference. Replication is performed at the block level, not the file level.

zfs set readonly=off <dataset>

Is this the only way to do it or is there a better way? Should I set the dataset to readonly again after deleting?
Any changes you make to the destination file system will be rolled back during replication, there is a reason it is read only.

If your replication setup isn't completely broken already, you would want to destroy the oldest snapshots on the destination to free up space. If you turn on in your replication setup "Delete stale snapshots on remote system", then when snapshots are deleted on the source, it will remove them from the destination during replication.
 

Russell Coight

Explorer
Joined
Jul 3, 2014
Messages
53
I tried deleting all of the snapshots on the destination, it only freed up 100GB or so. "Delete stale snapshots on remote system" was already enabled. I ended up just deleting the dataset and let it replicate, all good now.

Thanks guys
 
Top