Link to home
Start Free TrialLog in
Avatar of RKGraves
RKGravesFlag for United States of America

asked on

How to I limit the maximum size of a folder?

I have \\server\temp Share stored on an NTFS volume on a Server 2008 member server in a domain.  I would like to limit the size of the temp folder to 2 GB, irregardless of what user(s) place files into this shared folder. I just want to contents of this dir/share not to exceed 2 GB.

I am familiar with Disk Quota's and FSRM, but don't see this as a solution as (best I can tell) Disk Quota's limit the amount of data a User can store, but do not limit the maximum size of a directory.

Thank you for your help.
ASKER CERTIFIED SOLUTION
Avatar of cuziyq
cuziyq

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sk_raja_raja
sk_raja_raja

If you have Server 2003 R2 then you will be able to limit the size of folders.  Here is a brief article on what R2 is all about - http://www.adminprep.com/articles/default.asp?action=show&articleid=74
I am not sure if this works with 2008
Avatar of RKGraves

ASKER

Thank you everyone for your quick replies! I was looking for a Microsoft solution, not a 3rd-Party solution. In the past we had been creating a seperate volume of 2GB and mounting it as a Mount Point and sharing it.

I had read some articles which seemed to indicate FRSM could limit folder size. But based on your replies the confusion seems to rest with; FRSM can do Quota's at the Folder level (as opposed to pre-FRSM Quota's were by Volume), but only on a per-User basis.
Avatar of McKnife
Maybe the reason why MS has not implemented this is because this demand is very rare. Maybe you should try a combination of the following: use per-user-quota and set it to a certain amount for each user. In addition, use a scheduled tasks that sweeps away files of a certain age, for example files older than a week. This could be done by a powershell (server feature) script or with the help of the command line tool forfiles.exe which is included in server 2008.
If you have any unpartitioned space left in one of your drives you can easily create a folder that has a maximum size restriction. This involves creating a new volume of the required maximum size and using SysInternals Junction (http://download.sysinternals.com/Files/Junction.zip or http://www.devhood.com/tools/tool_details.aspx?tool_id=852 and click the Junction.Zip link) to redirect the folder to the newly created volume. You should read these recommendations before you decide if you want to use this solution:http://support.microsoft.com/?kbid=205524.
After downloading the Junction.Zip file extract it anywhere you like and perform the following:
(This How-To assumes the folder that needs its size limited is C:\Example and that the drive letter Z: is available for use. You can change these values according to your setup)
Step 1: Create a new Partition of the desired size - If you want to limit the folder to 100MB create a 100MB partition. Assign the new Partition the drive letter Z: when prompted.
Step2: Go to Command Prompt and change to the folder where you extracted Junction. Execute the command: Junction.Exe C:\Example Z:\
Et voila! C:\Example is now limited to 100MB, no matter which user creates the files in it.
placebo69a and Others,

I appreciate everyone's feedback. We have been doing something like "placebo69a" described, except we are using Windows Mount Points. Server 2008 also has a tool MKLINK (make link) which lets you mount other shares into your existing directory structure. Very similar to how Linux/Unix mount & umount.

Using Mount Points is an OK solution, but requires a new volume each time you want to limit the size of a directory.

The focus of my question was to see if anyone knew how to use Microsofts File System Resource Manager (FSRM), or Folder Quota's to limit the size of a directory. In reading about FSRM it seemed like this might be an option. But from the feedback I am receiving I am concluding FSRM/Folder Quota's cannot do this.

Again, Thanks Everyone,
R.K.Graves