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

Western Digital Drives - The Preferred Drives of FreeNAS and TrueNAS CORE

Fuganater

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

Good luck
 

Fuganater

Senior Member
Joined
Sep 28, 2015
Messages
475
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

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

Johannez

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

Johannez

Member
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,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

Senior Member
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

Senior Member
Joined
Aug 1, 2014
Messages
284
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

Senior Member
Joined
Aug 1, 2014
Messages
284
Could you use these same steps with iocage & jails ?
 

sogansfire

Junior Member
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

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

Snow

Senior Member
Joined
Aug 1, 2014
Messages
284
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

Member
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