Quota2004-04-23 15:18 PM
Authors: from: Linux knowledge base Contact: unknown implement quota first guarantee has been installed quota, and then set the partition required quota in the fstab such as we / home disk quota, fstab should look like this: / dev / hda5 / Home ext2 rw, Userquota, GroupQuota 1 2 The / dev / hda5 is my / home corresponding disk partition / home is the mount point RW is that readable and writing userquota is a quotable Group QUOTA to represent the user group. Perform quota followed by edit /etc/rc.d/rc.local, plus code: if [-x / sbin / quotacheck]; the echo "Checking quotas, this may take some time ..." / sbin / quotacheck -avug Echo "DONE." "Fi if [-x / sbin / quotaon]; the echo" enabling disk quota ... "/ sbin / quotaon -avug echo" done. "Fi finally creates quota files in the corresponding directory, such as I In the instance of the upper side, it should be /Home/quota.user and /Home/quota.group, respectively, with the user quota and user group quotas, more like fine information should be refer to the Fstab's Man, but I refer to the content in FreeBSD, seems You can also create quota.user and quota.group on / etc / down to limit the user's global disk quota, you can try how big the disk space is, the disk space is not enough, it seems to be a forever fact. Linux provides a means to limit user disk space to make each user reasonably and effectively use space assigned to him. The limitations of the user disk space are in units of file system (partition), regardless of user files in which directory in this file system. 1. Modify the / etc / fstab file. Add a quota option (as follows) in the file system corresponding to the Mount command line. / DEV / HDA7 / Home Ext2 Defaults, USRQUOTA, GRPQUOTA 1 22. Reloading Linux partitions, for example: [root @ fileserver root] # mount -o remount / home Continue. 3. Establish aquota.user and aquota.group files in the installation point directory of the file system to add disk limit: [root @ fileserver root] # CD / home (/ home is a single partition / dev / hda7 loading point) [root @FileServer Home] # Touch Aquota.user (setting disk limit for users) [root @ fileserver home] # Touch Aquota.group (setting disk limit for user group) This time generated Aquota.user and Aquota.Group are empty, Does not comply with the system requirements. Please see the next step. 4. Generate the Aquota.user and Aquota.Group [root @ fileserver home] # quotacheck / home / (generated aquota.user) [rootacheck -g / home / (generated Aquota.group in line with system requirements, there is an error message. This is not tight. Because the previous Touch is generated is an empty file, it is sure the format is wrong.
At this time, for the EXT3 file system, it may "have to" run this command: [root @ fileserver home] # quotacheck -m [-u] / dev / hda7 [root @ fileserver home] # quotacheck -m -g / dev / HDA7 is the correct Aquota.user and Aquota.group generated. Continue Next: 5. Set disk space limit for users: [root @ fileserver home] # edquota [-u] user_name [root @ fileserver home] # edquota -g group_name (for user group) This command opens a VI window, for The user sets the number of disk space and the number of i nodes. The SOFT limit is a temporary limit; the HARD limit is a permanent limit (SOFT limit is slightly greater than the HARD limit), the editing method is identical to the VI, with zz or: WQ Command exit. To give several users USER1, USER2, User3 specify the same disk limit, the following command can be used to give these users with the same limit as protuser: [root @ fileserver home] # Edquota [-u] -p protuser1 user2 User3 [root @ fileserver home] # Edquota -g -p ProtGroup Group1 Group2 Group3 Setting Soft Quota and Hard Quota Time: [Root @ fileserver home] # Edquota -t A vi window: GRACE PERIOD BEFORE Enforcing Soft Limits For Users: Time Units May Be: Days, Hours, Minutes, or SecondsFilesystem Block Grace Period Inode Grace Period / Dev / HDA7 7DAYS 7DAYS Changes to themselves, and save the exit to set this time. You may need to restart later so that the disk limit takes effect. You can, but pay attention to some problems, please continue to look. 6. Check the consistency of disk space limitations, the system automatically restarts, after checking the hard drive (/etc/rc.sinit), no need to do personally. If the partition has been hung up in "reading and writing", you have to be careful, for example: [root @ fileserver root] # Quotacheck / Homequotack: quota for users is enabled on mountpoint / home so quotacheck might Damage the file.please Turn Quotas Off OR use -f to force checking.7. If you want to cancel the limit of disk space and i node, you can use the following command, please see: [Root @ fileserver root] # Quotaoff / Home (cancel disk space limit.) [root @fileserver root] # Quotaon / HOME (now start disk space limit.