This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!
I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!
it will taken offline by the end of march 2021!
I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!
Move jail(s)/finch to another machine.
-
Babovand
- Starter

- Posts: 46
- Joined: 23 Jun 2012 16:25
- Status: Offline
Move jail(s)/finch to another machine.
Is there a safe and possible way to move/copy/backup finch and all the jails to another machine? and run the "new" jails from new machine?
-
dreamcat4
- experienced User

- Posts: 111
- Joined: 21 Mar 2014 21:59
- Status: Offline
Re: Move jail(s)/finch to another machine.
When moving from disk - to - another disk. Someone said they had problems with chsflag permissions on some special files. So that is something to be aware of. I would not think to ditch your old system until the new machine is fully up and running perfectly. In case anything unforseen goes wrong.
Perhaps you could stop finch. That should stop everything inside it too, and umount the /dev folder (devfs). After that then tar up the whole finch folder hopefully the tar program should preserve the file ownership and permissions etc.
Copy the tar archive to new machine and untar it on the new machine. The thing is freebsd is a big and complex system. And a tar archive of your whole freeBSD would be pretty large file (several gigabytes). Perhaps it might be less hassle to make a fresh install of finch on the new machine. Especially if the new machine will be running a newer version of FreeBSD anyway (like 9.2 --> 9.3).
After installing a pristene copy of finch. Then you could tar up just only the previous /usr/jails subfolder (in your old finch). Be sure to stop finch first of all. Then copy that /usr/jails archive across. mv the NEW /usr/jails to a safe location and don't delete it yet. Restore the old /usr/jails folder. Finally to run `qjail update -b` to update any outdated freebsd programs / libraries inside of your unpacked jails...
If you had made any other customiations in finch apart from your jails then you may need to copy other things across also.
Perhaps you could stop finch. That should stop everything inside it too, and umount the /dev folder (devfs). After that then tar up the whole finch folder hopefully the tar program should preserve the file ownership and permissions etc.
Copy the tar archive to new machine and untar it on the new machine. The thing is freebsd is a big and complex system. And a tar archive of your whole freeBSD would be pretty large file (several gigabytes). Perhaps it might be less hassle to make a fresh install of finch on the new machine. Especially if the new machine will be running a newer version of FreeBSD anyway (like 9.2 --> 9.3).
After installing a pristene copy of finch. Then you could tar up just only the previous /usr/jails subfolder (in your old finch). Be sure to stop finch first of all. Then copy that /usr/jails archive across. mv the NEW /usr/jails to a safe location and don't delete it yet. Restore the old /usr/jails folder. Finally to run `qjail update -b` to update any outdated freebsd programs / libraries inside of your unpacked jails...
If you had made any other customiations in finch apart from your jails then you may need to copy other things across also.
-
Babovand
- Starter

- Posts: 46
- Joined: 23 Jun 2012 16:25
- Status: Offline
Re: Move jail(s) to another machine.
Thank you
Here is my situation.
I never knew jails existed, new to the *bsd systems. So I've managed to install openvpn,apache,mysql,pydio,rtorrent and alot of other software directly to my nas4free install. You can imagine how f**kup my system is.
I've currently installed nas4free and jails in virtualbox, my plan is to reinstall my host nas4free box, install finch, move my jails from the virtualbox to my newly installed nas4free host with a fresh install of finch.
Do i need to tarball the jails in the VM, is it possible to just move/copy all the files and folders to the host system?
And thank you for your hard work developing this. This is amazing.
Here is my situation.
I never knew jails existed, new to the *bsd systems. So I've managed to install openvpn,apache,mysql,pydio,rtorrent and alot of other software directly to my nas4free install. You can imagine how f**kup my system is.
I've currently installed nas4free and jails in virtualbox, my plan is to reinstall my host nas4free box, install finch, move my jails from the virtualbox to my newly installed nas4free host with a fresh install of finch.
Do i need to tarball the jails in the VM, is it possible to just move/copy all the files and folders to the host system?
And thank you for your hard work developing this. This is amazing.
-
dreamcat4
- experienced User

- Posts: 111
- Joined: 21 Mar 2014 21:59
- Status: Offline
Re: Move jail(s)/finch to another machine.
OK then it sounds like you have made jails in theBrig, or manually.Babovand wrote:Do i need to tarball the jails in the VM, is it possible to just move/copy all the files and folders to the host system?
You probably can't tarball all your stuff. And will need to deal with things on a case-by-case basis. Maybe for some of them of your conf files can be saved and just copied across after creating each new jails in finch (with qjail). If you follow the finch jails tutorial (on finch website). And use 'pkg install' inside each new jail to install whichever software it is from official freebsd ports. Then that is probably going to be the least hassle and most recommended.
If you can keep your existing VM around for the time being while you are doing that. That would be best. Then you can gradually transfer services across, working on them one at a time. On your old system, can stop an old service after it is up and running in it's new jail.
-
Babovand
- Starter

- Posts: 46
- Joined: 23 Jun 2012 16:25
- Status: Offline
Re: Move jail(s)/finch to another machine.
Babovand wrote:Do i need to tarball the jails in the VM, is it possible to just move/copy all the files and folders to the host system?
No, I just made some simple jails using qjail in finch chroot. every jail gets a new folder with "$jailname inside /usr/jails.dreamcat4 wrote:OK then it sounds like you have made jails in theBrig, or manually.
The only thing i really wanna do is kinda run-and-go, move/copy/tarball/export the jail(s) inside the /usr/jails to another machine and then just run it.
I've done exactly this, I've installed most of the software I need through pkg, but many of them I needed to compile myself, this took a long time, and I was hoping not having to recompile it again on the host machine, In the VM, everything its already compiled and running in the jail. This is the reason I want to just move the jail from the VM to host.dreamcat4 wrote:You probably can't tarball all your stuff. And will need to deal with things on a case-by-case basis. Maybe for some of them of your conf files can be saved and just copied across after creating each new jails in finch (with qjail). If you follow the finch jails tutorial (on finch website). And use 'pkg install' inside each new jail to install whichever software it is from official freebsd ports. Then that is probably going to be the least hassle and most recommended.
This is exactly what Im doing, and using a VM helps with configs, if you screw up the snapshots are there to reverse it fast.dreamcat4 wrote:If you can keep your existing VM around for the time being while you are doing that. That would be best. Then you can gradually transfer services across, working on them one at a time. On your old system, can stop an old service after it is up and running in it's new jail.
But i agree with you, simply moving the configuration files for each service and just reinstall everything is the fastest and better way to go, problem is that i don't want to compile everything again.
-
dreamcat4
- experienced User

- Posts: 111
- Joined: 21 Mar 2014 21:59
- Status: Offline
Re: Move jail(s)/finch to another machine.
Ah. Sorry for misunderstanding. I have a similar situation with one of my jails, where it was so long ago now that I can't really remember how I compiled it for FreeBSD.Babovand wrote:Babovand wrote:I've done exactly this, I've installed most of the software I need through pkg, but many of them I needed to compile myself, this took a long time, and I was hoping not having to recompile it again on the host machine, In the VM, everything its already compiled and running in the jail. This is the reason I want to just move the jail from the VM to host.
I think your use case is valid. Unfortunately the qjail jails software is not very well set up to handle this kind of situation. The configuration files is in /usr/local/etc and there are several folders including qjail.fstab, qjail.local etc.
If you can take out the qjail conf files for only the jails you need. And copy them across. Then you may stand a chance to tar up those jails subfolders too of /usr/jails/${jailname}*.
This is not something the FreeBSD jails management program(s) do very well. I recommend next time you have to custom-compile something. Then make a record of all the commands you ran in a .txt file or as a small shell script. That way if you don't quite remember later on (like me) it's possible to go back again and re-do the installation again.
-
Babovand
- Starter

- Posts: 46
- Joined: 23 Jun 2012 16:25
- Status: Offline
Re: Move jail(s)/finch to another machine.
Thank you. Got it. It seems there are from here what I can see multiple ways to go. I already have many new ideas. One of them is trying to make a package with pkg on my VM from my custom-compiled port, then I move and install the package on the host jail, no need for compile i hope, will try this soon.
Again Thanks, This is kinda solved.
Again Thanks, This is kinda solved.