On large systems with many users, you often need to control the amount of
disk space a user can use. Disk quotas are designed specifically for this
purpose. Quotas, managed per partition, can be set for both individual users
and groups; quotas for groups need not be as large as the aggregate quotas for
the individuals in the groups.
When a file is created, both a user and a group own it. Ownership of files is
always part of the metadata about the files. This makes quotas based on both
users and groups easy to manage.
NOTE
Disk quota management is not really useful or needed on a home system
and rarely, if ever, on a small office system. It is unlikely that you will see
or implement this in either circumstance.
To manage disk quotas, you must have the quota and quotatool
packages installed on your system. Quota management with Ubuntu is not
enabled by default and has traditionally been enabled and configured
manually by system administrators. System administrators use the family of
quota commands, such as quotacheck to initialize the quota database files,
edquota to set and edit user quotas, setquota to configure disk quotas,
and quotaon or quotaoff to control the service. (Other utilities include
warnquota for automatically sending mail to users over their disk space
usage limit.)
Implementing Quotas
Quotas are not enabled by default, even if the quota software package is
installed on your Ubuntu system. When quotas are installed and enabled, you
can see which partitions have either user quotas, group quotas, or both by
looking at the fourth field in the /etc /fstab file. For example, one line in
/etc/fstab shows that quotas are enabled for the /home partition:
Click here to view code image
/dev/hda5 /home ext3 defaults,usrquota,grpquota 1 1
The root of the partition with quotas enabled will have the file quota.user
or the file quota.group in it (or both files, if both types of quotas are
enabled), and the files will contain the actual quotas. The permissions of these
files should be 600 so that users cannot read or write to them. (Otherwise,
users would change them to allow ample space for their music files and
Internet art collections.) To initialize disk quotas, the partitions must be
remounted. This is easily accomplished with the following: