The role of the Linux disk quota is basically the same as that of the windows Disk Quota. Here we will explain step by step how to set the Linux disk quota, and how to configure the disk quota on the disk partition, I hope it will help you.
Do you want to add a quota with the partition? This is acceptable.
First, you need to modify your/etc/fstab file:
LABEL = // ext3 defaults 1 1
Changed:
LABEL = // ext3 defaults, usrquota 1 1
Or change:
LABEL = // ext3 defaults, MAID 1
Usrquota is based on the user's disk quota, while kgquota is based on the group's disk quota. How to change it depends on what you need.
Then you can restart or remount (mount-o remount /.
Second, create aquota. user or aquota. grup in/. These two files should be created in the top-level directory where you want to implement the quota. What is the so-called classification directory? For example, if you want to implement a quota on/, you need to create a aquota under. user or aquota. grup; if you want to implement the quota on/home, of course, your/home should be an independent disk partition), create one of the two files under/home. You can use the touch command to create touch aquota. user or aquota. srup. However, the created file is empty, which does not meet the system requirements. So proceed to the next step.
Third, use quotacheck-mc/to format these two files (aquota. user or aquota. grup.
Note that unless it is a/partition, you generally do not need to add the-m parameter. For example, if you want to implement a quota on/home, your/home should be an independent disk partition: quotacheck-c/home.
-M indicates to force the disk quota to be checked in "read and write" mode.
Fourth, quotaon/BOOT disk quota.
Fifth, set the user/group quota for the edquota user name/group name
Example: edquota user_name
Edquota-g group_name for user groups)
After execution, a vi editing window is displayed. You can set the disk space and the number of nodes. Among them, soft only serves as a warning and does not actually limit users/groups. Hard will forcibly limit the disk space and number of nodes of the user/group.
Sixth, set the time between soft quota and hard quota:
Edquota-t
A vi window appears:
Grace period before enforcing soft limits for users:
Time units may be: days, hours, minutes, or seconds
Filesystem Block grace period Inode grace period
/Dev/hda7 7 days 7 days
Modify as needed. Restart. The disk quota takes effect.
7. If you want to copy the same disk quota in batches, you will not be able to get through:
Edquota-p user user1 user2 user3
Edquota-g-p group group1 group2 group3
Eighth, cancel the Linux Disk Quota:
Quotaoff/
- Linux time Conversion Method
- Solve Linux garbled characters
- Linux link file type
- Comprehensive Analysis of Linux clock
- Solve Linux grub startup Problems