I started to get those pesky e-mails, saying that ‘Space usage for pool “Detainer” is 98%. Optimal pool performance requires used space remain below 80%.’
So I wanted to move a Dataset, “Audio”, to another Pool to free up some space. This is how I did it.
Table of contents
A pool containing the original dataset Audio named Detainer and a new pool named Destroyer.
- FreeNAS 11.2
- 2 pools
- Understanding replication/snapshot tasks
FreeNAS gui > Periodic Snapshot Tasks > ADD. Pool/Dataset: Detainer/Audio Recursive: v Snapshot Lifetime: 2 Weeks Begin: 00:00:00 End: 23:59:00 Interval: 5 minutes Day of week: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday v Enabled
FreeNAS gui > Storage > Pools > Destroyer and on the three little dots to the far right, click Add Dataset: Name: Audio Comments: Audio Library Share Type: Windows
Select the newly created Dataset, and on the far right, click the three little dots and select Edit Permissions. v Apply User User: mogabe v Apply Group Group: audio
Apply Permissions recursively is not neseccary, as we do not have anything there yet.
FreeNAS gui > Replication Tasks > ADD. Pool/Dataset: Detainer Remote ZFS Pool/Dataset: Detainer v Recursively Replicate Child Dataset Snapshots v Delete Stale Snapshots on Remote System Replication Stream Compression: lz4 (fastest) Limit (kpbks): 0 Begin Time: 00:00:00 End Time: 23:59:00 v Enabled Remote Hostname: localhost Remote Port: 22 Encryption Cipher: standard uncheck Dedicated User Enabled Remote Hostkey* > SCAN SSH KEY
Replicate the Dataset from the pool to another pool by using the Tasks > Replication Tasks. Pool: Detainer > Dataset ‘Audio replicates to Pool: Destroyer > Dataset ‘Audio’
Wait until the replication is done.
We want to make sure that the jails/VMs you have that are using the original Dataset is shut down. This is to ensure file integrity, and that we are able to move all the latest files. For instance, I have the dataset Audio mounted in Plex as a read-only folder. I have it mounted with write permissions on the Audio dataset in Lidarr.
FreeNAS gui > Jails > select Lidarr and press STOP.
FreeNAS gui > Jails > select Plex and press STOP.
FreeNAS gui > Tasks > Replication Tasks > click the three little dots on the right of our task, select Edit and disable it by removing the checkmark to the left of ‘Enabled’.
FreeNAS gui > Jails > Lidarr > click the three little dots on the right of Lidarr, select Mount Points. Delete the mount point by clicking the three dots and select Delete. Check ‘Confirm’ and press ‘DELETE MOUNT POINT’.
ACTIONS > + Add Mount Point Source : /mnt/Destroyer/Audio Destination : /mnt/Audio
Do the same for any other jails using the original Mount Point.
FreeNAS gui > Jails > select Plex and press START.
FreeNAS gui > Jails > select Lidarr and press START.
Select the three little dots on the far right of your original Dataset (Detainer/Audio) and click ‘Edit permissions’. Take a note of what type of ACL it is using, who is the owner of the folder and which group is the owner of the folder.
And with a Windows computer, mount the share (if the dataset is used by SMB) and take a note of all the permissions under the Security tab under mount Properties.
FreeNAS gui > Services > select the slider to the right of ‘SMB’ and stop the service.
FreeNAS gui > Sharing > Windows (SMB) Shares and select Audio.
Edit the path so that it changed from /mnt/Detainer/Audio to /mnt/Destroyer/Audio
FreeNAS gui > Services > select the slider to the right of ‘SMB’ and start the service.
To finally free up space, delete the dataset. FreeNAS gui > Storage > Pools > select Detainer/Audio and click the three little dots to the right and press ‘Delete Dataset’.
Now we want to be sure to enable a periodic snapshot task to our new Audio dataset on the pool ‘Destroyer’.
FreeNAS gui > Periodic Snapshot Tasks > ADD. Pool/Dataset: Destroyer/Audio Recursive: uncheck Snapshot Lifetime: 2 Weeks Begin: 00:00:00 End: 23:59:00 Interval: 2 hours Day of week: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday v Enabled
Edit our original replication task.
After you have shut down all the services that might write to the original Dataset, go in FreeNAS gui > Tasks > Periodic Snapshot Tasks. Select and edit the Detainer/Audio task and alter the frequency down to 5 minutes.
This is only necessary if you see that the size of ‘Detainer\Audio’ and ‘Destroyer\Replicated\Audio’ is not equal. You should now see under Replications Tasks that the task is changed from ‘Up to date’ to ‘Sending’.
Refresh that page until the Status has changed to ‘Up to date’. Confirm by checking that the Used space is the same.