limiting jail size

Eirik Øverby ltning at anduin.net
Sat Apr 23 06:49:22 UTC 2011


On 23. apr. 2011, at 04:17, "J. Hellenthal" <jhell at DataIX.net> wrote:

> On Fri, Apr 22, 2011 at 07:39:46AM +0200, Eirik Øverby wrote:
>> Hi,
>> 
>> No problem. Use ZFS :)
>> And dozens or even hundreds of jails are possible; limited only by RAM and kern.maxfiles ..
>> 
>> /Eirik
>> 
>> On 22. apr. 2011, at 06:31, Mickey Harvey <mh.unet at gmail.com> wrote:
>> 
>>> I was wondering if there is an easy way to limit the amount of hard drive
>>> space a jail can take up. Say I have 20 jails on a system would this even be
>>> possible?
> 
> ZFS is not the only way to limit the jails there certainly is an
> abundance of other things you can work at doing to if your limited.
> 
> For example:
> # mkdir /exports/jail1
> # truncate -s 2g /exports/jail1.vnode
> # mdconfig -f /exports/jail1.vnode
> # newfs -O2 /dev/md0
> # mount /dev/md0 /exports/jail1
> # <install your environment to /exports/jail1>
> # <add whatever else is needed to rc.local or rc.conf>
> 
> And you now have a 2G portable jail without all the copy this here that
> there mess if you have to back it up just copy the file over to another
> jail to adjust for a second running jail and so on.

I used to do this, and still do for some static/embedded stuff. I changed to ZFS though for most jails - that gets you a whole lot of other benefits like quotas, compression, better snapshots, etc. 

/Eirik

> This is slightly incomplete to a full setup but should be enough to
> paint the beginning of the picture for you.
> 
> 
> Happy Trees!
> 
> -- 
> 
> Regards,
> J. Hellenthal
> WWJD
> 


More information about the freebsd-jail mailing list