{"id":292,"date":"2024-10-21T22:05:28","date_gmt":"2024-10-21T14:05:28","guid":{"rendered":"http:\/\/192.168.5.24\/?p=292"},"modified":"2024-10-24T18:12:21","modified_gmt":"2024-10-24T10:12:21","slug":"linux%e7%b3%bb%e7%bb%9f%e7%a3%81%e7%9b%98%e9%85%8d%e9%a2%9d%e7%9a%84%e8%ae%be%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/bigvip.dpdns.org\/?p=292","title":{"rendered":"Linux\u7cfb\u7edf\u78c1\u76d8\u914d\u989d\u7684\u8bbe\u7f6e"},"content":{"rendered":"\n<p>        Linux\u542f\u7528\u78c1\u76d8\u914d\u989d\u9700\u8981\u5185\u6838\u652f\u6301\uff0c\u540c\u65f6\u5fc5\u987b\u5b89\u88c5quota\u3001xfsprogs\u8f6f\u4ef6\u5e76\u628a\u9700\u8981\u505a\u78c1\u76d8\u914d\u989d\u7684\u5206\u533a\u4ece\u65b0\u4f7f\u7528usrquota\u3001grpquota\u9009\u9879\u6302\u8f7d\uff0c\u624d\u80fd\u8bbe\u7f6e\u78c1\u76d8\u914d\u989d\u3002\u4e0b\u9762\u6211\u4eec\u6309\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<p>1\u3001\u5b89\u88c5quota\u3001xfsprogs<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  yum -y install quota\n  yum -y install xfsprogs<\/code><\/pre>\n\n\n\n<p>2\u3001\u91cd\u65b0\u6302\u8f7d\u6587\u4ef6\u7cfb\u7edf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mount -o remount,usrquota,grpquota \/dev\/myvg\/mylv \/mailbox<\/code><\/pre>\n\n\n\n<p>3\u3001\u8bbe\u7f6e\u914d\u989d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u5bf9\u4e8exfs\u6587\u4ef6\u7cfb\u7edf\uff1a\nxfs_quota -x -c 'limit -u bsoft=50M bhard=80M isoft=3 ihard=5 xiaohong \/mailbox'\n\u7ec4\u914d\u989d\u9650\u5236\uff1a\nxfs_quota -x -c 'limit -g  bhard=200M isoft=30 ihard=50 xiaohong \/mailbox'\n\u6ce8\u610f\uff1a\u7ec4\u914d\u989d\u9650\u5236\u53ea\u80fd\u9650\u5236\u57fa\u672c\u7ec4\u76f8\u540c\u7684xionghong\u7ec4\u7528\u6237\u7684\u6574\u4f53\u914d\u989d\u3002<\/code><\/pre>\n\n\n\n<p>4\u3001\u67e5\u770b\u914d\u989d\u4f7f\u7528\u60c5\u51b5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>xfs_quota -x -c 'report -bih' \/mailbox<\/code><\/pre>\n\n\n\n<p>5\u3001\u9a8c\u8bc1\u914d\u989d<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>\u4f7f\u7528touch\u521b\u5efa5\u4e2a\u6587\u4ef6\u8fdb\u884cinode\u9650\u5236\u6d4b\u8bd5\n&#91;xiaohong@localhost mailbox]$ touch 1 2 3 4 5\n\u518d\u521b\u5efa\u4e00\u4e2a\u63d0\u793a\u8d85\u51fa\u914d\u989d\n&#91;xiaohong@localhost mailbox]$ touch 6\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\">touch: cannot touch \u20186\u2019: Disk quota exceeded<\/mark>\n\u4f7f\u7528dd\u521b\u5efa\u6307\u5b9a\u5927\u5c0f\u7684\u6587\u4ef6\u8fdb\u884c\u5bb9\u91cf\u5927\u5c0f\u914d\u7f6e\u7684\u6d4b\u8bd5\n&#91;xiaohong@localhost mailbox]$ dd if=\/dev\/zero of=\/mailbox\/test1 bs=60M count=1\n1+0 records in\n1+0 records out\n62914560 bytes (63 MB) copied, 0.0476075 s, 1.3 GB\/s\n&#91;xiaohong@localhost mailbox]$ dd if=\/dev\/zero of=\/mailbox\/test1 bs=81M count=1\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\">dd: error writing \u2018\/mailbox\/test1\u2019: Disk quota exceeded<\/mark>\n1+0 records in\n0+0 records out\n83689472 bytes (84 MB) copied, 0.0863215 s, 970 MB\/s<\/code><\/pre>\n\n\n\n<p>6\u3001\u5173\u95ed\u914d\u989d\u9650\u5236<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u5173\u95ed\u914d\u989d\u9650\u5236\nquotaoff\n\u6253\u5f00\u914d\u989d\u9650\u5236\nquotaon<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u542f\u7528\u78c1\u76d8\u914d\u989d\u9700\u8981\u5185\u6838\u652f\u6301\uff0c\u540c\u65f6\u5fc5\u987b\u5b89\u88c5quota\u3001xfsprogs\u8f6f\u4ef6\u5e76\u628a\u9700\u8981\u505a\u78c1\u76d8\u914d\u989d\u7684\u5206\u533a\u4ece\u65b0\u4f7f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[20],"tags":[53],"class_list":["post-292","post","type-post","status-publish","format-aside","hentry","category-linux","tag-53","post_format-post-format-aside"],"_links":{"self":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=292"}],"version-history":[{"count":7,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/292\/revisions"}],"predecessor-version":[{"id":301,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/292\/revisions\/301"}],"wp:attachment":[{"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bigvip.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}