Re: Exposing a hierarchy of ZFS datasets inside multiple jails

2011-06-18 Thread Christian Degen

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
___
freebsd-jail@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to "freebsd-jail-unsubscr...@freebsd.org"


Re: Exposing a hierarchy of ZFS datasets inside multiple jails

2011-06-18 Thread Alexander Leidinger
On Fri, 17 Jun 2011 14:46:59 -0400 Lars Kellogg-Stedman
 wrote:

> Hello all,
> 
> Hi there,
> 
> I am trying to expose a hierarchy of home directories to a number of
> FreeBSD jails. The home directories are configured such that each is a
> unique ZFS dataset. The jails are used for development work and hence
> are created and destroyed on a regular basis.
> 
> My first thought was simply to use nullfs to mount /home inside the
> jail, but nullfs doesn't provide any way to access subordinate
> filesystems.
> 
> My second thought was to export the directories via NFS and then run
> the automounter daemon (amd) inside each jail. This would have Just
> Worked...if it were possible to perform NFS mounts inside a jail. But
> it's not.

See the second part of the patch at
http://www.leidinger.net/FreeBSD/current-patches/sys:nfsclient.diff
for how to allow NFS mounts in a jail.

Bye,
Alexander.

-- 
http://www.Leidinger.netAlexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org   netchild @ FreeBSD.org  : PGP ID = 72077137
___
freebsd-jail@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to "freebsd-jail-unsubscr...@freebsd.org"