mount_nullfs not persistent after reboot, jail hostname doesn't match jail dir name

Status
Not open for further replies.

Hisma

Explorer
Joined
Mar 23, 2013
Messages
87
I have an annoying problem and was hoping someone can help me. (actually 2 problems, but if I can solve just one of the two, I'd be happy)

I have a jail that I want to mount some storage on so I can have some scripts run commands inside the jail and copy files to the "outside world".

The problem is that the jail has a different hostname than it's directory, and this happened b/c I recovered the jail from a previous install (warden gave the directory a horrible name, "OFF", when the hostname is "nginx"). So the gui sees the hostname "nginx", but can't resolve the hostname to the directory name, since the two are different.

I get around this by managing the jail from the command-line only. Easy enough, but if I mount storage using "mount_nullfs", the storage dissapears after reboot and I have to re-add it. Annoying because I can forget to remount.

How can I get the storage to be persistent after reboot?

Also, if someone knows how I can get my jail hostname to match the jail directory name, or vice versa, I'd really appreciate that as well. I don't want to break the jail though, and from the little research I did, messing with the jail hostname creates tons of headaches. If I could find a way to rename the jail directory from "OFF" to "nginx", that'd be awesome.

thanks!
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Well, you can't 'recover' jail installs from an old install. You could, but it would require some hackery and trickery. Then there's always the chance that things will go wrong either now or in the future. In short, not really supported. The FreeNAS config and the jails pretty much need to stick together. If you lose your config then you pretty much lose those jails. :(

Your best success path is to create a new jail and do the reinstallation and re-setup as necessary to support the new FreeNAS install.
 

Hisma

Explorer
Joined
Mar 23, 2013
Messages
87
Well, you can't 'recover' jail installs from an old install. You could, but it would require some hackery and trickery. Then there's always the chance that things will go wrong either now or in the future. In short, not really supported. The FreeNAS config and the jails pretty much need to stick together. If you lose your config then you pretty much lose those jails. :(

Your best success path is to create a new jail and do the reinstallation and re-setup as necessary to support the new FreeNAS install.

Except I DID recover the jail from an old install, and it worked mostly fine.

http://webcave.us/2014/04/freebsd-freenas-clone-jail/

On the old system (freenas 8.2):
Code:
warden export name_of_jail --dir=/directory_for_warden_file

On new system (freenas 9):
Code:
warden import jail_warden_file.wdn --host=jailbird --ipv4=192.168.1.105/24

Doing this worked well. But, it created a jail named OFF, for some reason, instead of having it match the hostname, nginx.
The jail still works perfectly fine. I can even "see" it from freenas GUI. I just have the annoying issue of having to administer it through the cli only.

I have n0 desire to build up that jail from scratch. It's heavily modified, and I can't even remember everything I put on there to get it where it is. If it comes down to it, i'll simply leave it as-is.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Keyword: "mostly worked fine".

That's why I said "there's always the chance that things will go wrong either now or in the future".

Overall, I'd look at rebuilding the jail as the best long-term solution. I've helped a few people hack their configs to make a jail work with a new config file. While it seems to always work at first, later problems creep up and then the jail just stops starting.

So while I commend you on your determination to make it work, I don't think you are making the best long-term solution for your bigger problem.

Sorry but I don't know how to fix your problem aside from a new jail. :(
 
Status
Not open for further replies.
Top