Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Feb 2006 23:59:24 -0600 (CST)
From:      Philip Hallstrom <freebsd@philip.pjkh.com>
To:        Tim Traver <tt-list@simplenet.com>
Cc:        questions@freebsd.org
Subject:   Re: How to share directories b/n jails on 6.0?
Message-ID:  <20060203235456.L3508@bravo.pjkh.com>
In-Reply-To: <43E43455.50004@simplenet.com>
References:  <20060203190008.S61891@bravo.pjkh.com> <20060204011033.GA14566@xor.obsecurity.org> <20060203205216.S62884@bravo.pjkh.com> <20060204032507.GA17397@xor.obsecurity.org> <20060203215206.J1887@bravo.pjkh.com> <43E43455.50004@simplenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>>> I've got a new 6.0 box and have setup some jails.  I'd like to share
>>>>>> /usr/ports from the host, to each of the jails.
>>>>>> 
>>>>>> I tried mount_unionfs and while it worked, the box would crash if I did
>>>>>> anything intensive (ie. compile a port).
>>>>>> 
>>>>>> Googling around and people say they are using nullfs okay, but the 
>>>>>> manpage
>>>>>> ends with:
>>>>>>
>>>>>>     THIS FILE SYSTEM TYPE IS NOT YET FULLY SUPPORTED (READ: IT DOESN'T
>>>>>>     WORK)
>>>>>>     AND USING IT MAY, IN FACT, DESTROY DATA ON YOUR SYSTEM.  USE AT 
>>>>>> YOUR
>>>>>>     OWN
>>>>>>     RISK.  BEWARE OF DOG.  SLIPPERY WHEN WET.
>>>>> 
>>>>> 
>>>>> nullfs is fine in 6.0, and the warning has been removed.
>>>> 
>>>> 
>>>> Good to know it's cool.  I'll start playing with it.  The warning is 
>>>> still
>>>> there though... in both 6-stable and 7-current.
>>>> 
>>>> http://www.freebsd.org/cgi/man.cgi?query=mount_nullfs&apropos=0&sektion=0&manpath=FreeBSD+6.0-stable&format=html 
>>>> http://www.freebsd.org/cgi/man.cgi?query=mount_nullfs&apropos=0&sektion=0&manpath=FreeBSD+7.0-current&format=html 
>>> 
>>> 
>>> Those manpages are out of date.
>>> 
>>> http://www.freebsd.org/cgi/cvsweb.cgi/src/sbin/mount_nullfs/mount_nullfs.8 
>> 
>> 
>> Sweet!
>>
>>     MFC: Remove big scary warning about nullfs state
>> 
>> :-)
>> 
>> I've set it up already and it works great.

On Fri, 3 Feb 2006, Tim Traver wrote:

> How did you set it up specifically ?
>
> and is it just fixed in 6.0 ? or does it also work in 5.4 ?

No idea about 5.4...

For 6...

/etc/rc.conf:

 	jail_sandbox_rootdir="/local/jails/sandbox/"
 	jail_sandbox_hostname="sandbox.pjkh.com"
 	jail_sandbox_ip="123.123.123.123"
 	jail_sandbox_exec="/bin/sh /etc/rc"
 	jail_sandbox_devfs_enable="YES"
 	jail_sandbox_mount_enable="YES"

/etc/fstab.sandbox:

 	/usr/ports /local/jails/sandbox/usr/ports nullfs rw 0 0


Then once started with /etc/rc.d/jail start sandbox I have this:

% df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
....
devfs          1.0K    1.0K      0B   100%    /local/jails/sandbox/dev
/usr/ports     3.9G    1.9G    1.7G    52% 	  /local/jails/sandbox/usr/ports

I also came across this afterward... which I might give a go...

http://www.freebsd.org/cgi/url.cgi?ports/sysutils/ezjail/pkg-descr

Looks like it null mounts a lot more (ie /bin /sbin, /usr/lib, etc.)

-philip



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060203235456.L3508>