Can you retroactively enable LZ4 compression and compress existing data?

Status
Not open for further replies.

oRAirwolf

Explorer
Joined
Dec 6, 2016
Messages
55
When I first started using FreeNAS, it was almost exclusively for media storage and I turned off LZ4 compression for the dataset. Now I am using it for a lot more general purpose storage and have enabled LZ4 on the dataset. My question is if FreeNAS will go through the existing data on the dataset and compress it where it can or if it will only do it for new files. If it will not do it automatically, is there a way to force it to?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Any changes you make to the dataset will be effective for data written after the time you make the change. So anything that rewrites the data should get it compressed. But there was no reason to turn it off in the first place.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
If you move all the data to another dataset and then back again it will be compressed. You can do this on the command line with mv or rsync if you are concerned about attributes etc.

But if you have snapshots then the old data will be remembered.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
You can do this on the command line with mv or rsync if you are concerned about attributes etc.
Or replication, if you want the pain-free experience and speed. You can even replicate everything (including the old snapshots) to a new dataset, delete the old one, rename the new one, and go on your merry way.
 
Status
Not open for further replies.
Top