Google Answers Logo
View Question
 
Q: directory-based quotas ( Answered 1 out of 5 stars,   5 Comments )
Question  
Subject: directory-based quotas
Category: Computers > Operating Systems
Asked by: luke_skywalker-ga
List Price: $50.00
Posted: 19 Jun 2002 10:43 PDT
Expires: 26 Jun 2002 10:43 PDT
Question ID: 29256
Is there anyway (or you know some 3rd party software) to handle
"directory-based quotas" on SOlaris 8 platform? I like multiple
projects to share one
large filesystem using subdirectories and control usage. It is
possible for a
 developer to work in more than one project(ie, save file under
different directories) and that is why a "directory-based" quota is
ideal.
Answer  
Subject: Re: directory-based quotas
Answered By: lrargerich-ga on 19 Jun 2002 11:37 PDT
Rated:1 out of 5 stars
 
Hi Luke Skywalker,

I contacted a Solaris 8 expert in order to answer your question.

First of all there's not a Solaris 8 way nor a third-party application
to implement directory based quotas on Solaris 8.

In Solaris 8 you set up quotas for each user and file-system.

This is a quick intro to the Solaris 8 quota administration system:

To set up a quota for a specific user you should use the command 
edquota with the format:

edquota username

this will allow you to add for an specific file system the maximum use
allowed for that username. The lines in this file have the format:

fs mount_point blocks  time  limit  =  number  tmunit, files time
limit
= number tmunit

for example:

fs /home blocks (soft = 0, hard = 0) inodes (soft = 0, hard = 0)

You may set a quota in blocks or in inodes. If it is 0 means it has no
quota assignation. 

After that, to turn on the quota configuration you may do a:

quotaon -va

To see the quota definition you may use the command:

quota -v username

To turn it back off you should do a 

quotaoff -va.

In order to be able to do this, you should add the option "quota" in
the
/etc/vfstab as a mount option for that file system. That enables the
quota
system for that particular file-system.

So if you want to implement directory-based quotas you have to make
each directory that you want to control a file-system. Then you can
edit the user quota for each particular file-system settig up the
quota for the desired directory.



Best Regards,
lrargerich-ga
luke_skywalker-ga rated this answer:1 out of 5 stars
Lrargerich,

You miss the point that I need only 1 large file system to hold
mutiple subdirectories.

You suggestion of 1 directory for 1 file system will not work.

Comments  
Subject: Re: directory-based quotas
From: harikb-ga on 19 Jun 2002 12:41 PDT
 
Lacking a direct support from the OS, even third-party
packages may not be able to do much. Since the filesystem
writes cannot be controlled, they would have to rely on
some kind of 'auditing' at the end of the day/hour to find
directories that exceed their quota. If you really don't
need hard-limits, it is quite easy to write perl scripts
or use utilities like 'du' to get details on the directories
exceeding the limit.

Coming back to the solution mentioned by lrargerich-ga, there
are firms that make NFS servers with some advanced features
like these. For example the NFS servers from NetworkAppliance
has the concept of qtrees partitions that may provide the 
same feature. I would assume they essentially use the
same technique (internally) described by lrargerich-ga.
However, these are standalone servers (or rather black-boxes).

Hope this helps
Subject: Re: directory-based quotas
From: luke_skywalker-ga on 20 Jun 2002 09:33 PDT
 
Harikb,

	Thank you for the auditing suggestion. But we do need hard limit....
Subject: Re: directory-based quotas
From: simac-ga on 22 Jun 2002 19:21 PDT
 
You could partition the drive if the number of directories with
different quotas you needed was low enough and end up with multiple
file systems, but this is probably an obvious solution.
Subject: Re: directory-based quotas
From: gilimanjaro-ga on 24 Jun 2002 10:20 PDT
 
Any hard quotas will have to be enforced by the kernel. So if the
Solaris kernel doesn't support directory quotas, there is no way to do
this.

The only quota support Solaris knows is filesystem based, so if you
want it on a directory level, you'll really have to assign one
filesystem per directory.

This can probably be done without repartitioning, by putting the
filesystems in huge files, which you then mount using a loopback
device. I know this works on Linux at least. The filesystem size will
determine the allowed disk usage.

This method will cost you some performance... Two levels of filesystem
access will occur.
Subject: Re: directory-based quotas
From: isotopp-ga on 06 Oct 2002 08:28 PDT
 
As you already know, there is no direct solution for your problem. The
following is a workaround for a single filesystem with multiple
directories, each of which has a hard quota, based on group quotas. It
has been tested on Solaris 8, but should work on any BSD UNIX or
System V Release 4 and better.

Create the directories you want to put a quota on, and create a
specific group for each of these directories. chgrp each directory to
its specific group. Then chmod g+s that directory. A SGID bit on a
directory switches the directory to BSD file creation semantics. New
files in that directory will be created with the group of the
directory, and new directories below that directory will be created
with their parents group and they will be SGID, too.

Now create a group quota for each of these groups.

If you need to enforce read and write permissions on the directory
beyond simple file ownership permissions, use Solaris 8 access control
lists for that using the setfacl command. This allows you file access
permissions beyond quota and group ownership.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy