Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Moving Jails from main volume to new SSD volume

Fuganater

FreeNAS Experienced
Joined
Sep 28, 2015
Messages
473
So I want to move my jails from my main volume (Vol1) to a mirrored pair of 240GB SSDs (Jails). I know some other people on here have done it but I am unable to find the threads on how to do it. So what do I need to do to move the data safely?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
5,909
Turn off plugins/jails, snapshot jails dataset, replicate snapshot to other pool, change jail root directory and start plugins/jails.

Good luck
 

Fuganater

FreeNAS Experienced
Joined
Sep 28, 2015
Messages
473
So I found these steps and everything seems to have worked.

Steps:
  1. Turn off all plugins (Plugins->Installed)
  2. Stop all jails (Jails->View Jails)
  3. Run these commands via CLI:
    zfs snapshot -r main_pool/jails@relocate
    zfs send -R main_pool/jails@relocate | zfs receive -v ssd_pool/jails
  4. Change the Jail Root to /mnt/ssd_pool/jails (Jails->Configuration)
  5. Start jails/plugins
  6. Check that everything works and destroy the original jails dataset (main_pool/jails)
 

dpearcefl

FreeNAS Experienced
Joined
Aug 4, 2015
Messages
134
This works! And it's really fast.
 

Johannez

Newbie
Joined
Jan 25, 2016
Messages
59
Thank you very much. It worked perfect.
 

Johannez

Newbie
Joined
Jan 25, 2016
Messages
59
Last edited:
Joined
Oct 28, 2016
Messages
3
"3. Use the GUI to create a snapshot of the dataset you want to move. If you want to move everything, select the root dataset. For flexibility in the future, I'd suggest checking the "recursive" option. Also, minimize use of tank. You will want to pick a time where nothing is changing, then ensure you have a snapshot, and then wait for replication to finish. The amount of time this will take depends on how much storage and the speed of your machine. It took ~36 hours to move 20TB locally for me. [ alternatively, you can use the CLI to create the snapshot and then replicate manually. "zfs snapshot -r tank@migrate" and then "zfs send -R tank@migrate | zfs receive temp-tank"]

I've created a snapshot, but I can't seem to figure out how to start the replication using the GUI. I understand a snapshot does not use any data, but how do you then tell the system to duplicate the data on the other volume? If I add a replication task it wants to know the remote host name, and I am currently only using one FreeNAS system.
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,862
I understand a snapshot does not use any data, but how do you then tell the system to duplicate the data on the other volume?
That's what replication does. It replicates the snapshots of a dataset to a second location.
If I add a replication task it wants to know the remote host name, and I am currently only using one FreeNAS system.
Use localhost or 127.0.0.1 as the hostame to replicate locally.
 

IceBoosteR

FreeNAS Experienced
Joined
Sep 27, 2016
Messages
503
Thanks, worked like a charm on FreeNAS 11.0-U4, no problem when starting the jails. Creating jails does also work!
 

Snow

FreeNAS Experienced
Joined
Aug 1, 2014
Messages
242
So I found these steps and everything seems to have worked.

Steps:
  1. Turn off all plugins (Plugins->Installed)
  2. Stop all jails (Jails->View Jails)
  3. Run these commands via CLI:
    zfs snapshot -r main_pool/jails@relocate
    zfs send -R main_pool/jails@relocate | zfs receive -v ssd_pool/jails
  4. Change the Jail Root to /mnt/ssd_pool/jails (Jails->Configuration)
  5. Start jails/plugins
  6. Check that everything works and destroy the original jails dataset (main_pool/jails)
You should add the pv command so you can see the progress. Thanks For the quick and dirty Guide!!!
Code:
zfs send -R main_pool/jails@relocate | pv | zfs receive -v SSD_Pool/jails
 

Snow

FreeNAS Experienced
Joined
Aug 1, 2014
Messages
242
Could you use these same steps with iocage & jails ?
 

sogansfire

Newbie
Joined
Jun 11, 2013
Messages
13
Could you use these same steps with iocage & jails ?
I'm looking for a similar answer myself! :) I want to move my jails to an SSD, primarily to improve the speed with which Plex metadata loads and to cut down on how frequently my HDD's get accessed. Has anyone been able to get this working for iocage jails in FreeNAS 11.2?
 

Kris Heslop

Newbie
Joined
Feb 7, 2016
Messages
28
Count me in as looking for the same answer.
 

Snow

FreeNAS Experienced
Joined
Aug 1, 2014
Messages
242
Yes it works great. I used it to move stuff from ssd pool 1 to ssd pool 2. Think we did have to remap some iocage stuff but its not hard to do, if you look it up. iocage fstab stuff.
 
Top