Linux Disk quota

Source: Internet
Author: User

In Linux, quota uses Quota to limit the disk Quota of a specified user or user group in a partition. quota Limits the disk Quota by limiting the user's blocks or inodes. System Environment: Ubuntu 12.04 Server 1. install the disk quota tool quota Java code apt-get install quota 2. Modify the file/etc/fstab so that the file system supports quota: java code vi/etc/fstab (add the usrquota and kgquota parameters) #/was on/dev/sda1 during installation UUID = login/ext4 errors = remount-ro, usrquota, /, so that the modification takes effect: Java code mount-o remount/4. scan the file system and create a quota file for quota: Java code quotacheck-avug 5. Enable the quota function: Java code quotaon- Auvg 6. View usage statistics Java code repquota-augvs 7. Edit the account/group limit Java code [root @ www ~] # Edquota-u user1 Disk quotas for user user1 (uid 710): Filesystem blocks soft hard inodes soft hard/80 10000 10000 0 0 0 7 fields meaning: 1. filesystem: Specifies the target file system (or partition). 2. disk capacity (blocks): this value is calculated by quota. The unit is Kbytes. Do not change it manually. 3. soft: the soft limit of the disk capacity (block). Unit: KB4. hard: hard limit of the block, in KB; 5. number of archives (inodes): This is calculated by quota. The unit is the number. Do not change it manually. 6. soft: the soft limit value of inode; 7. hard: hard of inode Limit value; soft and hard mean: hard: indicates that the user's usage will never exceed the limit value. If the limit is exceeded, the system will lock the user's disk use right; soft: indicates that the user can use the disk normally when it is lower than the soft limit, but if it exceeds the soft limit and is lower than the hard limit, every time the user logs on to the system, the system sends a warning message indicating that the disk is about to fill up, and gives a grace period (7 days by default ). If the disk volume is not reduced to below soft within seven days, the disk limit will change to the soft limit value after seven days, and the disk use right will be locked and no new files will be added. When soft/hard is 0, it indicates there is no limit. The width and time limit are modified through edquota-t. 8. Test the Java code dd if =/dev/zero of = test20M bs = 1 M count = 20. When the created file exceeds the hard limit, the file will be created again, however, the size of the created file is limited.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.