Next | Prev | Up | Top | Contents | Index

Imposing Disk Quotas

The use of disk quotas to limit users' use of disk space is discussed in the section "Disk Quotas" in Chapter 3. They can be used only on EFS filesystems. To impose soft disk quotas, follow these steps:

  1. To enable the quotas subsystem, give the commands:

    # chkconfig quotas on

    # chkconfig quotacheck on

  2. Create a file named quotas in the root directory of each filesystem that is to have a disk quota. This file should be zero length and should be writable only by root. To create the quotas file, give this command as root in the root directory of each of these filesystems:

    # touch quotas

  3. Establish the quota amounts for individual users. The edquota command can be used to set the limits desired upon each user. For example, to set soft limits of 100 MB and 100 inodes on the user ID sedgwick, give the following command:

    # edquota sedgwick

    The screen clears, and you are placed in the vi editor to edit the user's disk quota. You see:

    fs / kbytes(soft=0, hard=0) inodes(soft=0, hard=0)

    The filesystem appears first, in this case the Root filesystem (/). The numeric values for disk space are in kilobytes, not megabytes, so to specify 100 megabytes, you must multiply the number by 1024. The number of inodes should be entered directly.

  4. Edit the line to appear as follows:

    fs / kbytes(soft=102400, hard=0) inodes(soft=100, hard=0)

  5. Save the file and quit the editor when you have entered the correct values. If you leave the value at 0, no limit is imposed. Since you are setting only soft limits in this example, the hard values have not been set.

  6. Use the -p option of edquota to assign the same quota to multiple users. Unless explicitly given a quota, users have no limits set on the amount of disk they can use or the number of files they can create.

  1. Issue the quotaon command to put the quotas into effect. For quotas to be accurate, this command should be issued on a local filesystem immediately after the filesystem has been mounted. The quotaon command enables quotas for a particular filesystem, or with the -a option, enables quotas for all filesystems indicated in /etc/fstab as using quotas. See the fstab(4) reference page for complete details on the /etc/fstab file.
Quotas will be automatically enabled at boot time in the future. The script /etc/init.d/quotas handles enabling of quotas and uses the chkconfig command to check the quotas configuration flag to decide whether or not to enable quotas. If you need to turn quotas off, use the quotaoff command.


Next | Prev | Up | Top | Contents | Index