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
Thanks
29
#1
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?
 
Joined
Nov 6, 2013
Messages
5,897
Thanks
982
#2
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
Thanks
29
#3
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
Thanks
8
#4
This works! And it's really fast.
 
Joined
Jan 25, 2016
Messages
59
Thanks
6
#5
Thank you very much. It worked perfect.
 
Joined
Jan 25, 2016
Messages
59
Thanks
6
#6
The move worked on both my systems but there seems to be a problem after the move, i can't install another plugin or jail any more. i get the message "Unable to find template" I have not changed anything in the jail setup or the dataset. Even after a fresh install i am not able to install a jail or plugin.

I have not been able to fix it yet, more information:
https://forums.freenas.org/index.ph...mplate-can't-install-new-plugins-jails.46205/
 
Last edited:
Joined
Oct 28, 2016
Messages
3
Thanks
0
#7
"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
Thanks
488
#8
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
70
#9
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
223
Thanks
57
#10
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
 
Top