is nfs mount inside jail possible?

Alexander Leidinger Alexander at Leidinger.net
Wed Jun 25 15:34:12 UTC 2008


Quoting Boris Samorodov <bsam at ipt.ru> (from Wed, 25 Jun 2008 17:53:49 +0400):

> # lsvfs
> Filesystem                        Refs Flags
> -------------------------------- ----- ---------------
> nfs4                                 0 network
> zfs                                  6 jail
> ntfs                                 0
> ufs                                  4
> nfs                                  0 network
> msdosfs                              0
> procfs                               4 synthetic
> cd9660                               0 read-only
> devfs                                5 synthetic
> nullfs                               7 loopback
> fdescfs                              4 synthetic
> -----
>
> ... nfs seems not to be jail friendly. Here is the question at
> subject. Thanks!

Correct. If you are not afraid to patch the system: zfs has the JAIL  
flag set, you just need to do the same with nfs.

To do this edit src/sys/nfsclient/nfs_vfsopts.c, search VFS_SET and  
change it to
VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK|VFCF_JAIL);

I suggest to not do this with tmpfs if you do shared hosting (you  
don't want that strangers eat up all your physical RAM).

Bye,
Alexander.

-- 
Peers's Law:
The solution to a problem changes the nature of the problem.

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the freebsd-jail mailing list