Linux disk quota settings that are easy to ignore

Source: Internet
Author: User

1. Experimental requirements:

1) Add a hard disk, implement new partition, partition format, boot automatically mount all partitions

2) Turn on the disk quotas feature

3) Add users to the system Tom, Lisa and group Benet

4) Set disk quotas for groups and users at the same time to verify which is effective


2. experimental Environment:

Linux Server System version: Red Hat Enterprise Linux6.5 ip:192.168.20.3

3. experimental steps:

Basic installation Operations

1. Add a 2G hard drive, just to do the experiment

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/48/wKiom1X5FmjycaH-AANkLcYdeK4235.jpg "title=" 1.png " alt= "Wkiom1x5fmjycah-aanklcydek4235.jpg"/>

A hard drive was detected:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/45/wKioL1X5GK2zlzLSAAErG36lIvY523.jpg "title=" 2.png " alt= "Wkiol1x5gk2zlzlsaaerg36livy523.jpg"/>

Partitioning a disk: Using the fdisk/dev/sdb command

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/73/45/wKioL1X5GSShv9A0AAErG36lIvY624.jpg "title=" 222. PNG "alt=" wkiol1x5gsshv9a0aaerg36livy624.jpg "/>

to format a partition

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/48/wKiom1X5FobT1cH1AAGgZ97BZJo893.jpg "title=" 3.png " alt= "Wkiom1x5fobt1ch1aaggz97bzjo893.jpg"/>

Create a new directory to mount the partition to the corresponding directory

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/45/wKioL1X5GTLy64uEAACv3teWgvk017.jpg "title=" 4.png " alt= "Wkiol1x5gtly64ueaacv3tewgvk017.jpg"/>

automatic mounting of partitions with Vi/etc/fstab.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/45/wKioL1X5GUazsZcjAAE-_YneMDg993.jpg "style=" float: none; "title=" 5.png "alt=" Wkiol1x5guazszcjaae-_ynemdg993.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/45/wKioL1X5GUaiBRA8AAIYy_UaAg0915.jpg "style=" float: none; "title=" 6.png "alt=" Wkiol1x5guaibra8aaiyy_uaag0915.jpg "/>

in order to do the experiment, here SDB5 partition to do the experiment.

re-mount without unloading

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/48/wKiom1X5FzPhHZG2AALA67Hxsfc240.jpg "title=" 7.png " alt= "Wkiom1x5fzphhzg2aala67hxsfc240.jpg"/>

Temporarily close SELinux

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/48/wKiom1X5F0GhNMHlAABaZcYELFo374.jpg "title=" 8.png " alt= "Wkiom1x5f0ghnmhlaabazcyelfo374.jpg"/>

to detect disk quotas and generate quota files:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/45/wKioL1X5GYTx6WMjAATVDEdXUFY671.jpg "title=" 9.png " alt= "Wkiol1x5gytx6wmjaatvdedxufy671.jpg"/>

to start the disk quotas feature of the file system

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/45/wKioL1X5GZ2TO2JVAADad0PLxTw595.jpg "style=" float: none; "title=" 10.png "alt=" Wkiol1x5gz2to2jvaadad0plxtw595.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/48/wKiom1X5F2eStH_YAAEQZtfdJ20624.jpg "style=" float: none; "title=" 11.png "alt=" Wkiom1x5f2esth_yaaeqztfdj20624.jpg "/>

Add users and groups to join a user to a group at the same time

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/48/wKiom1X5GG-gjR4CAAE3gyaPKmw677.jpg "title=" 333. PNG "alt=" wkiom1x5gg-gjr4caae3gyapkmw677.jpg "/>

disk quota settings for groups:650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M01/73/45/ Wkiol1x5gbrxpbxhaaa9rh88rzy544.jpg "title=" 13.png "alt=" Wkiol1x5gbrxpbxhaaa9rh88rzy544.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/45/wKioL1X5GdDBjCa1AADX9TSGa6c275.jpg "style=" float: none; "title=" 14.png "alt=" Wkiol1x5gddbjca1aadx9tsga6c275.jpg "/>


First Group Soft and the Hard is the soft, hard limit is the size of the space

Second group Soft and the Hard is the soft, hard limit is the number of files

to start the test:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/45/wKioL1X5GdCxwEGiAABE6nuMiCQ466.jpg "title=" 15.png "Style=" Float:none; "alt=" wkiol1x5gdcxwegiaabe6numicq466.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/48/wKiom1X5F8mzg8y5AAKpmTqU8VQ088.jpg "style=" float: none; "title=" 16.png "alt=" Wkiom1x5f8mzg8y5aakpmtqu8vq088.jpg "/>


limit is 20M , Tom has been written 6M , there are 14M not written ,

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/48/wKiom1X5GbCQPJc2AAMOYr7jDf8105.jpg "title=" 17.png "alt=" Wkiom1x5gbcqpjc2aamoyr7jdf8105.jpg "/>

At this time has exceeded its soft limit, the soft limit of the file is 3 And can be written again. 1 a

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/48/wKiom1X5GijwLuBTAAPRU_cMjUc118.jpg "title=" 18.png "alt=" Wkiom1x5gijwlubtaapru_cmjuc118.jpg "/>

Note: Here more than write a no hint message, you can continue to write, not to achieve the purpose of the experiment, this is because the user has just joined the group, it is also belong to the Benet Group, the experiment proves that the user's additional group quota is not effective. Instead, this belongs only to the benet Group for re-testing.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/45/wKioL1X5HO_zQds-AALwJcXtK_0413.jpg "style=" float: none; "title=" 19.png "alt=" Wkiol1x5ho_zqds-aalwjcxtk_0413.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/48/wKiom1X5GrnQCjXkAAPJjUTasPk373.jpg "style=" float: none; "title=" 20.png "alt=" Wkiom1x5grnqcjxkaapjjutaspk373.jpg "/>

Tom and the Lisa only available in total 20M .

Set disk quotas for users: (20M) Authentication is a priority for a group or a user

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/45/wKioL1X5HQKTKzWOAAC_DbwTlyM219.jpg "title=" 21.png "alt=" Wkiol1x5hqktkzwoaac_dbwtlym219.jpg "/>

The soft and hard limit for the user to set the space size is 20M \ 40M ,

If you can write 21M to prove that the user first, if only write the 20M , the Certificate group takes precedence

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/48/wKiom1X5GtmybZNwAAJNb5wHSx0669.jpg "title=" 22.png "alt=" Wkiom1x5gtmybznwaajnb5whsx0669.jpg "/>

Draw the conclusion that group first

To further the accuracy of the experiment, the user's disk quota is smaller (smaller than the quota of the group), and then see whether the group first, or user first.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/45/wKioL1X5HY_QZ4D9AAEeI_thMtM510.jpg "style=" float: none; "title=" 23.png "alt=" Wkiol1x5hy_qz4d9aaeei_thmtm510.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/48/wKiom1X5G1nxZZk3AACuu5AhX54942.jpg "style=" float: none; "title=" 24.png "alt=" Wkiom1x5g1nxzzk3aacuu5ahx54942.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/45/wKioL1X5HY_AhVHKAAM2UC4iikA006.jpg "style=" float: none; "title=" 25.png "alt=" Wkiol1x5hy_ahvhkaam2uc4iika006.jpg "/>

Draw a conclusion: User first


4. Experiment Summary:

Under the Linux system, when the disk quotas are set for users and groups at the same time, which one of the quotas is the priority, whichever is the smaller the quota.


This article is from the "Sunshine School" blog, please be sure to keep this source http://yuan2.blog.51cto.com/446689/1695356

Linux disk quota settings that are easy to ignore

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.