Set Disk Quota (second edition)

Source: Internet
Author: User

Set Disk Quota (second edition)
Set Disk Quota

Case:

/Test directory 777 50 m/user

1. Enable the partition Disk Quota Function

Temporary settings: Run mount-o remount, usrquota/test

Permanent settings: edit the/etc/fstab file and mark the usrquota [user quota] Or kgquota [user group quota, not commonly used] on the Mount attribute.

/Dev/sdb1/test ext4 defaults, usrquota 1 2

2. Create a quota database

Quotacheck-cvuga [quota, quota, quota]

-C create

-V: Show Details

-U creates a detection user quota

-G: create a user group quota for detection.

-A: detects all partitions.

Quotacheck-cvu/test # create only the user quota, and accurate to/test Partition

After you run this command, two files, aquota. user and aquota. groups, will be created.

-If SELinux is enabled, the command may fail to be executed.

Solution-Disable SELinux

Setenforce 0

Getenforce

Then run quotacheck-cvu/test.

OK!

3. Enable the quota Function

Quotaon [partition name]

Example: quotaon/test

[Disable the quota function: quotaoff partition name]

Iv. edit user quota

The edquota user name enters the user quota editing mode.

For example, edquota hadoop

Format description: blocks (kb) soft hard limits the size of the user's Space

Inodes soft hard limits the number of files created by the user]

Soft limit: defines the amount of disk space that a user can use. When the user exceeds this limit, the user will receive a warning that the quota is exceeded.

You can use edquota-t to set the grace period.

Grace period: defines the duration for users to use their file systems under Soft Limits

Hard limit: when a user attempts to store a file in a directory that has exceeded the limit value, the user reports a file system error and cannot create a file.

In fact, only the limit in blocks can be set: hadoop users can only use 50 M, as shown in

[Edquota-g user group name edit user group quota]

5. If multiple users need to copy the user quota

Edquota-p template user copying user 1 copying user 2... copying user n

Vi. Detection

VII. View quota Information

Quota [user name] # view the user's quota usage. You can view your disk quota without adding a user name.

Repquota-a or repquota/test # The administrator can view the quota information.

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.