Manage user/group quota

To manage user quota it is necessary to install the 'quota' package. It is not installed by default.

root@sh-srv:~# apt-get install quota

Create quota files using the 'quotacheck' command followed by the options and the device or path where it is mounted. In the example the device name is used.

root@sh-srv:~# quotacheck -cug /dev/sda1

-c Create file 

-u User file

-g Group file

quota_files

The new files 'aquota.group' amdaquota.user' are binary files and therefore can not be edited with a text editor. To edit these files it is necessary to use the 'edquota' tool follow by the user/group.

root@sh-srv:~# edquota -u julian

The 'edquota' tool will parse a piece of the 'aquota.user' file so it will be editable. It is possible to limit the amount of blocks and inodes the user can use in the partition.

edquota_julian

Soft Limit - Number of blocks/inodes that can be used by the user

Hard Limit - When the soft limit is passed the user can still save data until it reaches the hard limit within the grace period.

Grace period - Default is 7 days in which the user after passing the soft limit can still store files.

Once the soft limit is passed the user has a period of time to get under the soft limit wich is called the grace period. During the grace time the user can still save data until the hard limit is reached. Either reaching the hard limit or expiring the grace time will cause the user not to be able to save more files.

To activate quotas:

root@sh-srv:~# quotaon

To deactivate quotas:

root@sh-srv:~# quotaoff

To change the grace period:

root@sh-srv:~# edquota -t

The 'repquota' tool will provide an overview of the disk quota usage.

root@sh-srv:~# repquota /dev/sda1


Terms of Service Privacy Security

© 2025 Julian's Corner. All rights reserved