Deploying disk quota (quota) applications and practices in Linux
Source: Internet
Author: User
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 someone occupies a large amount of space, then... capital
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!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.