Linux disk quotas: Which administrative command is used to set (edit) user and group quotas on a Linux system?
-
A/sbin/usrquota
-
B/sbin/edquota
-
C/sbin/quotaon
-
D/sbin/quota
-
ENone of the above
Answer
Correct Answer: /sbin/edquota
Explanation
Introduction / Context:Disk quotas limit the amount of filesystem space or inodes a user or group can consume. Linux provides a set of quota tools to enable, configure, and report usage. Administrators must know which tool actually edits quota limits versus those that merely enable or display them.
Given Data / Assumptions:
- Traditional quota tools are installed (quota, quotaon, edquota).
- Filesystems are mounted with quota support where applicable.
- Goal: change the hard/soft limits for users or groups.
Concept / Approach:
The workflow typically is: enable quotas with quotaon, optionally initialize with quotacheck, and then set limits with edquota. The quota command displays current usage and limits; it does not edit them. Nonexistent commands (like /sbin/usrquota) are distractors.
Step-by-Step Solution:
Choose the editor: /sbin/edquota (often invoked simply as edquota).Run: edquota username (opens a text editor to modify blocks/inodes soft and hard limits).To set group quotas: edquota -g groupname.Apply and verify with quota username and repquota filesystem.Verification / Alternative check:
After editing, use quota -u user or repquota -a to confirm limits. Ensure /etc/fstab includes usrquota and/or grpquota options and that quotaon has been executed.
Why Other Options Are Wrong:
- /sbin/usrquota: Not a standard quota command.
- /sbin/quotaon: Enables quotas on a filesystem; does not edit limits.
- /sbin/quota: Displays usage and limits; read-only reporting.
- None of the above: Incorrect because /sbin/edquota is correct.
Common Pitfalls:
Editing quotas before enabling them; forgetting to mount filesystems with quota options; misinterpreting block units (often 1 KB or 1 block size unit depending on build); and not running quotacheck after major changes.
Final Answer:
/sbin/edquota