Moving jails?

Status
Not open for further replies.

maglin

Patron
Joined
Jun 20, 2015
Messages
299
Sorry for this maybe simple question but I can't find my answer.

I built a test pool and built my jails on that. I have a single jail with plex, SabNZB, couch potato, headphonz, and 5 other things running correctly that took me some time to run properly. I have taken a snapshot of the jail and it resides on my production array. I would like to destroy my current test RAIDz1 pool and rebuild it as a stripped mirror.

Is it as simple as building the pool and restoring the snapshot and then configure the jail root to the restored snapshot? I plan to do this tonight when I get home from work.

I want to thank the main people on this forum that help everyone as I have been able to just search and find my answers. Thank you.


Sent from my iPhone using Tapatalk
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
You can use the zfs send / recv commands to duplicate the jails dataset to another pool. However, consider that unsupported from a FreeNAS point of view. The best way is to backup the data in your plugins/jails and re-create them on the new pool.
 

ethereal

Guru
Joined
Sep 10, 2012
Messages
762
i am trying to do this as well - from /mnt/Storage to /mntWorking.

if the best way is to backup the data in the jail can somebody please explain the process - is it done on the server or a client ?
is it done in a shell, gui or in a file explorer ?

thank you
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
i am trying to do this as well - from /mnt/Storage to /mntWorking.

if the best way is to backup the data in the jail can somebody please explain the process - is it done on the server or a client ?
is it done in a shell, gui or in a file explorer ?

thank you

Most of us are comfortable in command line, and use that over anything else for stuff like that.
 

ethereal

Guru
Joined
Sep 10, 2012
Messages
762
which command is required?
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Last edited:

ethereal

Guru
Joined
Sep 10, 2012
Messages
762
Are people aware of the 'warden' command for managing jails? I didn't have success with the snapshot-copy method to move a jail, but below worked.

Do this for each of your jails to stop and export to myjail.wdn in the current jail root.
warden stop myjail
warden export myjail

Change jail root in FreeNAS settings, then import each jail. Had to include 'host' so that it would name the jail correctly otherwise it was named 'OFF'
warden import myjail.wdn --host=myjail

is this the way to go?
 

dpearcefl

Contributor
Joined
Aug 4, 2015
Messages
145
This may work but it is really slow.
 

ethereal

Guru
Joined
Sep 10, 2012
Messages
762
it did move my jail (mysql) but it left behind other folders. in the end i deleted the jail and redid it from scratch.
 

maglin

Patron
Joined
Jun 20, 2015
Messages
299
I was not aware of using warden to move jails. I did get mine moved using

Code:
zfs snapshot -r /pool/dataset@copy

zfs send -Rv /pool/dataset@copy | zfs receive -Fv /destpool/dataset


It didn't work at first because when I created the jail my understanding of FreeNAS was infantile and I didn't know that what looked like a premade dataset was not really the best to use for my jail root. I used that top level dataset and FreeNAS created a new jail dataset, but the template for the jail was put into the top level dataset. Because of this I had to move the top level dataset to move the pool since the pool is using the standard jail template that was not located on the jails dataset. I was getting some origin error when trying to move the dataset. ie..

/pool
/pooldataset <--- folder I set for jails and the template was in
/jail <--- The jail I want to move

I should have just made another dataset to set as the jail root in the jail configuration page. This would make it easier to move all jails using zfs commands which btw was fairly fast. I would be somewhat nice to have this information put into the docs for building pools.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I was not aware of using warden to move jails. I did get mine moved using

Code:
zfs snapshot -r /pool/dataset@copy

zfs send -Rv /pool/dataset@copy | zfs receive -Fv /destpool/dataset


It didn't work at first because when I created the jail my understanding of FreeNAS was infantile and I didn't know that what looked like a premade dataset was not really the best to use for my jail root. I used that top level dataset and FreeNAS created a new jail dataset, but the template for the jail was put into the top level dataset. Because of this I had to move the top level dataset to move the pool since the pool is using the standard jail template that was not located on the jails dataset. I was getting some origin error when trying to move the dataset. ie..

/pool
/pooldataset <--- folder I set for jails and the template was in
/jail <--- The jail I want to move

I should have just made another dataset to set as the jail root in the jail configuration page. This would make it easier to move all jails using zfs commands which btw was fairly fast. I would be somewhat nice to have this information put into the docs for building pools.

So, did your attempt to move your jail fail and you had to recreate it?

I am looking to move my jails to a whole different system and I am looking for advice that is correct to the FreeNAS implementation.

I was reading some possible solutions on the FreeBSD forum, but I was not sure that it would be the correct thing to do in FreeNAS.
 
Status
Not open for further replies.
Top