Moving Jails?

Status
Not open for further replies.

Naesstrom

Contributor
Joined
Jul 10, 2012
Messages
108
So, when I first started out with freenas I installed 2 small disks, no mirroring or anything. Later I added 2 larger disks (4Tb) and kept the first ones for the Jails as you can see here:
IKzgfD6.png

Problem is that now I've filled the larg disks and need to add more to expand the storage but I want to remove the two old one to free up some sata slots!

How can I create a new dataset on the larger disks and move the Jails there without loosing all the settings etc. I have configured in each jail?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Short answers, you don't.

Long answer.. you can move them via ZFS snapshot and replication, rename the pool so it matches the jails appear to be in the same location as before, and then it will work.

Really time consuming answer... destroy the jails, make them on the new pool, then redo all your setup. The reality is that if you do proper planning (which also includes redundancy) then you can "upgrade" pools to larger sizes by replacing all the disks one-by-one. The manual discusses how to do this. So for most people you create a single pool and you make your pool bigger simply by adding more vdevs or buying bigger disks. None of this moving of jails thing should be necessary.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
I asked a similar question a while back, and received the same answer. But let me ask you another question: Do you back up your jails? Some of them, such as your Plex jail, contain a lot of data and I would think you don't want to lose all that.

I looked into ZFS snapshots and replication, then decided there were too many ways to make a serious mistake. So I followed the time consuming method of destroying the old jails and recreating them on a new volume. However, because I backup everything, I was able to restore data in the jails, so I didn't lose anything important. True, I had to recreate shares and take care of a few other odds and ends, but in the end it wasn't too bad. Tedious, yes, but not a showstopper.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Nope. I just do snapshots and leave them on the pool until I decide to delete them.

If somehow my jails got messed up I can either roll back to a snapshot and if I don't have snapshots I probably don't give a crap about the jails as I'll have bigger problems to deal with.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
You could probably use the "warden export" and "warden import" commands. Warden will export the jail to a .wdn file that you can then import once you reconfigure your server. I wish they would expose more of the Warden CLI in the GUI.

By the way, this is probably not an officially sanctioned way of handling jails. :)
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Nope. I just do snapshots and leave them on the pool until I decide to delete them.

If somehow my jails got messed up I can either roll back to a snapshot and if I don't have snapshots I probably don't give a crap about the jails as I'll have bigger problems to deal with.
I definitely agree and was in no way suggesting that one should not do snapshots.

However, for someone who is not too experienced with the underpinnings of FreeNAS, and wants to do something a little complex like move jails, I think it is best to work through the GUI as much as possible. There are just too many ways to mess things up if you are not familiar with the CLI and the way FreeNAS works. In my specific case, I was able to move jails without too much problem and I learned quite a lot about the layout of jails, templates, how certain plugins store their data, etc. I consider the two hours or so that I spent moving my jails to be a good education.
 
Status
Not open for further replies.
Top