Article Title: Disk Quota settings in RedhatLinux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Disk Quota settings under Redhat
The quota prevents users and groups from occupying all the partition space.
You can configure a quota by limiting the number of inode. Each inode is associated with a specific file. You can also set an absolute limit (KB ).
By default, readhat installs and activates the quota rpm package. If you are not sure, run the command: rpm-q quota.
The quota is usually activated in the kernel.
To use the quota for a specific user, six steps are required:
1. Modify/etc/fstab to activate the quota option for the selected file system;
2. Reload the file system to make the change take effect;
3. Create the aquota. user file at the beginning of the file system.
4. Scan the corresponding file system and use the quotacheck command to generate the basic quota file;
5. Use the edquota command to limit the quota of specific users;
6. Use the quotaon command to activate the quota.
The following is an example of how to limit the disk quota of user test in/partition:
Modify/etc/fstab
# Vi/etc/fstab, in
LABEL = // ext3 defaults 1 1 line to activate the disk quota. The modified result is as follows:
LABEL = // ext3 defaults, usrquota 1 1
Save and exit.
Reload the file system for the change to take effect
Reactivate/etc/fstab and change: # mount-o remount/
Create the aquota. user File
Generate the aquota. user File under the/partition. The simplest method is to use the touch command:
Touch aquota. user, modify the permissions of the aquota. user File, and only allow the root user to access:
Chmod 600 aquota. user
Check the quota
You can use the quotacheck-avum command to generate a quota file.
-A: scan the file system that supports the quota in/etc/fstab;
-V: Generate lengthy output;
-U: Check the user quota;
-M: Reload the scanned file system;
Set a quota for user test
Run the following command: edquota test
LABEL = // ext3 defaults, usrquota 1 1
Disk quotas for user test (uid 501 ):
Filesystem blocks soft hard inodes soft hard
/Dev/hda2 20 100000 0 6 0 0
~
Set inodes soft hard.
Enable quota
# Quotaon/(use quotaoff/to cancel/partition quota settings)
Now, the quota setting for the test user for/partition is complete.
You can use the following command to copy the same restriction to other users (kk tt ):
# Edquota-up test kk tt
In addition, use the repquota command to monitor the quota usage.