{"id":69024,"date":"2026-01-31T02:24:51","date_gmt":"2026-01-30T18:24:51","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/69024.html"},"modified":"2026-01-31T02:24:51","modified_gmt":"2026-01-30T18:24:51","slug":"%e7%a3%81%e7%9b%98%e7%a9%ba%e9%97%b4%e4%b8%8d%e8%b6%b3%e9%97%ae%e9%a2%98%e5%ae%9a%e4%bd%8d%e4%b8%8e%e8%a7%a3%e5%86%b3%ef%bc%88%e8%bf%90%e7%bb%b4%e5%ae%9e%e6%88%98%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/69024.html","title":{"rendered":"\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u95ee\u9898\u5b9a\u4f4d\u4e0e\u89e3\u51b3\uff08\u8fd0\u7ef4\u5b9e\u6218\uff09"},"content":{"rendered":"<h2>\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u95ee\u9898\u5b9a\u4f4d\u4e0e\u89e3\u51b3&#xff08;\u8fd0\u7ef4\u5b9e\u6218&#xff09;<\/h2>\n<h3>\u4e00\u3001\u6838\u5fc3\u6392\u67e5\u6d41\u7a0b<\/h3>\n<h4>1.1 \u5168\u5c40\u67e5\u770b\u78c1\u76d8\u4f7f\u7528\u6982\u51b5<\/h4>\n<ul>\n<li>\u6838\u5fc3\u76ee\u6807&#xff1a;\u5feb\u901f\u5b9a\u4f4d\u4f7f\u7528\u7387\u8fc7\u9ad8\u7684\u5206\u533a&#xff0c;\u540c\u65f6\u6392\u67e5inode\u8017\u5c3d\u95ee\u9898<\/li>\n<li>\u5173\u952e\u547d\u4ee4&#xff1a;<\/li>\n<\/ul>\n<p><span class=\"token comment\"># \u4ee5\u4eba\u7c7b\u53ef\u8bfb\u683c\u5f0f\u67e5\u770b\u5404\u5206\u533a\u7a7a\u95f4<\/span><br \/>\n<span class=\"token function\">df<\/span> -h<br \/>\n<span class=\"token comment\"># \u67e5\u770b\u5404\u5206\u533ainode\u4f7f\u7528\u60c5\u51b5<\/span><br \/>\n<span class=\"token function\">df<\/span> -i<br \/>\n<span class=\"token comment\"># \u67e5\u770b\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b&#xff08;\u5f71\u54cd\u6269\u5bb9\u547d\u4ee4&#xff09;<\/span><br \/>\n<span class=\"token function\">df<\/span> -T<\/p>\n<ul>\n<li>\u8f93\u51fa\u8bf4\u660e&#xff1a;\u91cd\u70b9\u5173\u6ce8\u4f7f\u7528\u7387%\u5217&#xff0c;\u6839\u5206\u533a&#xff08;\/&#xff09;\u4f7f\u7528\u7387\u226590%\u9700\u7d27\u6025\u5904\u7406<\/li>\n<\/ul>\n<h4>1.2.1 \u5b9a\u4f4d\u6ee1\u76d8\u5206\u533a\u4e0b\u7684\u5927\u76ee\u5f55<\/h4>\n<h5>\u67e5\u627e\u5f53\u524d\u76ee\u5f55\u4e0b\u6700\u5927\u76843\u4e2a\u6587\u4ef6\u5939\u5e76\u7edf\u8ba1\u5176\u5927\u5c0f<\/h5>\n<ul>\n<li>\u5b9e\u73b0\u811a\u672c&#xff08;\u517c\u5bb9 Linux&#xff09;<\/li>\n<\/ul>\n<p><span class=\"token comment\"># \u6838\u5fc3\u903b\u8f91&#xff1a;\u7edf\u8ba1\u5927\u5c0f \u2192 \u8fc7\u6ee4\u65e0\u5173\u884c \u2192 \u6392\u5e8f \u2192 \u53d6\u524d3 \u2192 \u683c\u5f0f\u5316\u8f93\u51fa<\/span><br \/>\n<span class=\"token function\">du<\/span> -h &#8211;max-depth<span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span> <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span>\/dev\/null <span class=\"token operator\">|<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token comment\"># \u8fc7\u6ee4\u6389\u5f53\u524d\u76ee\u5f55&#xff08;.&#xff09;\u7684\u7edf\u8ba1\u884c&#xff0c;\u53ea\u4fdd\u7559\u5b50\u6587\u4ef6\u5939<\/span><br \/>\n    <span class=\"token function\">grep<\/span> -v <span class=\"token string\">&#034;^[0-9.]*[KMG]B  \\\\.$&#034;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token comment\"># \u6309\u4eba\u7c7b\u53ef\u8bfb\u7684\u5927\u5c0f\u9006\u5e8f\u6392\u5e8f&#xff08;1GB &gt; 100MB \u8fd9\u79cd\u903b\u8f91&#xff09;<\/span><br \/>\n    <span class=\"token function\">sort<\/span> -hr <span class=\"token operator\">|<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token comment\"># \u53ea\u53d6\u524d3\u884c&#xff08;\u6700\u5927\u76843\u4e2a&#xff09;<\/span><br \/>\n    <span class=\"token function\">head<\/span> -3 <span class=\"token operator\">|<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n    <span class=\"token comment\"># \u683c\u5f0f\u5316\u8f93\u51fa&#xff0c;\u8ba9\u7ed3\u679c\u66f4\u6e05\u6670<\/span><br \/>\n    <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;{print &#034;\u6587\u4ef6\u5939&#xff1a;&#034; $2 &#034;\\\\t\u5927\u5c0f&#xff1a;&#034; $1}&#039;<\/span><\/p>\n<ul>\n<li>\u9002\u914d macOS \u7684\u7248\u672c<\/li>\n<\/ul>\n<p><span class=\"token function\">du<\/span> -h -d <span class=\"token number\">1<\/span> <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span>\/dev\/null <span class=\"token operator\">|<\/span><span class=\"token function\">grep<\/span> -v <span class=\"token string\">&#034;^[0-9.]*[KMG]B  \\\\.$&#034;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> -hr <span class=\"token operator\">|<\/span><span class=\"token function\">head<\/span> -3 <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;{print &#034;\u6587\u4ef6\u5939&#xff1a;&#034; $2 &#034;\\\\t\u5927\u5c0f&#xff1a;&#034; $1}&#039;<\/span><\/p>\n<h4>1.2.2 \u5b9a\u4f4d\u6ee1\u76d8\u5206\u533a\u4e0b\u7684\u5927\u6587\u4ef6<\/h4>\n<ul>\n<li>\u6838\u5fc3\u76ee\u6807&#xff1a;\u7cbe\u51c6\u5b9a\u4f4d\u5360\u7528\u7a7a\u95f4\u7684\u5927\u76ee\u5f55\/\u6587\u4ef6&#xff0c;\u7f29\u5c0f\u6392\u67e5\u8303\u56f4<\/li>\n<li>\u5173\u952e\u547d\u4ee4&#xff1a;<\/li>\n<\/ul>\n<p><span class=\"token comment\"># \u67e5\u770b\u6839\u5206\u533a\u4e0b\u4e00\u7ea7\u76ee\u5f55\u5927\u5c0f&#xff08;\u4e0d\u8de8\u6587\u4ef6\u7cfb\u7edf&#xff09;<\/span><br \/>\n<span class=\"token function\">du<\/span> -xh &#8211;max-depth<span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span> \/<br \/>\n<span class=\"token comment\"># \u805a\u7126\u91cd\u70b9\u76ee\u5f55&#xff08;\u5982\/var\/log&#xff09;<\/span><br \/>\n<span class=\"token function\">du<\/span> -sh \/var\/*<br \/>\n<span class=\"token comment\"># \u67e5\u627e\u5927\u4e8e100M\u7684\u6587\u4ef6\u5e76\u6309\u5927\u5c0f\u964d\u5e8f\u6392\u5e8f<\/span><br \/>\n<span class=\"token function\">find<\/span> \/ -type f -size &#043;100M -exec <span class=\"token function\">ls<\/span> -lh <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">}<\/span> <span class=\"token punctuation\">;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;{print $5, $9}&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> -hr<br \/>\n<span class=\"token comment\"># \u6392\u67e5\u5df2\u5220\u9664\u4f46\u672a\u91ca\u653e\u7684\u6587\u4ef6&#xff08;\u7a0b\u5e8f\u5360\u7528\u53e5\u67c4&#xff09;<\/span><br \/>\n<span class=\"token function\">lsof<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> deleted<\/p>\n<h4>1.3 \u5b89\u5168\u6e05\u7406\u65e0\u6548\u6587\u4ef6<\/h4>\n<ul>\n<li>\u6838\u5fc3\u539f\u5219&#xff1a;\u4f18\u5148\u6e05\u7a7a\u800c\u975e\u5220\u9664&#xff0c;\u907f\u514d\u7a0b\u5e8f\u53e5\u67c4\u5931\u6548<\/li>\n<li>\u5e38\u7528\u6e05\u7406\u547d\u4ee4&#xff1a;<\/li>\n<\/ul>\n<p><span class=\"token comment\"># \u6e05\u7a7a\u5927\u65e5\u5fd7\u6587\u4ef6&#xff08;\u4fdd\u7559\u6587\u4ef6\u672c\u8eab&#xff09;<\/span><br \/>\ntruncate -s <span class=\"token number\">0<\/span> \/var\/log\/messages<br \/>\n<span class=\"token comment\"># \u5220\u9664\u8fc7\u671f\u65e5\u5fd7\u8f6e\u8f6c\u6587\u4ef6<\/span><br \/>\n<span class=\"token function\">rm<\/span> -f \/var\/log\/*.log-202*<br \/>\n<span class=\"token comment\"># \u5220\u9664\/tmp\u4e0b7\u5929\u524d\u7684\u4e34\u65f6\u6587\u4ef6<\/span><br \/>\n<span class=\"token function\">find<\/span> \/tmp -type f -mtime &#043;7 -delete<br \/>\n<span class=\"token comment\"># \u91cd\u542f\u5360\u7528deleted\u6587\u4ef6\u7684\u8fdb\u7a0b\u91ca\u653e\u7a7a\u95f4<\/span><br \/>\nsystemctl restart <span class=\"token punctuation\">[<\/span>\u8fdb\u7a0b\u540d<span class=\"token punctuation\">]<\/span><\/p>\n<h4>1.4 \u8fdb\u9636\u5904\u7406&#xff08;\u6e05\u7406\u540e\u4ecd\u4e0d\u8db3&#xff09;<\/h4>\n<ul>\n<li>LVM\u6269\u5bb9&#xff08;xfs\u6587\u4ef6\u7cfb\u7edf&#xff09;&#xff1a;<\/li>\n<\/ul>\n<p><span class=\"token comment\"># \u6269\u5bb9\u903b\u8f91\u5377<\/span><br \/>\nlvextend -L &#043;10G \/dev\/mapper\/centos-root<br \/>\n<span class=\"token comment\"># \u5237\u65b0xfs\u6587\u4ef6\u7cfb\u7edf\u5927\u5c0f&#xff08;ext4\u7528resize2fs&#xff09;<\/span><br \/>\nxfs_growfs \/dev\/mapper\/centos-root<\/p>\n<ul>\n<li>\u8fc1\u79fb\u5927\u76ee\u5f55\u5230\u65b0\u78c1\u76d8&#xff1a;<\/li>\n<\/ul>\n<p><span class=\"token comment\"># \u79fb\u52a8\u6570\u636e\u76ee\u5f55<\/span><br \/>\n<span class=\"token function\">mv<\/span> \/var\/lib\/mysql \/data\/mysql<br \/>\n<span class=\"token comment\"># \u521b\u5efa\u8f6f\u94fe\u63a5\u4fdd\u6301\u7a0b\u5e8f\u8bbf\u95ee\u8def\u5f84\u4e0d\u53d8<\/span><br \/>\n<span class=\"token function\">ln<\/span> -s \/data\/mysql \/var\/lib\/mysql<\/p>\n<h4>1.5 \u4fdd\u7559\u6700\u65b0\u65e5\u5fd7100MB&#xff08;\u6e05\u9664\u65e7\u65e5\u5fd7\u4fdd\u7559\u65b0\u65e5\u5fd7&#xff09;<\/h4>\n<p>\u8981\u4fdd\u7559\u65e5\u5fd7\u7684\u6700\u65b0 100MB \u5185\u5bb9&#xff08;\u5c3e\u90e8\u5185\u5bb9&#xff09;&#xff0c;\u5e94\u4f7f\u7528 tail \u547d\u4ee4&#xff08;\u4e13\u95e8\u5904\u7406\u6587\u4ef6\u5c3e\u90e8&#xff09;&#xff0c;\u8fd9\u662f\u65e5\u5fd7\u5904\u7406\u7684\u884c\u4e1a\u901a\u7528\u505a\u6cd5&#xff0c;\u4e14\u66f4\u5b89\u5168&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u6838\u5fc3\u547d\u4ee4&#xff1a;\u4fdd\u7559app.log\u6700\u65b0\u7684100MB\u5185\u5bb9&#xff0c;\u8986\u76d6\u56de\u539f\u6587\u4ef6<\/span><br \/>\n<span class=\"token function\">tail<\/span> -c 100M app.log <span class=\"token operator\">&gt;<\/span> app.log.tmp <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token function\">mv<\/span> app.log.tmp app.log <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token function\">chmod<\/span> &#8211;reference<span class=\"token operator\">&#061;<\/span>app.log.bak app.log  <span class=\"token comment\"># \u53ef\u9009&#xff1a;\u4fdd\u6301\u539f\u6587\u4ef6\u6743\u9650&#xff08;\u5148\u5907\u4efd\u518d\u6267\u884c&#xff09;<\/span><\/p>\n<p>\u547d\u4ee4\u89e3\u91ca&#xff08;\u65b0\u624b\u53cb\u597d&#xff09;&#xff1a;<\/p>\n<ul>\n<li>tail -c 100M app.log&#xff1a;\u8bfb\u53d6 app.log \u5c3e\u90e8&#xff08;\u6700\u65b0&#xff09;\u7684 100MB \u5185\u5bb9&#xff1b;<\/li>\n<li>-&gt;app.log.tmp&#xff1a;\u628a\u8bfb\u53d6\u5230\u7684\u5185\u5bb9\u5199\u5165\u4e34\u65f6\u6587\u4ef6&#xff08;\u907f\u514d\u76f4\u63a5\u91cd\u5b9a\u5411\u5bfc\u81f4\u7684\u6587\u4ef6\u53e5\u67c4\u51b2\u7a81&#xff09;&#xff1b;<\/li>\n<li>mv app.log.tmp app.log&#xff1a;\u7528\u4e34\u65f6\u6587\u4ef6\u66ff\u6362\u539f\u65e5\u5fd7\u6587\u4ef6&#xff08;\u539f\u5b50\u64cd\u4f5c&#xff0c;\u65e0\u6570\u636e\u4e22\u5931&#xff09;&#xff1b;<\/li>\n<li>chmod &#8211;reference&#xff1a;\u4fdd\u6301\u539f\u6587\u4ef6\u7684\u6743\u9650 \/ \u6240\u5c5e\u7528\u6237&#xff08;\u53ef\u9009&#xff0c;\u4f46\u751f\u4ea7\u73af\u5883\u5efa\u8bae\u52a0&#xff09;\u3002<\/li>\n<\/ul>\n<h3>\u4e8c\u3001\u81ea\u52a8\u5316\u8fd0\u7ef4\u811a\u672c<\/h3>\n<h4>2.1 \u78c1\u76d8\u7a7a\u95f4\u76d1\u63a7\u544a\u8b66\u811a\u672c&#xff08;disk_monitor.sh&#xff09;<\/h4>\n<p><span class=\"token shebang important\">#!\/bin\/bash<\/span><br \/>\n<span class=\"token comment\"># \u914d\u7f6e\u9879<\/span><br \/>\n<span class=\"token assign-left variable\">ALERT_THRESHOLD<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">85<\/span>  <span class=\"token comment\"># \u78c1\u76d8\u4f7f\u7528\u7387\u544a\u8b66\u9608\u503c&#xff08;%&#xff09;<\/span><br \/>\n<span class=\"token assign-left variable\">INODE_THRESHOLD<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">90<\/span>  <span class=\"token comment\"># inode\u4f7f\u7528\u7387\u544a\u8b66\u9608\u503c&#xff08;%&#xff09;<\/span><br \/>\n<span class=\"token assign-left variable\">MONITOR_PART<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/&#034;<\/span>    <span class=\"token comment\"># \u76d1\u63a7\u5206\u533a&#xff08;\u591a\u4e2a\u5206\u533a\u7528\u7a7a\u683c\u5206\u9694&#xff09;<\/span><br \/>\n<span class=\"token assign-left variable\">EMAIL<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;admin&#064;example.com&#034;<\/span>  <span class=\"token comment\"># \u544a\u8b66\u63a5\u6536\u90ae\u7bb1<\/span><\/p>\n<p><span class=\"token comment\"># \u68c0\u67e5\u78c1\u76d8\u4f7f\u7528\u7387<\/span><br \/>\n<span class=\"token function-name function\">check_disk_usage<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> <span class=\"token for-or-select variable\">part<\/span> <span class=\"token keyword\">in<\/span> <span class=\"token variable\">$MONITOR_PART<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">do<\/span><br \/>\n        <span class=\"token assign-left variable\">usage<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">df<\/span> -h $part <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> -v Filesystem <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;{print $5}&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">sed<\/span> <span class=\"token string\">&#039;s\/%\/\/g&#039;<\/span><span class=\"token variable\">)<\/span><\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token variable\">$usage<\/span> -ge <span class=\"token variable\">$ALERT_THRESHOLD<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n            <span class=\"token assign-left variable\">msg<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\u3010\u78c1\u76d8\u544a\u8b66\u3011\u5206\u533a<span class=\"token variable\">$part<\/span>\u4f7f\u7528\u7387\u8fbe\u5230<span class=\"token variable\">${usage}<\/span>%&#xff0c;\u8d85\u8fc7\u9608\u503c<span class=\"token variable\">${ALERT_THRESHOLD}<\/span>%&#xff01;<br \/>\n\u5f53\u524d\u78c1\u76d8\u4f7f\u7528\u8be6\u60c5&#xff1a;<br \/>\n<span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">df<\/span> -h $part<span class=\"token variable\">)<\/span><\/span>&#034;<\/span><br \/>\n            <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$msg<\/span>&#034;<\/span> <span class=\"token operator\">|<\/span> mail -s <span class=\"token string\">&#034;\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u544a\u8b66&#034;<\/span> <span class=\"token variable\">$EMAIL<\/span><br \/>\n            <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u544a\u8b66\u5df2\u53d1\u9001&#xff1a;<span class=\"token variable\">$msg<\/span>&#034;<\/span><br \/>\n        <span class=\"token keyword\">fi<\/span><br \/>\n    <span class=\"token keyword\">done<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\"># \u68c0\u67e5inode\u4f7f\u7528\u7387<\/span><br \/>\n<span class=\"token function-name function\">check_inode_usage<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> <span class=\"token for-or-select variable\">part<\/span> <span class=\"token keyword\">in<\/span> <span class=\"token variable\">$MONITOR_PART<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">do<\/span><br \/>\n        <span class=\"token assign-left variable\">inode_usage<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">df<\/span> -i $part <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> -v Filesystem <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;{print $5}&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">sed<\/span> <span class=\"token string\">&#039;s\/%\/\/g&#039;<\/span><span class=\"token variable\">)<\/span><\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token variable\">$inode_usage<\/span> -ge <span class=\"token variable\">$INODE_THRESHOLD<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n            <span class=\"token assign-left variable\">msg<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\u3010Inode\u544a\u8b66\u3011\u5206\u533a<span class=\"token variable\">$part<\/span> inode\u4f7f\u7528\u7387\u8fbe\u5230<span class=\"token variable\">${inode_usage}<\/span>%&#xff0c;\u8d85\u8fc7\u9608\u503c<span class=\"token variable\">${INODE_THRESHOLD}<\/span>%&#xff01;<br \/>\n\u5f53\u524dinode\u4f7f\u7528\u8be6\u60c5&#xff1a;<br \/>\n<span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">df<\/span> -i $part<span class=\"token variable\">)<\/span><\/span>&#034;<\/span><br \/>\n            <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$msg<\/span>&#034;<\/span> <span class=\"token operator\">|<\/span> mail -s <span class=\"token string\">&#034;Inode\u8017\u5c3d\u544a\u8b66&#034;<\/span> <span class=\"token variable\">$EMAIL<\/span><br \/>\n            <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u544a\u8b66\u5df2\u53d1\u9001&#xff1a;<span class=\"token variable\">$msg<\/span>&#034;<\/span><br \/>\n        <span class=\"token keyword\">fi<\/span><br \/>\n    <span class=\"token keyword\">done<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\"># \u4e3b\u6267\u884c<\/span><br \/>\ncheck_disk_usage<br \/>\ncheck_inode_usage<\/p>\n<ul>\n<li>\u4f7f\u7528\u8bf4\u660e&#xff1a;\n<ul>\n<li>\u5b89\u88c5\u4f9d\u8d56&#xff1a;yum install -y mailx&#xff08;CentOS&#xff09;\/apt install -y mailutils&#xff08;Ubuntu&#xff09;<\/li>\n<li>\u5b9a\u65f6\u6267\u884c&#xff08;\u6bcf\u5c0f\u65f6&#xff09;&#xff1a;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span class=\"token function\">crontab<\/span> -e<br \/>\n<span class=\"token number\">0<\/span> * * * * \/bin\/bash \/usr\/local\/scripts\/disk_monitor.sh <span class=\"token operator\">&gt;<\/span> \/dev\/null <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span><span class=\"token file-descriptor important\">&amp;1<\/span><\/p>\n<h4>2.2 \u5927\u6587\u4ef6\u5feb\u901f\u6392\u67e5\u811a\u672c&#xff08;find_large_files.sh&#xff09;<\/h4>\n<p><span class=\"token shebang important\">#!\/bin\/bash<\/span><br \/>\n<span class=\"token comment\"># \u914d\u7f6e\u9879<\/span><br \/>\n<span class=\"token assign-left variable\">TARGET_DIR<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/&#034;<\/span>       <span class=\"token comment\"># \u6392\u67e5\u6839\u76ee\u5f55<\/span><br \/>\n<span class=\"token assign-left variable\">MIN_SIZE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;100M&#034;<\/span>      <span class=\"token comment\"># \u6700\u5c0f\u6587\u4ef6\u5927\u5c0f&#xff08;\u652f\u63011G\u3001500M\u7b49&#xff09;<\/span><br \/>\n<span class=\"token assign-left variable\">LOG_FILE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/tmp\/large_files_<span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">date<\/span> &#043;%Y%m%d<span class=\"token variable\">)<\/span><\/span>.log&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u68c0\u67e5\u76ee\u5f55\u6709\u6548\u6027<\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token operator\">!<\/span> -d <span class=\"token variable\">$TARGET_DIR<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u9519\u8bef&#xff1a;\u76ee\u5f55<span class=\"token variable\">$TARGET_DIR<\/span>\u4e0d\u5b58\u5728&#xff01;&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">1<\/span><br \/>\n<span class=\"token keyword\">fi<\/span><\/p>\n<p><span class=\"token comment\"># \u6392\u67e5\u5e76\u8f93\u51fa\u65e5\u5fd7<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;&#061;&#061;&#061;&#061;&#061; \u5927\u6587\u4ef6\u6392\u67e5\u7ed3\u679c&#xff08;<span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">date<\/span><span class=\"token variable\">)<\/span><\/span>&#xff09;&#061;&#061;&#061;&#061;&#061;&#034;<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token variable\">$LOG_FILE<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u6392\u67e5\u76ee\u5f55&#xff1a;<span class=\"token variable\">$TARGET_DIR<\/span>&#xff0c;\u6700\u5c0f\u6587\u4ef6\u5927\u5c0f&#xff1a;<span class=\"token variable\">$MIN_SIZE<\/span>&#034;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> <span class=\"token variable\">$LOG_FILE<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#034;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> <span class=\"token variable\">$LOG_FILE<\/span><br \/>\n<span class=\"token function\">find<\/span> <span class=\"token variable\">$TARGET_DIR<\/span> -type f -size &#043;<span class=\"token variable\">$MIN_SIZE<\/span> -exec <span class=\"token function\">ls<\/span> -lh <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">}<\/span> <span class=\"token punctuation\">;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;{print $5, $9}&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">sort<\/span> -hr <span class=\"token operator\">&gt;&gt;<\/span> <span class=\"token variable\">$LOG_FILE<\/span><\/p>\n<p><span class=\"token comment\"># \u7edf\u8ba1\u6587\u4ef6\u6570\u91cf<\/span><br \/>\n<span class=\"token assign-left variable\">total<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">wc<\/span> -l $LOG_FILE <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;{print $1 &#8211; 4}&#039;<\/span><span class=\"token variable\">)<\/span><\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#034;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> <span class=\"token variable\">$LOG_FILE<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u5171\u627e\u5230<span class=\"token variable\">$total<\/span>\u4e2a\u5927\u4e8e<span class=\"token variable\">$MIN_SIZE<\/span>\u7684\u6587\u4ef6&#034;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> <span class=\"token variable\">$LOG_FILE<\/span><\/p>\n<p><span class=\"token comment\"># \u5c4f\u5e55\u8f93\u51fa\u63d0\u793a<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u6392\u67e5\u5b8c\u6210&#xff01;\u7ed3\u679c\u5df2\u4fdd\u5b58\u5230&#xff1a;<span class=\"token variable\">$LOG_FILE<\/span>&#034;<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u524d10\u4e2a\u6700\u5927\u6587\u4ef6&#xff1a;&#034;<\/span><br \/>\n<span class=\"token function\">head<\/span> -14 <span class=\"token variable\">$LOG_FILE<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">tail<\/span> -10<\/p>\n<ul>\n<li>\u4f7f\u7528\u8bf4\u660e&#xff1a;\n<ul>\n<li>\u8d4b\u4e88\u6267\u884c\u6743\u9650&#xff1a;chmod &#043;x find_large_files.sh<\/li>\n<li>\u5b9a\u65f6\u6267\u884c&#xff08;\u6bcf\u5468\u65e5\u51cc\u66682\u70b9&#xff09;&#xff1a;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span class=\"token function\">crontab<\/span> -e<br \/>\n<span class=\"token number\">0<\/span> <span class=\"token number\">2<\/span> * * <span class=\"token number\">0<\/span> \/bin\/bash \/usr\/local\/scripts\/find_large_files.sh <span class=\"token operator\">&gt;<\/span> \/dev\/null <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span><span class=\"token file-descriptor important\">&amp;1<\/span><\/p>\n<h3>\u4e09\u3001\u8fd0\u7ef4\u62d3\u5c55&#xff08;\u9884\u9632\u5927\u4e8e\u6cbb\u7406&#xff09;<\/h3>\n<h4>3.1 \u65e5\u5fd7\u8f6e\u8f6c&#xff08;logrotate&#xff09;\u914d\u7f6e<\/h4>\n<ul>\n<li>\u914d\u7f6e\u793a\u4f8b&#xff08;Nginx&#xff09;&#xff1a;\/etc\/logrotate.d\/nginx<\/li>\n<\/ul>\n<p>\/var\/log\/nginx\/*.log {<br \/>\n    daily       # \u6bcf\u5929\u8f6e\u8f6c<br \/>\n    rotate 7    # \u4fdd\u75597\u5929\u65e5\u5fd7<br \/>\n    compress    # \u538b\u7f29\u65e7\u65e5\u5fd7<br \/>\n    delaycompress  # \u5ef6\u8fdf\u538b\u7f29\u5199\u5165\u4e2d\u7684\u65e5\u5fd7<br \/>\n    missingok   # \u65e5\u5fd7\u4e0d\u5b58\u5728\u65f6\u4e0d\u62a5\u9519<br \/>\n    notifempty  # \u7a7a\u65e5\u5fd7\u4e0d\u8f6e\u8f6c<br \/>\n    create 0644 nginx nginx  # \u65b0\u5efa\u65e5\u5fd7\u6743\u9650\/\u5c5e\u4e3b<br \/>\n    postrotate  # \u8f6e\u8f6c\u540e\u91cd\u8f7dNginx<br \/>\n        systemctl reload nginx<br \/>\n    endscript<br \/>\n}<\/p>\n<h4>3.2 \u76d1\u63a7\u4f53\u7cfb\u642d\u5efa<\/h4>\n<ul>\n<li>\u57fa\u7840\u76d1\u63a7\u5de5\u5177&#xff1a;Zabbix \/ Prometheus&#043;Grafana<\/li>\n<li>\u6838\u5fc3\u76d1\u63a7\u6307\u6807&#xff1a;\n<ul>\n<li>node_filesystem_usage_percent&#xff08;\u78c1\u76d8\u4f7f\u7528\u7387&#xff09;<\/li>\n<li>node_filesystem_inodes_used_percent&#xff08;inode\u4f7f\u7528\u7387&#xff09;<\/li>\n<\/ul>\n<\/li>\n<li>\u544a\u8b66\u9608\u503c&#xff1a;\n<ul>\n<li>\u666e\u901a\u544a\u8b66&#xff1a;\u4f7f\u7528\u7387\u226580%<\/li>\n<li>\u7d27\u6025\u544a\u8b66&#xff1a;\u4f7f\u7528\u7387\u226590%<\/li>\n<\/ul>\n<\/li>\n<li>\u544a\u8b66\u6e20\u9053&#xff1a;\u90ae\u4ef6\u3001\u9489\u9489\u3001\u4f01\u4e1a\u5fae\u4fe1<\/li>\n<\/ul>\n<h4>3.3 \u5206\u533a\u89c4\u5212\u6700\u4f73\u5b9e\u8df5<\/h4>\n<ul>\n<li>\u6839\u5206\u533a&#xff08;\/&#xff09;&#xff1a;\u81f3\u5c1150G&#xff0c;\u907f\u514d\u7cfb\u7edf\u6587\u4ef6\u5360\u6ee1<\/li>\n<li>\u6570\u636e\u5206\u533a&#xff08;\/data\u3001\/var\/lib\/mysql&#xff09;&#xff1a;\u5355\u72ec\u5206\u533a&#xff0c;\u4fbf\u4e8e\u6269\u5bb9<\/li>\n<li>\u5206\u533a\u7c7b\u578b&#xff1a;\u4f18\u5148\u4f7f\u7528LVM&#xff0c;\u652f\u6301\u5728\u7ebf\u6269\u5bb9&#xff0c;\u65e0\u9700\u505c\u673a<\/li>\n<\/ul>\n<h3>\u56db\u3001\u6838\u5fc3\u603b\u7ed3<\/h3>\n<ul>\n<li>\u6392\u67e5\u6838\u5fc3&#xff1a;\u5148\u901a\u8fc7df -h\/df -i\u5b9a\u4f4d\u5f02\u5e38\u5206\u533a&#xff0c;\u518d\u7528du\/find\u627e\u5927\u6587\u4ef6&#xff0c;\u91cd\u70b9\u6392\u67e5lsof | grep deleted&#xff08;\u5df2\u5220\u672a\u91ca\u653e\u6587\u4ef6&#xff09;<\/li>\n<li>\u6e05\u7406\u539f\u5219&#xff1a;\u7528truncate\u6e05\u7a7a\u65e5\u5fd7\u800c\u975erm\u5220\u9664&#xff0c;\u907f\u514d\u7a0b\u5e8f\u53e5\u67c4\u5931\u6548<\/li>\n<li>\u9884\u9632\u5173\u952e&#xff1a;\u65e5\u5fd7\u8f6e\u8f6c&#043;\u5b9a\u65f6\u6e05\u7406&#043;\u76d1\u63a7\u544a\u8b66&#xff0c;LVM\u5206\u533a\u662f\u6269\u5bb9\u6700\u4f18\u9009\u62e9<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u95ee\u9898\u5b9a\u4f4d\u4e0e\u89e3\u51b3&#xff08;\u8fd0\u7ef4\u5b9e\u6218&#xff09;<br \/>\n\u4e00\u3001\u6838\u5fc3\u6392\u67e5\u6d41\u7a0b<br \/>\n1.1 \u5168\u5c40\u67e5\u770b\u78c1\u76d8\u4f7f\u7528\u6982\u51b5<br \/>\n\u6838\u5fc3\u76ee\u6807&#xff1a;\u5feb\u901f\u5b9a\u4f4d\u4f7f\u7528\u7387\u8fc7\u9ad8\u7684\u5206\u533a&#xff0c;\u540c\u65f6\u6392\u67e5inode\u8017\u5c3d\u95ee\u9898\u5173\u952e\u547d\u4ee4&#xff1a;<br \/>\n# \u4ee5\u4eba\u7c7b\u53ef\u8bfb\u683c\u5f0f\u67e5\u770b\u5404\u5206\u533a\u7a7a\u95f4<br \/>\ndf -h<br \/>\n# \u67e5\u770b\u5404\u5206\u533ainode\u4f7f\u7528\u60c5\u51b5<br \/>\ndf -i<br \/>\n# \u67e5\u770b\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b&#xff08;\u5f71\u54cd\u6269\u5bb9\u547d\u4ee4&#xff09;<br \/>\ndf -T\u8f93\u51fa\u8bf4\u660e&#xff1a;\u91cd\u70b9\u5173\u6ce8\u4f7f\u7528\u7387%\u5217&#xff0c;\u6839\u5206\u533a&#xff08;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[130,87,44],"topic":[],"class_list":["post-69024","post","type-post","status-publish","format-standard","hentry","category-server","tag-chrome","tag-87","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u95ee\u9898\u5b9a\u4f4d\u4e0e\u89e3\u51b3\uff08\u8fd0\u7ef4\u5b9e\u6218\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/69024.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u95ee\u9898\u5b9a\u4f4d\u4e0e\u89e3\u51b3\uff08\u8fd0\u7ef4\u5b9e\u6218\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u95ee\u9898\u5b9a\u4f4d\u4e0e\u89e3\u51b3&#xff08;\u8fd0\u7ef4\u5b9e\u6218&#xff09; \u4e00\u3001\u6838\u5fc3\u6392\u67e5\u6d41\u7a0b 1.1 \u5168\u5c40\u67e5\u770b\u78c1\u76d8\u4f7f\u7528\u6982\u51b5 \u6838\u5fc3\u76ee\u6807&#xff1a;\u5feb\u901f\u5b9a\u4f4d\u4f7f\u7528\u7387\u8fc7\u9ad8\u7684\u5206\u533a&#xff0c;\u540c\u65f6\u6392\u67e5inode\u8017\u5c3d\u95ee\u9898\u5173\u952e\u547d\u4ee4&#xff1a; # \u4ee5\u4eba\u7c7b\u53ef\u8bfb\u683c\u5f0f\u67e5\u770b\u5404\u5206\u533a\u7a7a\u95f4 df -h # \u67e5\u770b\u5404\u5206\u533ainode\u4f7f\u7528\u60c5\u51b5 df -i # \u67e5\u770b\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b&#xff08;\u5f71\u54cd\u6269\u5bb9\u547d\u4ee4&#xff09; df -T\u8f93\u51fa\u8bf4\u660e&#xff1a;\u91cd\u70b9\u5173\u6ce8\u4f7f\u7528\u7387%\u5217&#xff0c;\u6839\u5206\u533a&#xff08;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/69024.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-30T18:24:51+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/69024.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/69024.html\",\"name\":\"\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u95ee\u9898\u5b9a\u4f4d\u4e0e\u89e3\u51b3\uff08\u8fd0\u7ef4\u5b9e\u6218\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-30T18:24:51+00:00\",\"dateModified\":\"2026-01-30T18:24:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/69024.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/69024.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/69024.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u95ee\u9898\u5b9a\u4f4d\u4e0e\u89e3\u51b3\uff08\u8fd0\u7ef4\u5b9e\u6218\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u95ee\u9898\u5b9a\u4f4d\u4e0e\u89e3\u51b3\uff08\u8fd0\u7ef4\u5b9e\u6218\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/69024.html","og_locale":"zh_CN","og_type":"article","og_title":"\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u95ee\u9898\u5b9a\u4f4d\u4e0e\u89e3\u51b3\uff08\u8fd0\u7ef4\u5b9e\u6218\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u95ee\u9898\u5b9a\u4f4d\u4e0e\u89e3\u51b3&#xff08;\u8fd0\u7ef4\u5b9e\u6218&#xff09; \u4e00\u3001\u6838\u5fc3\u6392\u67e5\u6d41\u7a0b 1.1 \u5168\u5c40\u67e5\u770b\u78c1\u76d8\u4f7f\u7528\u6982\u51b5 \u6838\u5fc3\u76ee\u6807&#xff1a;\u5feb\u901f\u5b9a\u4f4d\u4f7f\u7528\u7387\u8fc7\u9ad8\u7684\u5206\u533a&#xff0c;\u540c\u65f6\u6392\u67e5inode\u8017\u5c3d\u95ee\u9898\u5173\u952e\u547d\u4ee4&#xff1a; # \u4ee5\u4eba\u7c7b\u53ef\u8bfb\u683c\u5f0f\u67e5\u770b\u5404\u5206\u533a\u7a7a\u95f4 df -h # \u67e5\u770b\u5404\u5206\u533ainode\u4f7f\u7528\u60c5\u51b5 df -i # \u67e5\u770b\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b&#xff08;\u5f71\u54cd\u6269\u5bb9\u547d\u4ee4&#xff09; df -T\u8f93\u51fa\u8bf4\u660e&#xff1a;\u91cd\u70b9\u5173\u6ce8\u4f7f\u7528\u7387%\u5217&#xff0c;\u6839\u5206\u533a&#xff08;","og_url":"https:\/\/www.wsisp.com\/helps\/69024.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-30T18:24:51+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/69024.html","url":"https:\/\/www.wsisp.com\/helps\/69024.html","name":"\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u95ee\u9898\u5b9a\u4f4d\u4e0e\u89e3\u51b3\uff08\u8fd0\u7ef4\u5b9e\u6218\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-30T18:24:51+00:00","dateModified":"2026-01-30T18:24:51+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/69024.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/69024.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/69024.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u95ee\u9898\u5b9a\u4f4d\u4e0e\u89e3\u51b3\uff08\u8fd0\u7ef4\u5b9e\u6218\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/69024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=69024"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/69024\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=69024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=69024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=69024"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=69024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}