Disk space can be
restricted by implementing disk quotas which alert a system
administrator before a user consumes too much disk space or a
partition becomes full. Disk quotas can be configured for individual
users as well as user groups.
In addition, quotas can
be set not just to control the number of disk blocks consumed but to
control the number of inodes (data structures that contain
information about files in UNIX file systems). Because inodes are
used to contain file-related information, this allows control over
the number of files that can be created.
Configuring
Disk Quota
To implement disk quotas,
use the following steps:
1. Enable quotas per
file system by modifying the /etc/fstab file.
2. Remount the file
system(s).
3. Create the quota
database files and generate the disk usage table.
4. Assign quota
policies.
Applying
Disk Quota
- Step 1 - Open /etc/fstab file using vi editor
- vi /etc/fstab
- Step 2 - Add usrquota or grpquota to following line
- LABEL=/home /home ext3 defaults,usrquota 0 0
- Step 3 – Remount the /home folder or reboot your machine
- mount –o remount /home
- Step 4 – Create quota database file
- quotacheck –cug /home
- quotaon -vug /home
- Step 5 – Apply the quota to a user / group using following command
- edquota –u username
- or
- setquota -u username softHDDlimit hardHDDlimit softINODElimit hardINODElimit /location
Quota
Commands
- quota : Run by user to check quota status
- repquota : Run by the root user to check the quota status for every user
- edquota –t : Assigns the grace period
- edquota -g groupname : Assigning Quotas on Group
- quotaoff -vaug : Disabling quota on everyone
- quotaon -vaug : Enabling quota on eve
No comments:
Post a Comment