Linux Disk Quota

Source: Internet
Author: User
Tags touch command

The role of the Linux disk quota is basically the same as that of the windows Disk Quota. Here we will explain step by step how to set the Linux disk quota, and how to configure the disk quota on the disk partition, I hope it will help you.

Do you want to add a quota with the partition? This is acceptable.

First, you need to modify your/etc/fstab file:

LABEL = // ext3 defaults 1 1

Changed:

LABEL = // ext3 defaults, usrquota 1 1

Or change:

LABEL = // ext3 defaults, MAID 1

Usrquota is based on the user's disk quota, while kgquota is based on the group's disk quota. How to change it depends on what you need.

Then you can restart or remount (mount-o remount /.

Second, create aquota. user or aquota. grup in/. These two files should be created in the top-level directory where you want to implement the quota. What is the so-called classification directory? For example, if you want to implement a quota on/, you need to create a aquota under. user or aquota. grup; if you want to implement the quota on/home, of course, your/home should be an independent disk partition), create one of the two files under/home. You can use the touch command to create touch aquota. user or aquota. srup. However, the created file is empty, which does not meet the system requirements. So proceed to the next step.

Third, use quotacheck-mc/to format these two files (aquota. user or aquota. grup.

Note that unless it is a/partition, you generally do not need to add the-m parameter. For example, if you want to implement a quota on/home, your/home should be an independent disk partition: quotacheck-c/home.

-M indicates to force the disk quota to be checked in "read and write" mode.

Fourth, quotaon/BOOT disk quota.

Fifth, set the user/group quota for the edquota user name/group name

Example: edquota user_name

Edquota-g group_name for user groups)

After execution, a vi editing window is displayed. You can set the disk space and the number of nodes. Among them, soft only serves as a warning and does not actually limit users/groups. Hard will forcibly limit the disk space and number of nodes of the user/group.

Sixth, set the time between soft quota and hard quota:

Edquota-t

A vi window appears:

Grace period before enforcing soft limits for users:

Time units may be: days, hours, minutes, or seconds

Filesystem Block grace period Inode grace period

/Dev/hda7 7 days 7 days

Modify as needed. Restart. The disk quota takes effect.

7. If you want to copy the same disk quota in batches, you will not be able to get through:

Edquota-p user user1 user2 user3

Edquota-g-p group group1 group2 group3

Eighth, cancel the Linux Disk Quota:

Quotaoff/

  1. Linux time Conversion Method
  2. Solve Linux garbled characters
  3. Linux link file type
  4. Comprehensive Analysis of Linux clock
  5. Solve Linux grub startup Problems

Related Article

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.