The Centos system limits the disk space used by ordinary users.

Source: Internet
Author: User
Tags disk usage

Linux-Disk QuotaQuota

The disk quota meets the requirements.

1. kernel greater than or equal to 2.4

2. Set user or group

3. operate on a single file system

Lab environment:

1. Modify/etc/fstab settings/partitions to support the disk quota function (you can also set other partitions). This setting is permanent and the system startup will not be affected.

After the modification, re-mount/partition and re-read the/etc/fstab file from the kernel.

Use the quotacheck-cugm command to generate the disk quota configuration file under.

Disk Quota

Set the space size of user1 for normal users. The soft limit is 480 MB, and the hard limit is 500 mb. If the user exceeds the soft limit, an alarm is triggered)

View your disk quota

Switch to user1 and log on. Run the dd command to simulate writing large files to/partition.

When the bandwidth exceeds MB, an alarm is triggered.

When the data volume exceeds MB, the data cannot be written.

Check the user's disk usage again and find that the user space is used up. The system requires the user to reduce the capacity to less than MB in 7 days. Otherwise, the user cannot use the disk after 7 days, it must be reduced to less than MB to continue using.

Simulate the deletion of some files again and continue viewing. The user space usage is normal.

View the global Disk Quota configuration of all users. The default value is 7 days.

-T you can set a user's disk quota separately.

How to limit the number of files created by the user and set the soft and hard values after inodes is the same as setting the space quota.

This article is from the blog of "the Linux open source technology blog", please be sure to keep this source http://dreamfire.blog.51cto.com/418026/1085490


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.