Section 3.4. Limiting Use of Disk Space with Quotas


3.4. Limiting Use of Disk Space with Quotas

Windows 2000 first introduced the quota feature, allowing an administrator to define a limit or set of limits on the consumption of disk space by individual users. Windows quota support, up until Windows 2000, was available only through third-party software, which was typically very expensive.

Windows Server 2003's quota management features some interesting properties:

  • Windows Server 2003 can distinguish between volumes, so you can set different quotas on different volumes to, perhaps, segregate types of data, or offer a specific volume for one department's exclusive use.

  • You can assign quotas on mapped drives, as long as the physical volumes to which the mapped drives point were created with Windows 2000 Server or Windows Server 2003, or were upgraded to either of the later versions from Windows NT 4.0.

  • Windows Server 2003 does not allow grace writes, as do some third-party software programs. That is, some software allows a user to continue an operationsay, a file copy processeven if during the middle of that operation the quota is reached. Server 2003 does not allow this; it will cut off the operation when the quota is reached.

As usual, though, neat features always contain weak points. First, quotas are supported only on disks formatted with the NTFS filesystem. This isn't too surprising because most progressive filesystem features aren't available under the various flavors of FAT. Second, and perhaps more disturbing, due to an architectural limitation, filesystem-based quotas can be added only to users. This creates quite a headache, as most other network operating systems allow you to set a default quota based on group membership. In this manner, all normal users could have 500MB, power users and executives could have 1.5GB, and administrators could have unrestricted space. Alternatively, payroll users could have 250MB while the sales team, with their myriad PowerPoint presentations, might need 1GB a piece. Alas, Windows Server doesn't support this, but later in this section I'll show you a problematic but workable way around this limitation. And third, Windows Server 2003 doesn't provide any sort of messaging mechanism when users exceed their quota. The OS simply writes an event to the System event log, and although you can filter through these events via either the GUI or the command-line as described later, it still requires manual labor on your part. This certainly could be improved in future revisions.

3.4.1. Setting Default Quotas

To set up default quotas through Windows Explorer, follow these steps:

  1. Open My Computer, right-click the drive for which you want to enable quota support, and select Properties.

  2. Navigate to the Quota tab.

  3. Make sure the Enable quota management checkbox is checked. If it's not, quota support is not enabled. If you want to continue, check this checkbox.

  4. Choose one or more of the following selections based on your needs:


    Deny disk space to users exceeding quota limit

    If you check this checkbox, when users reach their usage limit, Windows returns an "insufficient disk space" error, thereby preventing them from writing more data until somehow they either change or remove files to make more space available. To individual application programs, where this behavior is handled in various ways, it appears that the volume is full. If the checkbox is not checked, users can exceed their quota limit, which makes this an effective way to simply track disk usage by user and not enforce limits on storage space use.


    Limit disk space to

    Here, specify the amount of space newly created users of the disk can fill, and the amount of space that can be used before alerts are recorded in the event log (known as the soft quota, or warning level). You can use decimal values and varying units to fine-tune your settings.


    Log event when a user exceeds their quota limit

    If quotas are enabled, disk event entries are recorded hourly in the system event log when a user reaches his hard quota, or official limit.


    Log event when a user exceeds their warning level

    If quotas are enabled, disk event entries are recorded hourly in the system event log when a user reaches his soft quota, or warning level.

3.4.2. Managing Quotas from the Command-Line

To set up default quotas and modify them using the command-line, type the following at the prompt:

fsutil quota modify [VolumeOrDrive] [warninglevel] [hardquota] [username]

replacing the text in brackets with the appropriate information as specified in the following list:


VolumeOrDrive

The drive letter or volume name of the disk on which you want to modify a quota. Volume names are tricky to specify because you must do so using the globally unique identifier (GUID), which can be a long string of seemingly random numbers.


warninglevel

The amount of space at which warnings will be recorded in the system event log.


hardquota

The amount of space at which users will reach their maximum allowed disk space.


username

The user to which this quota specification applies.

Using fsutil.exe, you can create scripts to automatically set quota entries upon new-user creation to work around the limitation of assigning quotas to groups, as described in the previous section. fsutil.exe can help you access functionality more quickly and efficiently than you can by using the GUI interface. The following examples, designed to run from a command-line, illustrate the quota functionality available through fsutil.exe.

To disable quota support on drive C:

fsutil quota disable C:

To enable quota support on drive E:

fsutil quota enforce E:

To set a 250MB quota for Lisa Johnson (user ID lmjohnson) on drive C:

fsutil quota modify C: 250000000 lmjohnson

To list the current quotas set on drive D:

fsutil quota query D:

To track the disk usagein other words, to list which users are taking up what amount or portion of spaceon drive F:

fsutil quota track F:

To list all users over quota on any volume on the server:

fsutil quota violations

3.4.3. Configuring Individual Quota Entries

You might find it useful to set individual quotas for specific users which exempt them from a more limiting default quota you might have configured. This is useful in working around the limitation of being able to assign quotas to users and filesystems, but not to groups. You can set these individual quota entries through the GUI by clicking the Quota Entries button on the Quota tab under the Properties sheet of the disk in question. In the Quota Entries for Drive box, select Quota from the pull-down menu and click New Quota. Figure 3-12 shows this.

Figure 3-12. Entering a new disk quota entry


Select the user to which to apply the new quota, and in the box, configure the restrictions on the user's space.

You also can use the command-line functions, as illustrated previously, to perform this task.



    Learning Windows Server 2003
    Learning Windows Server 2003
    ISBN: 0596101236
    EAN: 2147483647
    Year: 2003
    Pages: 149

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net