Exposing a hierarchy of ZFS datasets inside multiple jails

Christian Degen bubulein at freenas.org
Sat Jun 18 10:16:48 UTC 2011


Moin,

I assume the easiest solution would be to make the many mountpoints 
(datasets) invisiable for NFS. Here we go.

teufelchen# /etc/rc.d/jail stop alcatraz

## This will be the dataset which contains home's for example
teufelchen# zfs create tank/nullfs


## Now I create a dir which will be shared to the jails
## My idea is to make the mountpoints invisiable for NFS

teufelchen# mkdir /mnt/tank/nfs_home

teufelchen# mount_nullfs /mnt/tank/nullfs/ /mnt/tank/nfs_home/

teufelchen# mkdir /mnt/tank/alcatraz/mnt/nfs_home

teufelchen# cat /mnt/tank/freebsd/fstab.alcatraz
192.168.1.10:/mnt/tank/nfs_home /mnt/tank/alcatraz/mnt/nfs_home nfs rw 0 0

teufelchen# /etc/rc.d/jail start alcatraz

### IIRC
### You like to create datasets on the host, which apear in the jails 
just in
### time?

teufelchen# zfs create tank/nullfs/dataset1
teufelchen# touch /mnt/tank/nfs_home/dataset1/newfile
teufelchen# jexec 14 ls /mnt/nfs_home/dataset1/
newfile

Is this what you are trying todo?


Christian Degen


More information about the freebsd-jail mailing list