Linux Disk Quota commands
Linux Disk Quota commands
1. Quota has the following functions:
1) Limit the maximum disk quota that a group can use
2) Limit the maximum disk quota of a user
3) Link-based mail can be used as the limit (change the path of/var/spool/mail)
2. Quota usage restrictions
1) only for the entire filesystem
2) The core must support quota
3) Quota record file
4) it is only valid for general identity users. The root user cannot set quota, because almost all the data in the system is his
3. quota's restrictions on the entire filesystem are divided into the following parts:
1) capacity limit or file quantity limit (block or inode), where inode usage is restricted, you can manage the number of files that can be created by the user; block usage is limited to manage the user's disk capacity limit.
2) Flexible persuasion and hard planning: No matter inode/block, there are two restricted values: soft and block. Generally, the hard limit value is higher than soft. The meanings of these two limits are as follows:
A) hard: indicates that the user's usage will never exceed this limit value. Once this value is exceeded, the system will lock the user's disk use right.
B) soft: indicates that the user can use the disk normally when the value is lower than the soft limit. However, if the value is exceeded, a warning message indicating that the disk is about to be full will be sent and a grace period will be given. If the user releases the space within the grace period, the grace period is stopped.
3) Grace Period: Generally, the default value is 7 days. If you do not perform any operation during the grace period, the soft limit value replaces the hard value as the limit of quota.
4. quota record file: Quota analyzes the total number and total capacity of Files Owned by each user (Group) in the entire file system, and then records the data in the top-level directory of the file system, then, use the limit value of each account (or group) in the record file to regulate disk usage. Scan the file system that supports the Quota parameter (usrquota, kgquota) to use the quotacheck command.
5. quotacheck [-avugfM] [/mount_point]: scan the file system and create a Quota record file. parameters:
1)-a: scans all filesystems supported by quota in the/etc/mtab. After this parameter is added,/mount_point cannot be written because all filesystems are scanned.
2)-u: aquota. user will be created for users to scan files and directories.
3)-g: aquota. group is created for the use of group scan files and directories.
4)-v: displays information about the scanning process.
5)-f: forcibly scan the file system and write the new quota configuration file (dangerous)
6)-M: forcibly scans the file system in read/write mode, which is used only in special circumstances.
Generally-combined use of auvg
5. quotaon [-avug]; quotaon [-avug] [/mount_point]: Start the quota service: parameter,
1)-u: quota (aquota. user) is enabled for users)
2)-g: Start quota (aquota. group) for the group)
3)-v: displays the startup process information.
4)-a: Set the start-related quota according to the filesystem in/etc/mtab. If-a is not added, the specific filesystem needs to be added later.
6. quotaoff [-a]; quotaoff [-ug] [/mount_point]: Disable the quotaoff service. parameters:
1)-a: All filesystem quota is disabled (according to/etc/mtab)
2)-u: Only Disable user quota for the later/mount_point
3)-g: only disable group quotaon for the/mount_point that follows.
7. edquota [-u username] [-g gourpname]; edquota-t; edquota-p model account-u new account: Edit Account, group limit, and grace period, call vi to set parameters,
1)-u: followed by the account name. You can go to the quota editing screen (vi) to set the limit value of username.
2)-g: followed by the group name. You can enter the quota edit dialog box (vi) to set the groupname limit value.
3)-t: you can modify the grace period.
4)-p: copy the template. The template account is a user who already exists and has set quota, meaning "copy the quota limit value of the template account to the new account in the format of" edquota-p username-u newuser"
8. quota [-uvs] [username]; quota [-gvs] [groupname]: A single user's quota report. parameters:
1)-u: followed by username, which indicates that the user's quota limit value is displayed. If username is not connected, the limit value of the executor's quota is displayed.
2)-g: The groupname can be used to display the quota limit value of the group.
3)-v: displays the quota value of each user in filesystem.
4)-s: Use 1024 as a multiple to specify the Unit. A unit such as M is displayed.
9. repquota-a [-vugs]: reports the quota of the file system. parameters:
1)-v: the output data will also have filesystem-related details.
2)-u: displays the user's quota limit (this is the default value)
3)-g: displays the quota Limits of individual groups.
4)-s: The result is displayed in the unit of M and G.
10. warnquota: sends a warning to those who have exceeded the quota.
11. setquota [-u |-g] Name: block (soft) block (hard) inode (soft) inode (hard) File System: set the quota directly in the command
This article permanently updates the link address: