2. Exam Objectives
Key Knowledge Areas
Set up a disk quota for a filesystem.
Edit, check and generate user quota reports.
Objective 4: Devices, Linux Filesystems, Filesystem Hierarchy Standard
Manage disk quotas Weight: 1
Terms and Utilities
3. Manage disk quotas
quota utility is used to view information about disk usage and user quotas.
Quota information can be displayed for all file systems listed in /etc/fstab:
this file contains info regarding whether quotas can be used on various file
Files used to manage quotas are located in file system root:
- quota.user for user accounts
- quota.group for group quotas.
Files must be created by superuser and with rw permissions only for superuser
These files are not manually edited when working with quotas.
Quotas are specified at the partition level, which enables control which partitions use quotas
and to set these quotas independently of partition.
4. Manage disk quotas
User and group quotas are set individually.
When a user creates a new file, that user’s account and group both have ownership of the file.
If a user’s group exceedes quota limit, user will be unable to create files, regardless of user’s quota.
-g Displays group quota information.
-u Displays user quota information. This is the default action.
-v Displays quotas on file systems with no storage allocated.
-q Displays information for file systems with usage exceeding the quota.
# quota angie
Disk quotas for user angie (uid 501): none
5. Manage disk quotas
edquota is used by the superuser to edit user and group quotas.
-u Specifies to edit the user quota. This is the default action.
-g Specifies to edit the group quota.
-p user Duplicates the quotas of the user specified for each user specified.
-t Used to edit the grace period used for soft limits for each file system.
# edquota –p jason –u angieEx:
utility to set 3 different quota limits:
1.soft limit – limit that can be exceeded for a period of time.
2.grace period - period of time in which a user can exceed their soft limit.
3.hard limit - limit at which a user can no longer create new files.
6. Manage disk quotas
repquota displays summary of the disk usage and quotas for the specified file systems.
-a Displays information on all file systems indicated in /etc/fstab with quotas.
-v Displays information for all quotas, even if there is no usage.
-g Displays quota information for groups.
-u Displays quota information for users. This is the default.
# repquota –v /
*** Report for user quotas on / (/)
Block limits File limits
User used soft hard grace used soft hard grace
root -- 8 0 0 1 0 0
7. Manage disk quotas
quotaon and quotaoff are used to enable and disable file system quotas.
quotaon and quotaoff
Option Use with quotaon Use with quotaoff
-a Enables quotas for all file systems in Disables quotas for all file systems
/etc/fstab that are configured listed in /etc/fstab.
with read/write quotas.
-v Displays a message for each Displays a message for each file
file system with quotas enabled. system affected.
-u Enables user quotas; Disables user quotas; this is the
this is the default action. default action.
-g Enables group quotas. Disables group quotas.
quota.user and quota.group files must exist before you can run the quotaon