Moving Jails from main volume to new SSD volume

Fuganater

Patron
Joined
Sep 28, 2015
Messages
477
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
6,421
Turn off plugins/jails, snapshot jails dataset, replicate snapshot to other pool, change jail root directory and start plugins/jails.

Good luck
 

Fuganater

Patron
Joined
Sep 28, 2015
Messages
477
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

Contributor
Joined
Aug 4, 2015
Messages
145
This works! And it's really fast.
 

Johannez

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

Johannez

Explorer
Joined
Jan 25, 2016
Messages
59
The move worked on both my systems but there seems to be a problem after the move, i cant install another plugin or jail anymore. 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...emplate-cant-install-new-plugins-jails.46205/
 
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,874
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

Guru
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

Patron
Joined
Aug 1, 2014
Messages
309
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

Patron
Joined
Aug 1, 2014
Messages
309
Could you use these same steps with iocage & jails ?
 

horse_porcupine

Dabbler
Joined
Jun 11, 2013
Messages
22
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

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

Snow

Patron
Joined
Aug 1, 2014
Messages
309
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.
 

markymark832

Dabbler
Joined
Feb 28, 2017
Messages
36
Hi all, i am trying to move my jails off a dying single disk, the first command works ok and i see snapshots in my webgui

Dataset Snapshot
Jails-VMs/iocage/jails/Heimdall/root relocate
Jails-VMs/iocage/jails/Heimdall relocate


but then get the following when sending them..

root@freenas[/mnt/Jails-VMs/iocage]# zfs send -R Jails-VMs/iocage/jails@relocate |zfs receive -v Jails/iocag e/jails
receiving full stream of Jails-VMs/iocage/jails@relocate into Jails/iocage/jails@relocate
received 56.9KB stream in 1 seconds (56.9KB/sec)
receiving full stream of Jails-VMs/iocage/jails/Heimdall@relocate into Jails/iocage/jails/Heimdall@relocate
received 50.8KB stream in 1 seconds (50.8KB/sec)
cannot receive: local origin for clone Jails/iocage/jails/Heimdall/root@relocate does not exist
warning: cannot send 'Jails-VMs/iocage/jails/Heimdall/root@relocate': signal received


any ideas? is it due to them being iocage?
 
Last edited:
Top