Mounting NFS From Within a Jail

Tim Gustafson tjg at soe.ucsc.edu
Tue Jun 1 16:57:36 UTC 2010


> You cannot mount NFS shares inside a jail because of
> rpcbind. The best solution I've found is to mount the
> NFS share on the jail host, and create a nullfs mount
> of that mountpoint to the jail.

Ok, that makes sense (I guess), but what's the deal with these options in rc.conf then:

jail_fstab="/etc/fstab.jails"
jail_mount_enable="yes"

I've got those both set exactly as shown, but I can't find much documentation about them and they seem to be ineffective (except that when I put an invalid file name for jail_fstab, it complains about the file being invalid).  /etc/fstab.jails contains:

# Device		Mountpoint	FStype	Options		Dump	Pass#
nfshost:/usr/ports 	/usr/ports	nfs	rw,bg		0	0
nfshost:/usr/src 	/usr/src	nfs	rw,bg		0	0
nfshost:/usr/obj	/usr/obj	nfs	rw,bg		0	0

I was thinking that the rc.conf options listed above would somehow mount the file systems from the host OS and then start the jail, but that appears to not be the case.  Am I misunderstanding the intent of these rc.conf options?

Tim Gustafson
Baskin School of Engineering
UC Santa Cruz
tjg at soe.ucsc.edu
831-459-5354


More information about the freebsd-jail mailing list