Configuring Volume and Folder Quotas
Microsoft Windows has included support for disk quotas on NTFS volumes since Windows 2000, but this support is limited in several ways:
- Disk quotas are per-volume. That is, you can enable quotas only at the volume level, not the folder level.
- Disk quotas are per-user. In other words, quotas are based on who owns files, not on which folder they are stored in as long as the folders are on the same volume.
- Disk quotas are calculated using the logical size of files, not the actual physical disk space they occupy.
- You can’t configure disk quotas on multiple volumes simultaneously.
- When disk quotas are exceeded, the only notification that can be generated is having an event logged to the Event logs.
Windows Server 2003 R2 overcomes these limitations with new storage management capabilities. These new capabilities are a welcome edition given the increasing amount of storage used by even small- and medium-sized businesses and given the proliferation of new storage technologies available and their increasingly lower costs.
The heart of the new quota management capabilities in R2 is a new tool called File System Resource Manager. FSRM is implemented as an MMC console and provides a centralized location for administering volume and folder quotas, creating file screens, and generating storage usage reports. The rest of this article examines the first of these capabilities—volume and folder quotas in R2. In future articles on WindowsNetworking.com I’ll walk you through setting up file screens and generating reports using FSRM.
Creating and Configuring Volume and Folder Quotas
The difference between volume and folder quotas in R2 and NTFS disk quotas (which are still around in R2) are as follows:
- Quotas can now be set at the folder level and not just the volume level.
- These quotas apply to all users who store their files in a quota-enabled volume or folder.
- Quotas are calculated using actual physical disk space occupied by files.
- You can easily configure quotas on multiple volumes and/or folders by creating quota templates.
- You can have quotas automatically created for all subfolders in a given folder, including subfolders not yet created.
- When a quota is exceeded, you have a variety of notifications you can trigger including logging to the Event log, sending an email, execute a command or script, and generate a storage report.
Before you can create a volume or folder quota however, you first need to install FSRM—on both the machine you are going to manage quotas from plus every file server on which you are going to create quotas. That means all your file servers have to be upgraded to R2 before you can use this new feature.
The simplest way of installing FSRM is to use Manage Your Server to add the File Server role to your machine. Adding this role adds a number of new storage features as shown in Figure 1:
Figure 1: Adding the file server role will install FSRM and other new storage features
If you’re upgrading an existing Windows 2000 or Windows Server 2003 file server to R2, then the file server role is already present on the machine so you’ll have to use Add or Remove Programs to install FSRM instead. To do this, select Add/Remove Windows Components, then Management and Monitoring Tools, then Details, and select File Server Resource Manager.
Once FSRM is installed, right-click on the root node and select Connect To Another Computer to select an R2 file server to manage. Then select the Quota Management node to perform all tasks related to volume and folder quotas on that server as in Figure 2:
Figure 2: Quota Management node in FSRM
First let’s configure a quota on a single shared folder named Sales. This share is used by users in the Sales Department for sharing documents with each other. There are two ways to put a quota on the Sales folder: apply a pre-defined quota or create a custom one. FSRM includes a number of pre-defined quotas, so let’s try that approach first.
Right-click on the Quota node and select Create Quota. Browse to select the Sales folder and select Monitor 500 MB Share under the drop-down list of quota templates available. A quota template is a collection of quota settings that you can apply in one shot to a folder or volume to configure a quota on that folder or volume. We selected the Monitor 500 MB Share template because we feel 500 MB will be sufficient storage space for the Sales share. Figure 3 shows the settings that will be applied to the Sales folder:
Figure 3: Applying a pre-defined quota template to C:\Sales
Note that from the summary of quota properties that the quota will be soft (generates notifications when exceeded) instead of hard (generates notifications and enforces limit) and that three notifications will be sent out:
- An email warning message when the share is 80% full.
- An email limit message and a logged event when the share is 100% full.
- An email warming message and a logged event when the share is 120% full.
Click Create and the quota is applied. Note that by selecting Define Custom Quota Properties here instead of Derive Properties From This Quota Template, you can create a custom quota of your own without basing it on any quota template.
Selecting the new quota in the Results pane (upper middle pane) displays more information in the Description area (lower middle pane) as shown in Figure 4:
Figure 4: Properties of quota on Sales folder
Note that the Results pane can be used to monitor all your quotas when the Quotas node is selected in the console tree at left. For instance, you can easily see in the Results pane what the quota is for Sales (50 MB), how much of that quota is being used (currently 0%), what kind of quota (soft), and so on. Double-clicking on the quota displays its properties, allowing you to further customize the quota settings for Sales as in Figure 5:
Figure 5: Customizing the properties of the quota on Sales
A quick word about email notifications: how does FSRM know who to email when a notification threshold for a quota has been reached? This is done by right-clicking on the root node in FSRM, selecting Configure Options, and entering an email address and SMTP server name on the E-Mail Notifications tab as in Figure 6 below. Once you’ve done this, click Send Test E-Mail to make sure it works.
Figure 6: Setting up email notifications
Using Quota Templates and Auto Quotas
Obviously, creating quotas one at a time like this can be a lot of work if you have a lot of volumes and folders you want to control storage on. That’s where quota templates come in—they let you define quota settings and apply them quickly to volumes and folders. We’ve already seen how to apply pre-defined templates, so let’s just look at how to create a custom template. You can again do this two ways: base your custom template on an existing template by tweaking it, or create a new template from scratch. Let’s try the second approach.
Right-click on the Quota Templates node in FSRM and select Create Quota Template. Note that if you want to base your new template on an existing one, you just select the existing template and click Copy to copy its settings to the new template. But we want to create a template from scratch, so fill in the template name, limit, choose hard or soft, and you’re reading to define additional notifications as in Figure 7. Note that the template we’re creating will be used to define 150 MB hard quotas for the home folders of users in the Accounting Department.
Figure 7: Quota template for Accounting users, minus the notifications
Let’s define a notification that sends an email to the user who exceeded the quota when the folder is 75% full. Click Add and configure the settings as shown in Figure 8:
Figure 8: Notify user when quota exceeded
Note that you can edit the subject and message body of the notification message. For example you could change the subject to “You’ve exceeded your quota!” which might get their attention better. You can also use replaceable variables to add quota settings information to the subject or message body by clicking Insert Variable. Once you’re finished you can add more notifications if you like. Don’t forget to configure the default notification (Limit 100%) so it does something as well, like email the quota administrator and log an event to the Event log.
Figure 9 shows the new quota template in the Results pane of FSRM:
Figure 9: Quota template named 150 MB Limit for Users in Accounting Department is selected
Let’s say all users in the Accounting Department have their home folders (redirected My Documents folders) located as subfolders within a share named Accounting on the file server (see Figure 10):
Figure 10: Bob, Mary and Henry are users in the Accounting Department
We want to apply our new quota template to all existing and future users in the accounting department. To do that involves creating an auto quota, which is done like this: right-click on Quotas, select Create Quota, and browse to the parent folder (C:\Accounting) within which the users’ home folders are contained. Select the quota template we created earlier for users in the Accounting Department. Then select the Auto Apply Template And Create Quotas on Existing And New Subfolders option as shown in Figure 11:
Figure 11: Automatically applying a quota template to all subfolders of Accounting
Click Create to generate the quotas. Then select the Quota node to view them as in Figure 12
Figure 12: Hard quotas have been generated for all subfolders of Accounting
One more thing, and it’s nice—what if we decide later that the email notification should be sent to users at 80% instead of 75% full? Do we have to modify each quota individually? Nope—all we have to do is modify the template from which the quotas were derived. Select the Quota Templates node, double-click on the template, edit the notification, click OK and the following dialog box appears (Figure 13):
Figure 13: Dialog box after modifying a quota template
The first option will regenerate quotas that were previously derived from this quota template, but only if you haven’t manually customized those quotas in the meantime. The second option regenerates quotas that were previously derived from the template regardless of whether they have been individually customized or not. And the third option updates the template but not any of the quotas that were previously derived from it. Probably the first option is the one you want to choose in most cases.
Volume and folder quotas are a new feature of R2 that make managing storage resources on file servers a lot easier. In future articles I’ll walk you through two other uses of FSRM: creating file screens and generating storage reports. Till then, check out my blog ITreader.net for more helpful tips on deploying, managing, securing and troubleshooting Windows server-based networks.