Chapter 14th Disk Quotas

Source: Internet
Author: User

First, the main use of quota:

For Web site Services (WWW), the IDC domain name space will generally restrict the site space

For enterprise mailboxes, the use of each user's mailbox can be soft and hard limit

For the file server, can be used for each user, ftp,nts, etc.

We need to be aware that we can set the maximum soft and hard disk quota for users and groups.

Precautions:

1. Disk quotas are loaded in the kernel

2, only applicable to the Etx2/ext3/ext4 file system, the directory is not functional Oh, this point to pay special attention, although the mount point is a directory, but he is actually a file system device.

3. Only for users or user groups, except for Root

4. The limit for the user group refers to the restrictions that are used by all members of a user group, not by everyone


Before we start, let's take a look at the content related to quota configuration

Inode: Limit the number of files a user can create

Block: Limit the capacity of the user's disk in kilobytes (KB)

Soft: soft limit. After this value is exceeded, the user is alerted, but the user's permissions are not limited.

Hard: Rigid limit. This is the highest limit, and the user or group will never exceed this limit value. If this is exceeded, the user's permissions are restricted.

Grace Time: Grace period. This is when the soft limit is reached and the hard limit is not reached, to remind the user. If the user does not perform any disk management operations within the number of days of the warning, then the soft limit will immediately replace the hard limit as the quota limit, even if you do not have to achieve hard limits.


Ii. the orders involved

1, Mount-o remount/data re-mount the file system


2. Quotacheck detect disk quotas and generate quota files

Parameters:

-C Create Quota file

-a scan in the/etc/fstab file, there is a partition that joins the quota settings.

-D Displays the instruction execution process in detail to facilitate troubleshooting or understanding the execution of the program.

-G scans the disk space to calculate the number of directories and files occupied by each group ID.

-R excludes the partition where the root directory resides.

-U scans the disk space to calculate the number of directories and files occupied by each user ID.

-V Displays the instruction execution process.

Example:

[Email protected] ~]# Quotacheck-cuvg/data

After the command executes successfully, two quota files are generated in the "/data" directory: Aquota.user, Atuota.group, respectively, to save the user and group quota limits.

[Email protected] ~]# Ls/data

Aquota.group Aquota.user Lost+found


3, Edquota Edit user and group account quota settings

Parameters:

-U sets the user's quota, which is a preset parameter.

-G sets the quota of the group.

-p< source user name > apply the quota settings from the source user to another user or group.

-T sets the grace period.

Example:

disk quota settings for user Jerry [email protected] ~]# edquota-u Jerry

disk quota settings for Caiwu group [[email protected] ~]# edquota-g Caiwu


4. Quotaon Activate disk quotas

Function: Open disk space limit; The file system root directory of each partition must have Quota.user and Quota.group configuration files.

Parameters:

-A opens in the/ect/fstab file, there is a space limit for the partition that joins the quota setting.

-G to open the group's disk space limit.

-U turns on the user's disk space limit.

-V Show instruction instruction execution process

Description

After the disk quota is set up, you must also activate it with the Quotaon command, which you need to specify the device file name or the mount point directory of the file system as the command parameter.

Example:

[[email protected] ~]# quotaon-ugv/data ' activate '/data ' file system user, group quotas

/DEV/SDB1 [/data]: group quotas turned on

/DEV/SDB1 [/data]: User quotas turned on


5. Quotaoff Close the disk space limit

Parameters:

-A close in the/etc/fstab file, there is a space limit for the partition that joins the quota setting.

-G turn off the disk space limit for the group.

-U closes the user's disk space limit.

-V Show Instruction execution process


6. Quota Verify disk quota function

Parameters:

-g lists the disk space limits for the group.

-Q Concise list that lists only the parts that exceed the limit.

-U lists the user's disk space limit.

-V Displays the space limit for the user or group on all storage devices that are mounted on the system.

-V Displays version information.

[[email protected] ~]# quota-u Jerry ' View user Jerry's disk quota usage

[[email protected] ~]# quota-g caiwu ' view disk quota usage for CAIWU Group


This article is from the "Asteroid" blog, please be sure to keep this source http://3203180.blog.51cto.com/3193180/1884357

Chapter 14th Disk Quotas

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.