Setting User Disk Quotas


Mac OS X lets you set user disk quotas that limit the total amount of data a user is allowed to store on the server. These quotas work based on file ownership: Any file owned by a user applies to that user's disk quota.

Disk quotas are applied separately for each volume. In other words, a user with a 50 MB disk quota can store 50 MB of data on each volume to which they have write access.

To enforce disk quotas using Workgroup Manager, the user must have a home folder configured even if you never intend the home folder to be used. See the task "To create a user home directory."

To enable disk quotas

1.

In Workgroup Manager, click the Sharing icon in the Toolbar, click the All tab, select a volume on which to enable disk quotas, and select the "Enable disk quotas on this volume" check box (Figure 4.52).

Figure 4.52. From the server volume list, select a volume on which to enable disk quotas; then select the "Enable disk quotas on this volume" check box.


Typically, you'll select the volume where the user's home folders will reside.

2.

Click Save and restart the server to enable quotas for the selected volume.

This creates the hidden quota configuration files and enables the quota service for the selected volume.

3.

Repeat steps 35 for every volume on which you want to enforce disk quotas.

To set a user's disk quota

1.

In Workgroup Manager, navigate to configure the user (or users') Home attributes by clicking the Accounts icon, and then clicking the Home tab on the User tab.

2.

In the user list, select the user or users you wish to configure and place a number in the Disk Quota field (Figure 4.53).

Figure 4.53. Select the user or users for whom you want to set quotas and enter a number size in the Disk Quota field, also choosing MB or GB.


3.

Select MB or GB for the appropriate size of the user's quota.

4.

When you've finished making changes, click Save.

The next time this user logs in via AFP, the quota files will be configured for their account. You can always change the user's quota in the future.

Tips

  • When you're using AFP, a malicious user can max out another user's disk quota by filling the other user's Drop Box with large files.

  • Quotas set in Workgroup Manager apply only to the volume that a user's home folder resides on.

  • Quotas are updated the next time the user logs in via AFP. There is no way in Workgroup Manager to force an update of the quotas, or to make a non-AFP file sharing connection update them.


Setting disk quotas via the command line

Enabling disk-usage quotas using command-line tools gives you much greater control over quota settings than is available from Workgroup Manager. In fact, there are so many options that this section can cover only the basics.

The following task outlines the generally practiced method for setting quotas from the command line. Note that you must be the super user to configure disk usage quotas.

To set a disk quota from the command line

1.

Do one of the following:

  • Log in to the command line as the root user.

  • Log in with sudo s.

  • Preface every command with sudo.

2.

Do either of the following:

  • Use the quota files created by Workgroup Manager.

  • Create the quota files .quota.user and .quota.ops.user at the root level of every volume on which you wish to enable quotas, by entering touch /.quota.user /.qouta.ops.user in the command line.

3.

Configure the correct ownership and permissions for the quota files by entering chown :admin .quota* and then chmod 640 .quota* in the command line.

4.

Update the quota files to reflect the current disk usage by entering quotacheck <volume name> in the command line.

5.

Enable the quota system by entering quotaon <volume name> in the command line.

6.

Configure the quota settings for your user accounts by using the edquota <user name> command.

This utility uses vi, a command-line text editor, to configure the quota settings; consult the man pages for proper use of vi.

7.

Use repquota <volume name> or quota <user name> to view the disk quota usage and settings.

Tips

  • Although it isn't recommended, once you've configured quotas using the command-line tools, you can still use Workgroup Manager to configure quota settings.

  • Remember, it's always a good idea to experiment with quota settings on a test account before implementing quotas system wide.

  • You can also configure disk quotas based on group accounts by creating .quota.group and .quota.ops.group at the root level on any volume.


Quotas Expanded

You can use command-line tools to further edit user quotasfor example, by adding group quotas and/or specifying the quotas as fixed (hard quotas) or malleable (soft quotas). Hard quotas are implemented immediately, and soft quotas allow users to go over their quotas for seven days after the quota is in place, at which time the soft quota turns into a hard quota. The quota command-line tools are as follows:

  • quotaon and quotaoff Turn the quotas on and off

  • repquota Summarizes quotas

  • quota Displays disk quota use and limits

  • edquota Edits user and group quotas

  • quotacheck Ensures consistency

Refer to the section "Setting disk quotas via the command line" for more information about using these tools.





Mac OS X Server 10. 4 Tiger. Visual QuickPro Guide
Mac OS X Server 10.4 Tiger: Visual QuickPro Guide
ISBN: 0321362446
EAN: 2147483647
Year: 2006
Pages: 139
Authors: Schoun Regan

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