From owner-freebsd-questions@FreeBSD.ORG Wed Jan 11 17:48:06 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C2A616A41F for ; Wed, 11 Jan 2006 17:48:06 +0000 (GMT) (envelope-from michal.mertl@i.cz) Received: from vidle.i.cz (vidle.i.cz [193.179.36.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id B612B43D45 for ; Wed, 11 Jan 2006 17:48:05 +0000 (GMT) (envelope-from michal.mertl@i.cz) Received: from ns.i.cz (brana.i.cz [193.179.36.134]) by vidle.i.cz (Postfix) with ESMTP id 161F12E006; Wed, 11 Jan 2006 18:48:04 +0100 (CET) Received: from localhost (localhost.i.cz [127.0.0.1]) by ns.i.cz (Postfix) with SMTP id EDEED122A04; Wed, 11 Jan 2006 18:48:03 +0100 (CET) X-AV-Checked: Wed Jan 11 18:48:03 2006 ns.i.cz Received: from genius.i.cz (genius.i.cz [192.168.129.68]) by ns.i.cz (Postfix) with ESMTP id E7A73122A03; Wed, 11 Jan 2006 18:48:03 +0100 (CET) From: Michal Mertl To: "Marc G. Fournier" 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> Content-Type: text/plain Date: Wed, 11 Jan 2006 18:48:02 +0100 Message-Id: <1137001682.832.45.camel@genius1.i.cz> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org, Vladimir Dvorak Subject: Re: quotas + jail ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2006 17:48:06 -0000 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