Disk quotas allow Windows administrators to control and manage the size of the disk space used by users on the file systems of servers and workstations. Windows Server supports two types of quotas: File Server Resource Manager quotas and NTFS quotas. Though FSRM quotas are more flexible and convenient, in some cases NTFS quotas can be efficiently used. For example, to restrict the size of roaming profiles directories (but not User Profile Disks) and redirected home folders in RDS scenarios, user directories on an FTP server, personal directories at IIS sites, etc.
Using quotas, you can restrict the maximum size of files and folders for each user, so that it doesn’t exceed some limit and stick the entire disk. Disk quotas are available both in server and client Windows versions.
The main peculiarities and limitations of NTFS quotas:
- Quotas can be applied only to the NTFS-formatted partition entirely (this quota type won’t work in ReFS)
- Quotas are applied to all users who store their data in this partition. You cannot apply a quota to a user group or a separate directory. In this case it’s better to use FSRM
- File and folder ownership is determined by checking the Owner record in the NTFS security descriptor
- By default the system scans the partition, in which a quota is enabled, and counts the total file size of each user every hour
- When using NTFS compression, the original file size is taken into consideration (before compression)
There are the following scenarios for using disk quotas:
- Monitoring of the disk usage — viewing the statistics of server disk space utilization by users
- Monitoring and notification — in addition to the first scenario, when the quota is exceeded this fact is logged
- Control of the disk usage — if the quota is exceeded, user cannot save new files
Let’s consider the case of NTFS quotas configuration on a disk containing user data on the Windows Server 2012 R2. In all previous Windows versions (starting from Windows 2003), the quotas are configured in the same way.
Open the disk properties window, on which you want to enable quotas, go to the Quota tab. Then click Show Quota Settings:
To enable the quota policy for this volume, check Enable quota management.
The following options may be checked depending on the scenario of quota use:
- Deny disk space to users exceeding quota limit – denies writing to a disk to users having exceeded the limit
- Limit disk space to — limits the disk space for a user
- Log event when a user exceeds their quota limit – logs an event if a user exceeds the quota limit
- Log event when a user exceeds their warning level – logs an event when reaching the threshold
It is not recommended to enable Deny disk space to users exceeding quota limit at once. It is preferable to estimate the current utilization of disk space by your users. In our example, we want to limit the users to 300 MB on the server disk.
Save the changes (Apply). In some time (depending on the disk size and the number of files), Windows will count the total usage of the disk space by every user.
After clicking Quota Entries, you can go to the resulting table showing quotas and the current size of the space used by every user (whose files are found on file system).
From this window, you can create/change/delete the quota value. Thus, you can override standard quota settings, for example, by increasing the quota for a certain user.
To disable NTFS quotas for a specific account, open the properties (Properties) of the account in the quota table and check Do not limit disk usage.
If you want to get the list of files belonging to a specific user, who has exceeded the quota limit, click Delete.
This dialog box allows to change the owner of a specific file (Take ownership), delete (Delete) or move (Move) it.
After you have arranged your quotas in the audit mode, you can enable Deny disk space to users exceeding quota limit. After that the user can’t exceed the allocated space on the disk, and the size of the disk in the user session will be displayed according on its existing quotas. In this example for my account on the C: \ drive used 70 MB of the 300 MB quota.
If the quota limit is exceeded, a user gets the following message:
“There is not enough space on ….”
At the same time, an event with the EventID 37, source Ntfs is logged:
NTFS quotas can also be managed from the command prompt. To do it, the command fsutil quota is used.
To get the current quota settings for the specific disk, run the command:
fsutil quota query e:
To list the table with exceeded quota limits:
fsutil quota violations
To get the frequency of the quota table update:
fsutil behavior query quotanotify