Changes

Managing Windows Server 2008 R2 Disk Quotas

9,390 bytes added, 20:02, 15 January 2010
New page: Even in today's world of cheap and abundant disk storage space, it is still important to monitor and control the disk space usage of users. This is especially important in enterprise envir...
Even in today's world of cheap and abundant disk storage space, it is still important to monitor and control the disk space usage of users. This is especially important in enterprise environments where the sheer number of users can quickly consume even the largest quantities of disk space. As such this chapter of Windows Server 2008 R2 Essentials will cover the topic of configuring and managing disk quotas on Windows Server 2008 R2.

== An Overview of Disk Quotas ==

First, it is important to appreciate that disk quotas are actually a feature of the NTFS disk file system rather than a specific feature of Windows Server 2008 R2, although Windows does provide the tools necessary to configure and manage disk quotas.

In essence, disk quotas allow Windows administrators to monitor and control the use of disk space by users. Disk quotas can be deployed in a number of different ways depending on the requirements of the administrator:

* '''Disk Usage Monitoring''' - Allows the administrator to monitor the usage of disk space on a user by user basis. No action is taken by the operating system to warn users that they are approaching a limit or prevent further disk writing when the limit is exceeded.
* '''Disk Usage Monitoring and Warning''' - Also allows the administrator to monitor disk usage but also warns offending users when their disk usage on a particular volume exceeds a specified limit.
* '''Disk Usage Enforcement''' - Allows monitoring of disk usage, issues warnings top users when thresholds are reached and denies disk space when the user exceeds limit.

Disk quotas are configured on a per-volume basis. It is not, therefore, possible to specify a quota that encompasses multiple volumes. Once a volume has disk quotas specified, those quotas apply to all users of the volume unless exceptions are configured for individual users. For example, a user in the video editing department would probably need more disk space than someone in the accounts department. Members of the Administrators group can never be denied access to disk space. The most an administrator will ever receive is a warning.

== Configuring Disk Quotas ==

Since disk quotas are a feature built into NTFS, any volume on which quotas are to be configured must be formatted as NTFS. Assuming this to be case, disk quotas may be enabled on a volume from within the Disk Management interface via the Computer Management or Server Manager tools. Computer Management is accessed by selecting ''Start -> All Programs -> Administrative Tools -> Computer Management''. Once Computer Management is running, select the ''Storage'' option from the tree in the left hand pane followed by ''Disk Management''. In the disk management interface, right click on the volume in the graphical view to which disk quotas are to be applied. From the resulting menu, select ''Properties''. In the Properties dialog click on the ''Quota'' tab to display the quota settings for the current volume:


<google>ADSDAQBOX_FLOW</google>
[[Image:windows_server_2008_disk_quota_properties.jpg|Configuring the disk quota properties of an NTFS volume]]


As illustrated in the above figure, disk quotas are disabled by default. The first step, therefore, is to set the Enable quota management check box. Once selected, the other settings will activate so that they can be changed. The first setting controls whether users will be denied disk space when the specified limit is reached. If not selected, the user will simply receive a warning. The Limit disk space to setting allows the amount of allowed space for users to be set using either KB, MB, GB, TB, PB or EB. Set the desired limit for this setting and then decide on a limit level at which the user will receive a warning. This value enables you to have a warning issued to the user as they approach the limit giving them time to free up space before they are denied space. Typically the warning level should be set to trigger when the user reaches 85 - 95% of the of the quota limit. The final settings allow the administrator to control whether events are recorded in the logs when users receive warnings or exceed specified limits.

On completion of the quota settings, click on Apply to apply the settings. Windows will subsequently display a dialog warning that the disk quota system needs to be enabled before the settings can take effect. Respond affirmatively to enable changes and implement the settings.

== Configuring Disk Quotas for Individual Users ==

As previously mentioned, disk quotas on a volume apply, by default, to all users storing data on that volume (with the exception of members of the Administrators group). It is, however, possible to customize quota limits for individual users. To achieve this, return once again to Disk Management in the Computer Management tool, right click on the volume in question and select ''Properties''. In the Properties dialog select the ''Quota'' tab and then click on the ''Quota Entries'' button to display the quota entries dialog for the selected volume:


[[Image:windows_server_2008_quota_entries.jpg|Viewing Windows Server 2008 R2 Disk Quota Entries]]


The Quota Entries dialog lists quota entries for all the users who have stored data on the NTFS volume in question. As shown above, user Bill has already received warnings that disk usage is approaching his quota limit (hardly surprising given the extremely low quota limit specified for the volume). To increase quota limits for a single user, right click on the user in entries list and select ''Properties'' from the menu to invoke the ''Quota settings'' dialog as illustrated in the following figure:


[[Image:windows_server_2008_user_quota_settings.jpg|Viewing Windows Server 2008 R2 User Quota Settings]]


With the quota settings dialog displayed increase the quota for the selected user to the appropriate amount for the user's needs and click on Apply to implement the change. Alternatively, remove quota limits entirely for the specified user by selecting the Do not limit disk usage option.

From the list of users it is clearly only possible to configure quotas for users who have already written something to the disk. In order to customize quota settings for a user who has yet to store anything on the selected volume begin by selecting ''Quota -> New Quota Entry...'' to display the user selection dialog:


[[Image:windows_server_2008_user_selection.jpg|Selecting a user prior to changing quota limits]]


Enter the name of the user into the object name field and click on ''Check Names'' to obtain a list of matching names. Select the correct name if more than one are listed and click on OK to proceed to the ''Add New Quota Entry'' dialog:


[[Image:windows_server_2008_new_quota_entry_dialog.jpg|Defining a new Quota Entry on Windows Server 2008 R2]]


Configure the settings as required and click on OK to implement the settings.

== Querying Quotas from the Command Prompt ==

In addition to using the Disk Management tool, disk quota status can be also be checked from the command prompt using the ''fsutil quota query'' command which takes as an argument the designator of the drive on which the quotas are to be queried. For example, the following command displays output of the current quota settings both for the specified disk and individual users:

<pre>
C:\Windows\system32>fsutil quota query e:
FileSystemControlFlags = 0x00000002
Quotas are tracked and enforced on this volume
Logging for quota events is not enabled
The quota values are up to date

Default Quota Threshold = 0x0000000000000400
Default Quota Limit = 0x000000000000c800

SID Name = BUILTIN\Administrators (Alias)
Change time = Friday, August 08, 2008 14:21:13 PM
Quota Used = 72704
Quota Threshold = 18446744073709551615
Quota Limit = 18446744073709551615

SID Name = NT AUTHORITY\SYSTEM (WellKnownGroup)
Change time = Friday, August 08, 2008 14:35:02 PM
Quota Used = 20976640
Quota Threshold = 18446744073709551615
Quota Limit = 18446744073709551615

SID Name = WINSERVER-2\Bill (User)
Change time = Friday, August 08, 2008 20:02:47 PM
Quota Used = 3072
Quota Threshold = 1024
Quota Limit = 102400

SID Name = WINSERVER-2\nas (User)
Change time = Friday, August 08, 2008 20:09:58 PM
Quota Used = 0
Quota Threshold = 42949672960
Quota Limit = 53687091200
</pre>

In order to obtain a list of quota violations on a particular disk simply run ''fsutil quota violations'':

<pre>
C:\Windows\system32>fsutil quota violations
Searching in System Event Log...
Searching in Application Event Log...
No quota violations detected
</pre>

The above output indicates that no violations have occurred. If violations had, in fact, occurred, the output would have listed the violations. It is important, however, to keep in mind that by default violations are only written to the log files once every hour. If a violation has only recently occurred it may not, therefore, show up immediately in the list of violations. To verify the current update frequency, use the ''fsutil behavior query quotanotify'' command:

<pre>
C:\Windows\system32>fsutil behavior query quotanotify
quotanotify = 3600
To change the frequency simply use the fsutil behavior set quotanotify command. For example:
fsutil behavior set quotanotify 1800
</pre>