How to convert a physical host into a Jail?

Kozlov Sergey kozlov.sergey.404 at
Wed Sep 2 19:48:56 UTC 2015

Hello Raimund,

First, if you're using ZFS for the whole system you can "zfs send"/"zfs
receive" the root dataset to one of the folders, where your jail will
reside. I don't know if that jail will be usable right away or not,
maybe there will be some tweaking required. One thing I'm sure about is
that in jail you won't need any boot-related stuff including the kernel
as jails share it with the host, so you can delete it to save some space
and not to confuse any update tools in the future.

Second, if your jail needs to manage the zfs datasets you can dedicate a
branch of your zfs dataset tree to a jail by using the "zfs jail"
command. Note though that you have to issue "zfs jail" each time you
start the jail (i never used iocage but I bet it has functionality to
run some script after start of the jail) and after you dedicate the zfs
branch to the jail it won't be accessible from the host before you issue
the "zfs unjail" command.

Sergey Kozlov

On 02.09.2015 17:09, Raimund Sacherer wrote:
> Hello, 
> the first server I set up in our production environment was a backup server. Its FreeBSD 10.0 and I installed our backup server directly without creating jails first. 
> Now that I am much more familiar with FreeBSD and jails (iocage) I would like to:
> clone (move, sync, ...?) the physical host into a iocage jail
> after the clone works stop and remove the services from the host
> Then upgrade to 10.2.
> I am not sure on how to correctly move the physical host installation to the jail, also not sure about the correct way for the jail to get to various zfs datasets which our backup server needs. Allow them to mount in the Jail? Move them from where they are to beneath the jail? What are the differences? 
> Thank you
> Best
> Ray

More information about the freebsd-questions mailing list