ÐéÄâÖ÷»úÖо³£ÒªÏÞÖÆÓû§¿Õ¼äµÄ´óСºÍÎļþµÄÊýÁ¿¡£ÕâЩÏÞÖÆÔÚlinuxºÍFreeBSDÖж¼ÊÇÓÃQUOTAÀ´ÊµÏֵġ£ÕâÀïÎÒ˵ÏÂÔÚFreeBSDÏÂʵÏֵķ½·¨£»
Ê×ÏÈÄãÒªÔÚÄÚºËÖмÓÈëQUOTAÖ§³Ö¡£
machine i386
cpu I686_CPU
#ident GENERIC
ident CNOSvhost
maxusers 0
options QUOTA #¾ÍÊÇÕâÐÐÁË¡£
Ð޸ĺúóÖØбàÒëÄںˡ£
enable_quotas="YES"
check_quotas="YES"
ÕâÑùÄãµÄϵͳ¾ÍÆðÓÃQUOTAÁË£¬ÄãÓ¦µ±Í¨¹ý±à¼/etc/fstabµÄij¸öÎļþϵͳµÄÊôÐÔ£¬¼ÓÈëQUOTAµÄÖ§³Ö¡£
ÏÂÃæµÄfstabÎļþ¾ÍÉèÖÃÁËÔÚ/pubÎļþϵͳÉÏÆðÓÃÓû§Åä¶îºÍ×éÅä¶î
# See the fstab(5) manual page for important information on automatic mounts
# of network filesystems before modifying this file.
# Device Mountpoint FStype Options Dump Pass#
/dev/ad0s1b none swap sw 0 0
/dev/ad0s1a / ufs rw 1 1
/dev/ad0s1h /pub ufs rw,userquota,groupquota 2
2
/dev/ad0s1e /tmp ufs rw 2 2
/dev/ad0s1g /usr ufs rw 2 2
/dev/ad0s1f /var ufs rw 2 2
/dev/acd0c /cdrom cd9660 ro,noauto 0 0
proc
/proc procfs rw 0 0
ÉèÖÃÍêfstabÎļþºó£¬Ö´ÐÐÏÂÃæµÄÃüÁî´ò¿ªquota
# quotacheck -av
# repquota -a
»ù±¾ÉÏÇ°ÆڵŤ×÷¶¼ÒѾ×öÍêÁË£¬Ê£ÏµľÍÊDZà¼Óû§µÄÅä¶îÁË¡£
# edquota c4st½«±à¼Óû§c4stµÄÅä¶îÉ趨£¬³öÏÖµÄÊÇÒ»¸öÎı¾±à¼Æ÷½çÃ棺
Quotas for user c4st:
/pub: kbytes in use: 3438, limits (soft = 100000, hard = 100020)
inodes in use: 25, limits (soft = 25, hard = 26)
ÎÒÃÇ¿´µ½É趨¹²·ÖΪÁ½ÐС£
kbyters in use:3438ÒѾʹÓÃÁË3438kb limitsÏÞÖÆ(soft=100000ÈíÏÞÖÆ100M£¬hard=100020Ó²ÏÞÖÆ)
soft±íʾ´ïµ½´Ëֵʱ¾¯¸æ£¬hard±íʾµÄÓû§Êµ¼Ê¿ÉÒÔʹÓõĴóС¡£
inodes in use: 25, limits (soft = 25, hard = 26)ÕâÐÐΪ¿ÉÒÔÓµÓеġ°ÎļþÊýÁ¿¡±ÏÞ¶¨£¬µ±È»Àý×Ó¸ø³öµÄÊýÖµ²»Ì«Êµ¼Ê£¬ÉÏÃæµÄÉ趨£¬
Óû§Ö»ÄÜ´´½¨26¸öÎļþ¡£Êµ¼ÊÓ¦ÓÃÖУ¬¿ÉÒÔ¸ù¾ÝÐèÒªµ÷ÕûinodesµÄÖµ£¬±ÈÈ磬ÄãҪװһ¸ö»ùÓÚÎı¾¿âµÄ³ÌÐò£¬Èçlb5000£¨Ò»ÖÖwebbbs£©£¬
һЩcgiÎÄÕ¹ÜÀíµÈϵͳ£¬Äã¾ÍÒªÊʵ±µÄµ÷´óinodeµÄhardÉ趨¡£
³£¼ûµÄquotaÃüÁî
# edquota -t¶ÔquotaÓû§Ê¹ÓÃÈíÏÞÖÆ֮ǰµÄʱ¼äÉ趨£¬days£¬hours£¬minutes»òseconds¶¼¿ÉÒÔÊÇ´ËÉ趨µÄµ¥Î»£¬ÖµÖ»ÒªÊǺÏÀí¾Í¿ÉÒÔ¡£
Time units may be: days, hours, minutes, or seconds
Grace period before enforcing soft limits for users:
/pub: block grace period: 1 day, file grace period: 1 day
# repquota -a±¨¸æÎļþϵͳ¹ØÓÚquotaµÄÐÅÏ¢¡£
Block limits File limits
User used soft hard grace used soft hard grace
wheel -- 2 0 0 - 1 0 0 -
operator -- 128 0 0 - 2 0 0 -
mysql -- 18 0 0 - 9 0 0 -
vhostuser -- 36164 100000 100050 - 342 1000 1005 -
Block limits File limits
User used soft hard grace used soft hard grace
root -- 9136 0 0 - 12 0 0 -
mysql -- 18 0 0 - 9 0 0 -
testmin -- 18 1000 1050 - 9 1000 1005 -
web -- 22152 0 0 - 122 0 0 -
coms_cn -- 1550 0 0 - 177 0 0 -
c4st -+ 3438 100000 100020 - 25 25 26 22:56
# Quota¡¡:ÏÔʾÓû§µÄ´ÅÅÌʹÓÃÇé¿öºÍÉÏÏÞ¡£
-g¡¡ÏÔʾÓû§ËùÔÚ×éµÄ×éÅä¶î
-l ²»ÏÔʾNFSϵͳÉϵÄÅä¶î
-u¡¡ÏÔʾÓû§Åä¶î
-q¡¡ÏÔʾʹÓÃÇé¿ö³¬¹ýÅä¶îµÄ¼òÒªÐÅÏ¢
-v ¼ì²éÓû§µÄquotaÉèÖÃ
# edquota -p test c4st c4st1 c4st2.....
½«°ÑÓû§testµÄÅä¶îÉ趨¸´ÖƸøÓû§c4st c4st1 c4st2.....
# quotacheck -aÕâ¸öÃüÁî¿ÉÒÔ¶¨ÆÚÖ´ÐУ¬ÓÃÀ´¼ì²éÈ«²¿É趨ÊÇ·ñÕý³£(¿ÉÒԷŵ½crontabÀïÖ´ÐÐ)¡£