Disk quotas

Disk quotas can be implemented by a system administrator as a way to manage restrictions on storage for users or groups of users. They allow the administrator to balance storage resources so that it is possible to manage finite capacity in a suitable way. An example of disk quotas in use would be, for example, a web hosting provider that allocates a certain amount of disk storage space per customer, or to limit certain users from consuming the full resources of the file-system, thereby preventing the file-system filling up and starving other users or the system of storage. There are two types of restrictions that can be put in place, one is which controls the number of files/directories, and  which can restrict based on storage blocks (size). When set limits are reached, it is possible to notify the system administrator or user consuming the resources in question, informing them to take appropriate action.

Kernel
Kernel support is required for disk quotas, if support for journaled quotas is required, the option "Quota formats vfsv0 and vfsv1 support" also needs to be enabled.

fstab
(Explain how to configure the package/software/tool/utility in this section.)

To enable quotas, some configuration is required by editing and enabling and/or  for each file-system upon which quotas need to be managed. For journaled quota, add the mount options. For additional information regarding and filesystem quota options refer to the man page. Quotas are set and edited by the quota tools which manage configuration files in the root of each file-system named , and for new quota version formats and , for older formats.

After has been edited accordingly, the file-systems need to be remounted. Repeat the mount command for every file-system that has been edited and enabled for quotas.

Group quotas (local system)
It is possible to apply quotas to groups of users, if this is desired a group has to be present on the system to assign the quota to. This creates a new group quotagroup and adds two users to the group, assuming there are already users alice and bob.

Creating the quota files
After the configuration has been completed, the quota files need to be created. This is accomplished with the command. The following command checks user and group quotas and creates the quota files as neccessary for. After the quota files are created, a simple check with can verify the quota files are there.

Environment variables
?

Files
/etc/quotagrpadmins /etc/quotatab

Usage
(Explain how to use the package/software/tool/utility in this section.)

Invocation
The Linux quota tools contain several commands to create and manage filesystem quotas. The following are some basic examples of putting the tools to use.

(Remove this section if not applicable

quotaon & quotaoff
Turning on filesystem quotas for all filesystems

Turning off filesystem quotas for all filesystems

repquota
Displaying summaries of quotas for filesystems

setquota
Setting disk quotas on the command line is accomplished with the command. From the man page, the usage states     as parameters. The following command sets quotas for user alice on the file-system.

TODO: parameters needs to be researched and tweaked

edquota
Editing user quotas are accomplished with the command, specifying the filesystem with the -f option and the quota to be edited. The following command will edit the quotas for user bob on the /home filesystem. EDITOR will be opened to begin editing quotas.

quotastats
Querying quota statistics

quota
Displaying users disk usage and limits

Troubleshooting
(Troubleshoot issues in this section. Separate issues by best describing the error with a new section name. Remove if no issues are known.)

Issue 1
When X happens, Y is how you fix it.

Removal
(Explain how to properly remove the software. If this section needs more than an 'emerge -C' command each step should be explained in detail so that no trace of the software remains on the system.)

Turning off quotas
The quotas for each filesystem should be turned off before removal.

Removing configuration
To clean up the system if quotas are not required any more perform the following steps

Edit and remove quota options for filesystems

Remove the quota configuration files

External resources

 * (Link to external resources (outside the Wiki) using bullet points in this section. It is common for the information in this section to full sentences that are links.)


 * Information on quotas from the ext4 wiki