1. First, we need to understand the role of the disk quota and what is quota. The disk quota can be simply understood as the number of quotas. We know that Linux is a multi-person environment, so it is easy to show that when multiple users use a hard disk, if an individual occupies a large amount of space, other users may not be able to use the disk. Therefore, as the root user, we should use the hard disk to set the permission for the hard disk user. We can simply understand quota.
Main purposes of www.2cto.com 2 and Quota: For WebSite Services (www), the IDC Domain Name Space generally imposes restrictions on the website space for the enterprise mailbox, each user's mailbox can be subject to hardware and software restrictions for the file server, and can be used for each user, ftp, we need to note that we can set the maximum Disk Quota for users and groups.
3. disadvantages of Quota: quota is only supported for file system Linux systems. quota is not supported in versions earlier than kernel2.4. Currently, we all use the 2.6 kernel, it is basically supported, unless it is not supported at the antique level. Quota is only valid for common users and cannot be set for root users.
Www.2cto.com I. Practical quota deployment. We use a small case to complete our deployment. 1. First, check the system partition type and the mounting status. We can see that each of my partitions is a separate partition, in this practice, we do not recommend "/" partitioning when using/home for quota management. 2. Create a test account with a script. The script content is as follows: 3. Grant the execution permission, execute the script, and create an account. Check www.2cto.com 4. Manually mount the/home group and use the quota. Note that do not write the error "usrquota ", either of the two methods is effective temporarily or permanently in the second method is to temporarily set the mounted quota to be remounted, is to modify the configuration file vim/etc/fstab need to be added after the/home line, for users and groups of quota. To test whether automatic mounting is complete, we first unmount it because it is manually mounted, and then we are testing whether the automatic mounting takes effect to test whether everything works normally. It should be noted that, when an error occurs during uninstallation, check whether other people are using this directory, because Linux is a multi-user environment. 5. Check that qouta is created. Run the quotacheck command. Then, check whether/dev/sda3 is a separate/home partition in the file graph of quota is generated. : 6. Enable and disable quota. This step is important. After checking the quota, we need to start quota. Otherwise, everything we do is in vain, method 7: Modify the default time of global configuration. The default value is 7 days. You can change the time according to the default value or as needed. Run the edquota-t command to modify the global configuration edqouta-T to modify the user configuration 8. Modify the local configuration of the user. The following figure shows the file system:/dev/sda3, disk capacity blocks is the default value. We do not need to modify it. soft is a soft connection and hard is a hard connection. We do not want to write errors because the unit here is KB or M. Indoes indicates the number of files, soft indicates the number of software files, hard indicates the number of hard files, blocks indicates the size of files, and inodes indicates the number of files. The figure shows the quota1 user settings, which can be used by other users by default. We can set the file group limit to 900 M 1 GB to modify the user's disk with edquota-u quota1.
Www.2cto.com 9. view the reports generated by our users and groups. The operations we have done are recorded in detail in the table. For details, 10. The above configuration and deployment are basically completed. We will use the normal account for testing, first, we use quota1 to test the prompt when the file reaches the soft limit, and warn when the user exceeds the soft limit. 11. Then, let's test quota2 to see what the prompt is when the user exceeds the hard limit. When the file we create exceeds the hard limit, the file will continue to be created, however, the file we created will be created to the required size. This experiment is complete!