Solved Host Jail shared Zfs Dataset

Hi, I can't understand a question. I created a FreeBsd host that runs Jails. They work perfectly. But my data is on a zfs dataset. I should get more Jails to access it, but I can't figure out how. I have a Jail with Rsync which must synchronize the Data and one with Samba which must share it with me.
 
I am not sure if this will answer your question or fits your use case. You can mount directories when you start the jail. One option is to do so using /etc/fstab.$jail to specify the mount and to make use of that in /etc/jail.conf. One example below is a jail running firefox. The first line mounts the package repository of the host to that of the jail. Then downloaded packages can be used on the host but also in the jail. The second line maps a "download" directory to share files of the users of the jail and the host.
Code:
 ~> cat /etc/fstab.fox
/var/cache/pkg /jails/fox/var/cache/pkg nullfs rw,late 0 0
/usr/home/chris/Downloads /jails/fox/usr/home/chris/Downloads nullfs rw,late 0 0
The line below is in the head of the configuration file and is therefore applied for each jail.
Code:
~> grep fstab /etc/jail.conf
mount.fstab = "/etc/fstab.$name";
May be this is an approach for your setup, too.
 
You can do it with a nullfs. In your /etc/fstab.your_jail_name add this:

Code:
/home /usr/jail/your_jail_name/home nullfs rw,noatime,nosuid,nocache 0 0
 
If it is mounted on the host, you can reach it from the jail with its fstab file and nullfs. You have above several posts which explain that.
 
Back
Top