Date: Wed, 11 Jan 2006 18:48:02 +0100 From: Michal Mertl <michal.mertl@i.cz> To: "Marc G. Fournier" <scrappy@hub.org> Cc: freebsd-questions@freebsd.org, Vladimir Dvorak <dvorakv@vdsoft.org> Subject: Re: quotas + jail ? Message-ID: <1137001682.832.45.camel@genius1.i.cz> In-Reply-To: <20060111123530.C1006@ganymede.hub.org> References: <43C4D004.90101@vdsoft.org> <1136990772.832.32.camel@genius1.i.cz> <20060111123530.C1006@ganymede.hub.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Marc G. Fournier wrote: > On Wed, 11 Jan 2006, Michal Mertl wrote: > > > Vladimir Dvorak wrote: > >> Hello, > >> > >> I have simple question - is possible to use quotas in jail(8) environment ? > > > > Yes, it is, although with some restrictions. > > > > You have to enable the disk quotas from the host (have them listed in > > host's /etc/fstab). > > > > To operate the quotas from inside the jail quotas have to be mentioned > > in jail's /etc/fstab too (when using the file name of quota file it has > > to be relative to jail's root). Repquota/edquota/quota work inside the > > jail. > > > > You have to keep in mind that disk quotas are in fact a property of a > > filesystem and are not related to jails at all. So if two jails share a > > filesystem the disk quotas are shared too. If you have users with the > > same UID in both the jails they will share the quota. > > How hard would it be to extend quotas so that its not just uid/gid based, > but directory? ie. everything under /vm/jail1 falls under this quota, > regardless of uid/gid? I don't think I understand your goal. Do you want some grand limit for whole jail's disk usage or have separated quotas for jails on the same partition? Neither can be done at the moment with disk quotas. The needed changes to support either will be quite extensive I believe. I recommend using separate partition for each jail. This will allow you to achieve both goals at the same time. If you have lot of jails and the number of partitions is the problem you can use gpt(8) or vnode based md(4) (see mdconfig(8)). With md(4) you can also use sparse backing files and that way have more space than you have on physical drives. Beware of overcommit though - I wouldn't be surprised if the system crashed when the disk is full and the md(4) file system is supposed to have free space in it. Michal
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1137001682.832.45.camel>