Date: Mon, 30 Sep 2002 10:52:30 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: Giorgos Keramidas <keramida@FreeBSD.ORG> Cc: "Marc G. Fournier" <scrappy@hub.org>, freebsd-questions@FreeBSD.ORG Subject: Re: Per directory disk quotas ... Message-ID: <20020930095230.GB51277@happy-idiot-talk.infracaninophi> In-Reply-To: <002101c26838$78ec3b00$5bd7cdd4@LocalHost> References: <20020929231438.W69855-100000@hub.org> <002101c26838$78ec3b00$5bd7cdd4@LocalHost>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 30, 2002 at 07:18:29AM +0300, Giorgos Keramidas wrote: > ----- Original Message ----- > From: "Marc G. Fournier" <scrappy@hub.org> > To: <freebsd-questions@freebsd.org> > Sent: Monday, September 30, 2002 5:25 AM > Subject: Per directory disk quotas ... > > > : does anyone know of some way of setting a disk quota > : onto a directory? so that a directory, and all > : sub-directories/files below it cannot consume more > : then x amount of space? > > Setting permissions that alloww only a certain group of users > to write things in that directory, and then using edquota to > limit the quota of that group under the directory. Let's say, > for example, that you want to limit /mnt/foobar to 100 kbytes. > Let's also assume that /mnt/foobar is under an /mnt mountpoint. > > Create a new group called "foobar". The name of the group > doesn't need be the same. It might helps remembering what > this group was created for later on though. > > # groupadd foobar > > Make root:foobar the owner of /mnt/foobar. > > # chown -R root:foobar /mnt/foobar > > Add write permission to /mnt/foobar for the group: > > # chmod 0775 /mnt/foobar > > Edit the "group quota" of foobar: > > # edquota -g foobar -f /mnt > > Done. Don't let "*:foobar" have write access anywhere else > under /mnt and you're set to go. The users that belong to > the "foobar" group will be limited under /mnt/foobar. Quotas would work, but requires some administrative oversight by the admin over the users to make sure that files with the group ownership don't get created outside the specific tree or that files belonging to other groups don't appear inside the tree. An alternative approach would be to use vnconfig(8) to create pseudo disks of the right size, which you can then put a filesystem onto and mount in the correct place. I've seen reports that this technique works very well to limit the amount of space a jail(8) can use even if the jail's owner has full control over the password file in it. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020930095230.GB51277>