Disk quota management
Introduction to disk quotas
Disk quota
Quota software Sets the disk quota function, only in the specified file system (partition) is valid, the disk quota limit object to the system in the specified user account, group account restrictions.
Disk quota in redhat linux
the limit types of disk quotas are divided into : windows disk quota
Samba disk quota
Disk capacity : Limits the size of disk blocks that users can use, that is, the size of disk space, which is the default in kilobytes.
Number of files : Limit the number of files that a user can have, and each file in Linux has a corresponding digital tag, called the I node number, which is unique within the same file system.
Windows 10 disk quota
How to limit disk quotas :
Soft limit : means temporarily allowing this user to exceed this limit for a fixed period of time, but the system will give a warning.
Hard Limit : Refers to the absolute prohibition of users exceeding this limit, the hard limit value cannot be less than soft limit otherwise the soft limit expires.
Experimental purpose
Set disk quotas for users and verify
Set disk quotas for a group and verify
Set disk quotas for user-attached groups and verify
Set disk quotas for both the user and the group that the user is in to verify which takes effect
Experimental steps
Set disk quotas first to turn off SELinux
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/CE/wKiom1XtaeriDi3OAAA3K_nU_VA849.jpg "title=" 2@z7[ Vcht3$ms]3[0mpej@a.png "alt=" Wkiom1xtaeridi3oaaa3k_nu_va849.jpg "/>
Mount the/DEV/VG01/LV01 to the/OPT directory and do disk quotas
Mount with the "-o usrquota,grpquota" option to increase support for user and group quota features
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/CB/wKioL1XtbTuCpCHIAAB3HnZFrBs123.jpg "title=" ZWD~VL [{5szk]@{9%_l$z11.png "alt=" Wkiol1xtbtucpchiaab3hnzfrbs123.jpg "/>
Use the Mount command to view mount conditions
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/CE/wKiom1XtbUfwk3qtAALiE7xdgCo685.jpg "title=" 18evn$ ' Opr8$te9$w~xhvmp.png ' alt= "wkiom1xtbufwk3qtaalie7xdgco685.jpg"/>
Use "QUOTACHECK-AUGCV" to detect hard disk quotas and generate quota files
-A: Indicates that all partitions are scanned (you need to specify a partition path if you do not add-a)
-U and-G: Indicates detection of user and group quota information
-C: Indicates the creation of a quota file
-V: Indicates the details of the display of the command during execution
A prompt message such as "old file not found" is normal
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/CB/wKioL1XtbyCzR_5_AAObLiMbKqw280.jpg "title=") i[ CSQG (427_$u) 7nbdbpfu.png "alt=" Wkiol1xtbyczr_5_aaoblimbkqw280.jpg "/>
Viewing the/OPT directory will find 2 more quota files
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/CE/wKiom1XtbaHxxqmwAABnVdgTiXI729.jpg "title=" 9_ I@466J (Fu[ph3 (nq}{d{j.png "alt=" Wkiom1xtbahxxqmwaabnvdgtixi729.jpg "/>
Use "Edquota-u user name" to limit users to quotas
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/72/CB/wKioL1XtcJmQewAdAAA7601ISiY095.jpg "title=" Zkk@zpq711iz]4i%sy}i8p7.png "alt=" Wkiol1xtcjmqewadaaa7601isiy095.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/CB/wKioL1XtcZfwfoltAAEfv3umpZo208.jpg "title=" 8c2_z5 {aygm[w[kdjv{v15.png "alt=" Wkiol1xtczfwfoltaaefv3umpzo208.jpg "/>
It is recommended that the size of the soft limit be set to a hard limit of 80%
To facilitate testing, set the/OPT directory permission value to: 777
Use the QUOTAON-UGV file System command to turn on the disk quotas feature
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/CE/wKiom1Xtcg_jAqbKAAETMX4zDIM533.jpg "title=" tg7{) X ~d2pt@@6_1c{kk@mr.png "alt=" Wkiom1xtcg_jaqbkaaetmx4zdim533.jpg "/>
Use the QUOTAON-P partition command to see if the partition disk quota is turned on
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/CE/wKiom1XtcmTTThUuAADg2J9ASfA932.jpg "title=" 9aznf$ 2@ ' @OODL ' ~f$ ' AK (1.png "alt=" Wkiom1xtcmttthuuaadg2j9asfa932.jpg "/>
Login ZS for testing
Use the DD conversion tool to test the if= specified input device or file, of= specify the output of the device or file, bs= the size of the input once, count= the number of inputs
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/CE/wKiom1XtcUfjx7xzAAJ15mtwCPM288.jpg "title=" h@ " Ae2a_hm$i_@gg2bg[p[7.png "alt=" Wkiom1xtcufjx7xzaaj15mtwcpm288.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/CB/wKioL1XtdRKRs6SjAASvyxvdggs900.jpg "title=" 7y8x[[ YE69) TUCO_IT64B@W.png "alt=" Wkiol1xtdrkrs6sjaasvyxvdggs900.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/CE/wKiom1Xtc8rAvtWgAANs3dX4AvU324.jpg "title=" @A9} kb6@t38e61_5z ' H) z$e.png "alt=" Wkiom1xtc8ravtwgaans3dx4avu324.jpg "/>
By verifying that ZS users can only use 1000KB of capacity, up to 5 files can be created. Configuration takes effect
Quota limits for groups usingedquota-g Group name
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/CE/wKiom1XtdKTxDaSgAAA76SkDimM284.jpg "title=" Tv89xi (' _66a4x~~sxxt5sp.png ' alt= "wkiom1xtdktxdasgaaa76skdimm284.jpg"/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/CE/wKiom1XtdQzCyes3AADkVVPIfQc180.jpg "title=" hd}$ Z0e[6gd~v (r~f~4914d.png "alt=" Wkiom1xtdqzcyes3aadkvvpifqc180.jpg "/>
Quota limit for Tom User's additional group test
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/D9/wKiom1XujVjitzK8AADpHpoyz38615.jpg "title="% N4L75A2}IK%KD ' 2ngtjq8c.png "alt=" Wkiom1xujvjitzk8aadphpoyz38615.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/D9/wKiom1Xuj3fAkl4QAAK2NsdHX_Q424.jpg "title=" 35v@{" Q7qk$_1{fm72i]jlo.png "alt=" Wkiom1xuj3fakl4qaak2nsdhx_q424.jpg "/>
Verify the discovery has exceeded the hard limit, stating that the additional group does not take effect!
Log in using the member LS in the LS group
Find LS users can only write 1000kb of content, the configuration takes effect!
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/CE/wKiom1XtdlmiDH4zAANkOIWRWm4568.jpg "title=") o@5} CK) X) 8 ($15rxy[99h7.png "alt=" Wkiom1xtdlmidh4zaankoiwrwm4568.jpg "/>
Simultaneous quota limits for LS users and groups
LS User's quota
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/CB/wKioL1XteieC4BoDAADNUQ6XUi4608.jpg "title=" J_od ( + ' 58]1 ' G (S ' [r9xmk.png "alt=" Wkiol1xteiec4bodaadnuq6xui4608.jpg "/>
The quota for the LS group
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/CB/wKioL1XtelryDvvGAADNIZF-quk524.jpg "title=" q0$ 73tj[@5$z2k1o~4k08oh.png "alt=" Wkiol1xtelrydvvgaadnizf-quk524.jpg "/>
Login LS user for verification
It is found that the LS user can only write 1000kb content, stating that the user and group set up the quota group in effect!
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/72/CE/wKiom1XteYKQUYYpAALm9MK4ySk006.jpg "title=" J9z9ddy) _}2d[4jtnaaq5}o.png "alt=" Wkiom1xteykquyypaalm9mk4ysk006.jpg "/>
Users can view their disk quota information by using the "quota" command
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/CB/wKioL1XtfMzSR7tbAAExOcEihO8829.jpg "title=" 7q3{[ rxbx]qvgzl{97 (wnc1.png "alt=" Wkiol1xtfmzsr7tbaaexoceiho8829.jpg "/>
Use the Repquota partition to view quota usage for the specified file system, which requires administrator privileges
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/CB/wKioL1Xtfo2w63hsAAHpqjCqFvg193.jpg "title=" _0$ Dvdmbn4%]a@a35yzkgvr.png "alt=" Wkiol1xtfo2w63hsaahpqjcqfvg193.jpg "/>
Conclusion: When users and groups set quotas at the same time, the group takes effect!
When you set quotas for a user's additional group, the quota for the additional group does not take effect!
This article from "Sunj" blog, declined reprint!
"Red Hat Linux" quota software disk quota management