{"id":15278,"date":"2022-10-03T12:58:08","date_gmt":"2022-10-03T04:58:08","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=15278"},"modified":"2022-10-03T12:58:40","modified_gmt":"2022-10-03T04:58:40","slug":"linux-inode-record","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-inode-record.html","title":{"rendered":"Linux\u4e0b\u7684inode\u8bb0\u5f55"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u6587\u4ef6\u50a8\u5b58\u5728\u786c\u76d8\u4e0a\uff0c\u786c\u76d8\u7684\u6700\u5c0f\u5b58\u50a8\u5355\u4f4d\u53eb\u505a\"\u6247\u533a\"\uff08Sector\uff09\u3002\u6bcf\u4e2a\u6247\u533a\u50a8\u5b58512\u5b57\u8282\uff08\u76f8\u5f53\u4e8e0.5KB\uff09\u3002\u64cd\u4f5c\u7cfb\u7edf\u8bfb\u53d6\u786c\u76d8\u7684\u65f6\u5019\uff0c\u4e0d\u4f1a\u4e00\u4e2a\u4e2a\u6247\u533a\u5730\u8bfb\u53d6\uff0c\u8fd9\u6837\u6548\u7387\u592a\u4f4e\uff0c\u800c\u662f\u4e00\u6b21\u6027\u8fde\u7eed\u8bfb\u53d6\u591a\u4e2a\u6247\u533a\uff0c\u5373\u4e00\u6b21\u6027\u8bfb\u53d6\u4e00\u4e2a\"\u5757\"\uff08block\uff09\u3002\u8fd9\u79cd\u7531\u591a\u4e2a\u6247\u533a\u7ec4\u6210\u7684\"\u5757\"\uff0c\u662f\u6587\u4ef6\u5b58\u53d6\u7684\u6700\u5c0f\u5355\u4f4d\u3002\"\u5757\"\u7684\u5927\u5c0f\uff0c\u6700\u5e38\u89c1\u7684\u662f4KB\uff0c\u5373\u8fde\u7eed\u516b\u4e2a sector\u7ec4\u6210\u4e00\u4e2ablock\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\u78c1\u76d8\"<\/p>\n

\u6587\u4ef6\u6570\u636e\u90fd\u50a8\u5b58\u5728\"\u5757\"\u4e2d\uff0c\u90a3\u4e48\u5f88\u663e\u7136\uff0c\u6211\u4eec\u8fd8\u5fc5\u987b\u627e\u5230\u4e00\u4e2a\u5730\u65b9\u50a8\u5b58\u6587\u4ef6\u7684\u5143\u4fe1\u606f\uff0c\u6bd4\u5982\u6587\u4ef6\u7684\u521b\u5efa\u8005\u3001\u6587\u4ef6\u7684\u521b\u5efa\u65e5\u671f\u3001\u6587\u4ef6\u7684\u5927\u5c0f\u7b49\u7b49\u3002\u8fd9\u79cd\u50a8\u5b58\u6587\u4ef6\u5143\u4fe1\u606f\u7684\u533a\u57df\u5c31\u53eb\u505ainode\uff0c\u4e2d\u6587\u8bd1\u540d\u4e3a\"\u7d22\u5f15\u8282\u70b9\"\u3002<\/p>\n

inode\u7684\u5185\u5bb9<\/strong><\/div>\n

inode\u5305\u542b\u6587\u4ef6\u7684\u5143\u4fe1\u606f\uff0c\u5177\u4f53\u6765\u8bf4\u6709\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n

* \u6587\u4ef6\u7684\u5b57\u8282\u6570<\/p>\n

* \u6587\u4ef6\u62e5\u6709\u8005\u7684User ID<\/p>\n

* \u6587\u4ef6\u7684Group ID<\/p>\n

* \u6587\u4ef6\u7684\u8bfb\u3001\u5199\u3001\u6267\u884c\u6743\u9650<\/p>\n

* \u6587\u4ef6\u7684\u65f6\u95f4\u6233\uff0c\u5171\u6709\u4e09\u4e2a\uff1actime\u6307inode\u4e0a\u4e00\u6b21\u53d8\u52a8\u7684\u65f6\u95f4\uff0cmtime\u6307\u6587\u4ef6\u5185\u5bb9\u4e0a\u4e00\u6b21\u53d8\u52a8\u7684\u65f6\u95f4\uff0catime\u6307\u6587\u4ef6\u4e0a\u4e00\u6b21\u6253\u5f00\u7684\u65f6\u95f4\u3002<\/p>\n

* \u94fe\u63a5\u6570\uff0c\u5373\u6709\u591a\u5c11\u6587\u4ef6\u540d\u6307\u5411\u8fd9\u4e2ainode<\/p>\n

* \u6587\u4ef6\u6570\u636eblock\u7684\u4f4d\u7f6e<\/p>\n

\u53ef\u4ee5\u7528stat\u547d\u4ee4\uff0c\u67e5\u770b\u67d0\u4e2a\u6587\u4ef6\u7684inode\u4fe1\u606f\uff1a<\/p>\n

stat example.txt<\/pre>\n

\u603b\u4e4b\uff0c\u9664\u4e86\u6587\u4ef6\u540d\u4ee5\u5916\u7684\u6240\u6709\u6587\u4ef6\u4fe1\u606f\uff0c\u90fd\u5b58\u5728inode\u4e4b\u4e2d\u3002\u81f3\u4e8e\u4e3a\u4ec0\u4e48\u6ca1\u6709\u6587\u4ef6\u540d\uff0c\u4e0b\u6587\u4f1a\u6709\u8be6\u7ec6\u89e3\u91ca\u3002
\n\"\u786c\u76d8\"<\/p>\n

inode\u7684\u5927\u5c0f<\/strong><\/div>\n

inode\u4e5f\u4f1a\u6d88\u8017\u786c\u76d8\u7a7a\u95f4\uff0c\u6240\u4ee5\u786c\u76d8\u683c\u5f0f\u5316\u7684\u65f6\u5019\uff0c\u64cd\u4f5c\u7cfb\u7edf\u81ea\u52a8\u5c06\u786c\u76d8\u5206\u6210\u4e24\u4e2a\u533a\u57df\u3002\u4e00\u4e2a\u662f\u6570\u636e\u533a\uff0c\u5b58\u653e\u6587\u4ef6\u6570\u636e\uff1b\u53e6\u4e00\u4e2a\u662finode\u533a\uff08inode table\uff09\uff0c\u5b58\u653einode\u6240\u5305\u542b\u7684\u4fe1\u606f\u3002<\/p>\n

\u6bcf \u4e2ainode\u8282\u70b9\u7684\u5927\u5c0f\uff0c\u4e00\u822c\u662f128\u5b57\u8282\u6216256\u5b57\u8282\u3002inode\u8282\u70b9\u7684\u603b\u6570\uff0c\u5728\u683c\u5f0f\u5316\u65f6\u5c31\u7ed9\u5b9a\uff0c\u4e00\u822c\u662f\u6bcf1KB\u6216\u6bcf2KB\u5c31\u8bbe\u7f6e\u4e00\u4e2ainode\u3002\u5047\u5b9a \u5728\u4e00\u57571GB\u7684\u786c\u76d8\u4e2d\uff0c\u6bcf\u4e2ainode\u8282\u70b9\u7684\u5927\u5c0f\u4e3a128\u5b57\u8282\uff0c\u6bcf1KB\u5c31\u8bbe\u7f6e\u4e00\u4e2ainode\uff0c\u90a3\u4e48inode table\u7684\u5927\u5c0f\u5c31\u4f1a\u8fbe\u5230128MB\uff0c\u5360\u6574\u5757\u786c\u76d8\u768412.8%\u3002<\/p>\n

\u67e5\u770b\u6bcf\u4e2a\u786c\u76d8\u5206\u533a\u7684inode\u603b\u6570\u548c\u5df2\u7ecf\u4f7f\u7528\u7684\u6570\u91cf\uff0c\u53ef\u4ee5\u4f7f\u7528df\u547d\u4ee4\u3002<\/p>\n

df -i<\/pre>\n

\u67e5\u770b\u6bcf\u4e2ainode\u8282\u70b9\u7684\u5927\u5c0f\uff0c\u53ef\u4ee5\u7528\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n

sudo dumpe2fs -h \/dev\/hda | grep \"Inode size\"<\/pre>\n

\u7531\u4e8e\u6bcf\u4e2a\u6587\u4ef6\u90fd\u5fc5\u987b\u6709\u4e00\u4e2ainode\uff0c\u56e0\u6b64\u6709\u53ef\u80fd\u53d1\u751finode\u5df2\u7ecf\u7528\u5149\uff0c\u4f46\u662f\u786c\u76d8\u8fd8\u672a\u5b58\u6ee1\u7684\u60c5\u51b5\u3002\u8fd9\u65f6\uff0c\u5c31\u65e0\u6cd5\u5728\u786c\u76d8\u4e0a\u521b\u5efa\u65b0\u6587\u4ef6\u3002<\/p>\n

inode\u53f7\u7801<\/strong><\/div>\n

\"\u53f7\u7801\"<\/p>\n

\u6bcf\u4e2ainode\u90fd\u6709\u4e00\u4e2a\u53f7\u7801\uff0c\u64cd\u4f5c\u7cfb\u7edf\u7528inode\u53f7\u7801\u6765\u8bc6\u522b\u4e0d\u540c\u7684\u6587\u4ef6\u3002<\/p>\n

\u8fd9 \u91cc\u503c\u5f97\u91cd\u590d\u4e00\u904d\uff0cUnix\/Linux\u7cfb\u7edf\u5185\u90e8\u4e0d\u4f7f\u7528\u6587\u4ef6\u540d\uff0c\u800c\u4f7f\u7528inode\u53f7\u7801\u6765\u8bc6\u522b\u6587\u4ef6\u3002\u5bf9\u4e8e\u7cfb\u7edf\u6765\u8bf4\uff0c\u6587\u4ef6\u540d\u53ea\u662finode\u53f7\u7801\u4fbf\u4e8e\u8bc6\u522b\u7684\u522b\u79f0\u6216 \u8005\u7ef0\u53f7\u3002\u8868\u9762\u4e0a\uff0c\u7528\u6237\u901a\u8fc7\u6587\u4ef6\u540d\uff0c\u6253\u5f00\u6587\u4ef6\u3002\u5b9e\u9645\u4e0a\uff0c\u7cfb\u7edf\u5185\u90e8\u8fd9\u4e2a\u8fc7\u7a0b\u5206\u6210\u4e09\u6b65\uff1a\u9996\u5148\uff0c\u7cfb\u7edf\u627e\u5230\u8fd9\u4e2a\u6587\u4ef6\u540d\u5bf9\u5e94\u7684inode\u53f7\u7801\uff1b\u5176\u6b21\uff0c\u901a\u8fc7inode\u53f7 \u7801\uff0c\u83b7\u53d6inode\u4fe1\u606f\uff1b\u6700\u540e\uff0c\u6839\u636einode\u4fe1\u606f\uff0c\u627e\u5230\u6587\u4ef6\u6570\u636e\u6240\u5728\u7684block\uff0c\u8bfb\u51fa\u6570\u636e\u3002<\/p>\n

\u4f7f\u7528ls -i\u547d\u4ee4\uff0c\u53ef\u4ee5\u770b\u5230\u6587\u4ef6\u540d\u5bf9\u5e94\u7684inode\u53f7\u7801\uff1a<\/p>\n

ls -i example.txt<\/pre>\n
\u76ee\u5f55\u6587\u4ef6<\/strong><\/div>\n

Unix\/Linux\u7cfb\u7edf\u4e2d\uff0c\u76ee\u5f55\uff08directory\uff09\u4e5f\u662f\u4e00\u79cd\u6587\u4ef6\u3002\u6253\u5f00\u76ee\u5f55\uff0c\u5b9e\u9645\u4e0a\u5c31\u662f\u6253\u5f00\u76ee\u5f55\u6587\u4ef6\u3002<\/p>\n

\u76ee\u5f55\u6587\u4ef6\u7684\u7ed3\u6784\u975e\u5e38\u7b80\u5355\uff0c\u5c31\u662f\u4e00\u7cfb\u5217\u76ee\u5f55\u9879\uff08dirent\uff09\u7684\u5217\u8868\u3002\u6bcf\u4e2a\u76ee\u5f55\u9879\uff0c\u7531\u4e24\u90e8\u5206\u7ec4\u6210\uff1a\u6240\u5305\u542b\u6587\u4ef6\u7684\u6587\u4ef6\u540d\uff0c\u4ee5\u53ca\u8be5\u6587\u4ef6\u540d\u5bf9\u5e94\u7684inode\u53f7\u7801\u3002<\/p>\n

ls\u547d\u4ee4\u53ea\u5217\u51fa\u76ee\u5f55\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u540d\uff1a<\/p>\n

ls \/etc<\/pre>\n

ls -i\u547d\u4ee4\u5217\u51fa\u6574\u4e2a\u76ee\u5f55\u6587\u4ef6\uff0c\u5373\u6587\u4ef6\u540d\u548cinode\u53f7\u7801\uff1a<\/p>\n

ls -i \/etc<\/pre>\n

\u5982\u679c\u8981\u67e5\u770b\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5c31\u5fc5\u987b\u6839\u636einode\u53f7\u7801\uff0c\u8bbf\u95eeinode\u8282\u70b9\uff0c\u8bfb\u53d6\u4fe1\u606f\u3002ls -l\u547d\u4ee4\u5217\u51fa\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n

ls -l \/etc<\/pre>\n
\u786c\u94fe\u63a5<\/strong><\/div>\n

\u4e00 \u822c\u60c5\u51b5\u4e0b\uff0c\u6587\u4ef6\u540d\u548cinode\u53f7\u7801\u662f\"\u4e00\u4e00\u5bf9\u5e94\"\u5173\u7cfb\uff0c\u6bcf\u4e2ainode\u53f7\u7801\u5bf9\u5e94\u4e00\u4e2a\u6587\u4ef6\u540d\u3002\u4f46\u662f\uff0cUnix\/Linux\u7cfb\u7edf\u5141\u8bb8\uff0c\u591a\u4e2a\u6587\u4ef6\u540d\u6307\u5411\u540c\u4e00\u4e2a inode\u53f7\u7801\u3002\u8fd9\u610f\u5473\u7740\uff0c\u53ef\u4ee5\u7528\u4e0d\u540c\u7684\u6587\u4ef6\u540d\u8bbf\u95ee\u540c\u6837\u7684\u5185\u5bb9\uff1b\u5bf9\u6587\u4ef6\u5185\u5bb9\u8fdb\u884c\u4fee\u6539\uff0c\u4f1a\u5f71\u54cd\u5230\u6240\u6709\u6587\u4ef6\u540d\uff1b\u4f46\u662f\uff0c\u5220\u9664\u4e00\u4e2a\u6587\u4ef6\u540d\uff0c\u4e0d\u5f71\u54cd\u53e6\u4e00\u4e2a\u6587\u4ef6\u540d\u7684\u8bbf \u95ee\u3002\u8fd9\u79cd\u60c5\u51b5\u5c31\u88ab\u79f0\u4e3a\"\u786c\u94fe\u63a5\"\uff08hard link\uff09\u3002<\/p>\n

ln\u547d\u4ee4\u53ef\u4ee5\u521b\u5efa\u786c\u94fe\u63a5\uff1a<\/p>\n

ln \u6e90\u6587\u4ef6 \u76ee\u6807\u6587\u4ef6<\/pre>\n

\u8fd0 \u884c\u4e0a\u9762\u8fd9\u6761\u547d\u4ee4\u4ee5\u540e\uff0c\u6e90\u6587\u4ef6\u4e0e\u76ee\u6807\u6587\u4ef6\u7684inode\u53f7\u7801\u76f8\u540c\uff0c\u90fd\u6307\u5411\u540c\u4e00\u4e2ainode\u3002inode\u4fe1\u606f\u4e2d\u6709\u4e00\u9879\u53eb\u505a\"\u94fe\u63a5\u6570\"\uff0c\u8bb0\u5f55\u6307\u5411\u8be5inode\u7684\u6587 \u4ef6\u540d\u603b\u6570\uff0c\u8fd9\u65f6\u5c31\u4f1a\u589e\u52a01\u3002\u53cd\u8fc7\u6765\uff0c\u5220\u9664\u4e00\u4e2a\u6587\u4ef6\u540d\uff0c\u5c31\u4f1a\u4f7f\u5f97inode\u8282\u70b9\u4e2d\u7684\"\u94fe\u63a5\u6570\"\u51cf1\u3002\u5f53\u8fd9\u4e2a\u503c\u51cf\u52300\uff0c\u8868\u660e\u6ca1\u6709\u6587\u4ef6\u540d\u6307\u5411\u8fd9\u4e2ainode\uff0c\u7cfb \u7edf\u5c31\u4f1a\u56de\u6536\u8fd9\u4e2ainode\u53f7\u7801\uff0c\u4ee5\u53ca\u5176\u6240\u5bf9\u5e94block\u533a\u57df\u3002<\/p>\n

\u8fd9\u91cc\u987a\u4fbf\u8bf4\u4e00\u4e0b\u76ee\u5f55\u6587\u4ef6\u7684\"\u94fe\u63a5\u6570\"\u3002\u521b\u5efa\u76ee\u5f55\u65f6\uff0c \u9ed8\u8ba4\u4f1a\u751f\u6210\u4e24\u4e2a\u76ee\u5f55\u9879\uff1a\".\"\u548c\"..\"\u3002\u524d\u8005\u7684inode\u53f7\u7801\u5c31\u662f\u5f53\u524d\u76ee\u5f55\u7684inode\u53f7\u7801\uff0c\u7b49\u540c\u4e8e\u5f53\u524d\u76ee\u5f55\u7684\"\u786c\u94fe\u63a5\"\uff1b\u540e\u8005\u7684inode\u53f7\u7801\u5c31\u662f\u5f53 \u524d\u76ee\u5f55\u7684\u7236\u76ee\u5f55\u7684inode\u53f7\u7801\uff0c\u7b49\u540c\u4e8e\u7236\u76ee\u5f55\u7684\"\u786c\u94fe\u63a5\"\u3002\u6240\u4ee5\uff0c\u4efb\u4f55\u4e00\u4e2a\u76ee\u5f55\u7684\"\u786c\u94fe\u63a5\"\u603b\u6570\uff0c\u603b\u662f\u7b49\u4e8e2\u52a0\u4e0a\u5b83\u7684\u5b50\u76ee\u5f55\u603b\u6570\uff08\u542b\u9690\u85cf\u76ee\u5f55\uff09,\u8fd9\u91cc\u7684 2\u662f\u7236\u76ee\u5f55\u5bf9\u5176\u7684\u201c\u786c\u94fe\u63a5\u201d\u548c\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\".\u786c\u94fe\u63a5\u201c\u3002<\/p>\n

\"\u8fde\u63a5\"<\/p>\n

\u8f6f\u94fe\u63a5<\/strong><\/div>\n

\u9664\u4e86\u786c\u94fe\u63a5\u4ee5\u5916\uff0c\u8fd8\u6709 \u4e00\u79cd\u7279\u6b8a\u60c5\u51b5\u3002\u6587\u4ef6A\u548c\u6587\u4ef6B\u7684inode\u53f7\u7801\u867d\u7136\u4e0d\u4e00\u6837\uff0c\u4f46\u662f\u6587\u4ef6A\u7684\u5185\u5bb9\u662f\u6587\u4ef6B\u7684\u8def\u5f84\u3002\u8bfb\u53d6\u6587\u4ef6A\u65f6\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u5c06\u8bbf\u95ee\u8005\u5bfc\u5411\u6587\u4ef6B\u3002\u56e0\u6b64\uff0c\u65e0\u8bba\u6253 \u5f00\u54ea\u4e00\u4e2a\u6587\u4ef6\uff0c\u6700\u7ec8\u8bfb\u53d6\u7684\u90fd\u662f\u6587\u4ef6B\u3002\u8fd9\u65f6\uff0c\u6587\u4ef6A\u5c31\u79f0\u4e3a\u6587\u4ef6B\u7684\"\u8f6f\u94fe\u63a5\"\uff08soft link\uff09\u6216\u8005\"\u7b26\u53f7\u94fe\u63a5\uff08symbolic link\uff09\u3002<\/p>\n

\u8fd9 \u610f\u5473\u7740\uff0c\u6587\u4ef6A\u4f9d\u8d56\u4e8e\u6587\u4ef6B\u800c\u5b58\u5728\uff0c\u5982\u679c\u5220\u9664\u4e86\u6587\u4ef6B\uff0c\u6253\u5f00\u6587\u4ef6A\u5c31\u4f1a\u62a5\u9519\uff1a\"No such file or directory\"\u3002\u8fd9\u662f\u8f6f\u94fe\u63a5\u4e0e\u786c\u94fe\u63a5\u6700\u5927\u7684\u4e0d\u540c\uff1a\u6587\u4ef6A\u6307\u5411\u6587\u4ef6B\u7684\u6587\u4ef6\u540d\uff0c\u800c\u4e0d\u662f\u6587\u4ef6B\u7684inode\u53f7\u7801\uff0c\u6587\u4ef6B\u7684inode\"\u94fe\u63a5\u6570\"\u4e0d\u4f1a\u56e0\u6b64 \u53d1\u751f\u53d8\u5316\u3002<\/p>\n

ln -s\u547d\u4ee4\u53ef\u4ee5\u521b\u5efa\u8f6f\u94fe\u63a5\u3002<\/p>\n

ln -s \u6e90\u6587\u6587\u4ef6\u6216\u76ee\u5f55 \u76ee\u6807\u6587\u4ef6\u6216\u76ee\u5f55<\/p>\n

inode\u7684\u7279\u6b8a\u4f5c\u7528<\/strong><\/div>\n

\u7531\u4e8einode\u53f7\u7801\u4e0e\u6587\u4ef6\u540d\u5206\u79bb\uff0c\u8fd9\u79cd\u673a\u5236\u5bfc\u81f4\u4e86\u4e00\u4e9bUnix\/Linux\u7cfb\u7edf\u7279\u6709\u7684\u73b0\u8c61\u3002<\/p>\n

1. \u6709\u65f6\uff0c\u6587\u4ef6\u540d\u5305\u542b\u7279\u6b8a\u5b57\u7b26\uff0c\u65e0\u6cd5\u6b63\u5e38\u5220\u9664\u3002\u8fd9\u65f6\uff0c\u76f4\u63a5\u5220\u9664inode\u8282\u70b9\uff0c\u5c31\u80fd\u8d77\u5230\u5220\u9664\u6587\u4ef6\u7684\u4f5c\u7528\u3002<\/p>\n

2. \u79fb\u52a8\u6587\u4ef6\u6216\u91cd\u547d\u540d\u6587\u4ef6\uff0c\u53ea\u662f\u6539\u53d8\u6587\u4ef6\u540d\uff0c\u4e0d\u5f71\u54cdinode\u53f7\u7801\u3002<\/p>\n

3. \u6253\u5f00\u4e00\u4e2a\u6587\u4ef6\u4ee5\u540e\uff0c\u7cfb\u7edf\u5c31\u4ee5inode\u53f7\u7801\u6765\u8bc6\u522b\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4e0d\u518d\u8003\u8651\u6587\u4ef6\u540d\u3002\u56e0\u6b64\uff0c\u901a\u5e38\u6765\u8bf4\uff0c\u7cfb\u7edf\u65e0\u6cd5\u4eceinode\u53f7\u7801\u5f97\u77e5\u6587\u4ef6\u540d\u3002<\/p>\n

\u7b2c3\u70b9\u4f7f\u5f97\u8f6f\u4ef6\u66f4\u65b0\u53d8\u5f97\u7b80\u5355\uff0c\u53ef\u4ee5\u5728\u4e0d\u5173\u95ed\u8f6f\u4ef6\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u66f4\u65b0\uff0c\u4e0d\u9700\u8981\u91cd\u542f\u3002\u56e0\u4e3a\u7cfb\u7edf\u901a\u8fc7inode\u53f7\u7801\uff0c\u8bc6\u522b\u8fd0\u884c\u4e2d\u7684\u6587\u4ef6\uff0c\u4e0d\u901a\u8fc7\u6587\u4ef6\u540d\u3002\u66f4\u65b0\u7684\u65f6 \u5019\uff0c\u65b0\u7248\u6587\u4ef6\u4ee5\u540c\u6837\u7684\u6587\u4ef6\u540d\uff0c\u751f\u6210\u4e00\u4e2a\u65b0\u7684inode\uff0c\u4e0d\u4f1a\u5f71\u54cd\u5230\u8fd0\u884c\u4e2d\u7684\u6587\u4ef6\u3002\u7b49\u5230\u4e0b\u4e00\u6b21\u8fd0\u884c\u8fd9\u4e2a\u8f6f\u4ef6\u7684\u65f6\u5019\uff0c\u6587\u4ef6\u540d\u5c31\u81ea\u52a8\u6307\u5411\u65b0\u7248\u6587\u4ef6\uff0c\u65e7\u7248\u6587\u4ef6\u7684 inode\u5219\u88ab\u56de\u6536\u3002<\/p>\n

\u5b9e\u9645\u95ee\u9898<\/strong><\/div>\n

\u5728\u4e00\u53f0\u914d\u7f6e\u8f83\u4f4e\u7684Linux\u670d\u52a1\u5668\uff08\u5185\u5b58\u3001\u786c\u76d8\u6bd4\u8f83\u5c0f\uff09\u7684\/data\u5206\u533a\u5185\u521b\u5efa\u6587\u4ef6\u65f6\uff0c\u7cfb\u7edf\u63d0\u793a\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\uff0c\u7528df -h\u547d\u4ee4\u67e5\u770b\u4e86\u4e00\u4e0b\u78c1\u76d8\u4f7f\u7528\u60c5\u51b5\uff0c\u53d1\u73b0\/data\u5206\u533a\u53ea\u4f7f\u7528\u4e8666%\uff0c\u8fd8\u670912G\u7684\u5269\u4f59\u7a7a\u95f4\uff0c\u6309\u7406\u8bf4\u4e0d\u4f1a\u51fa\u73b0\u8fd9\u79cd\u95ee\u9898\u3002 \u540e\u6765\u7528df -i\u67e5\u770b\u4e86\u4e00\u4e0b\/data\u5206\u533a\u7684\u7d22\u5f15\u8282\u70b9(inode)\uff0c\u53d1\u73b0\u5df2\u7ecf\u7528\u6ee1(IUsed=100%)\uff0c\u5bfc\u81f4\u7cfb\u7edf\u65e0\u6cd5\u521b\u5efa\u65b0\u76ee\u5f55\u548c\u6587\u4ef6\u3002<\/p>\n

\u67e5\u627e\u539f\u56e0\uff1a<\/p>\n

\/data\/cache\u76ee\u5f55\u4e2d\u5b58\u5728\u6570\u91cf\u975e\u5e38\u591a\u7684\u5c0f\u5b57\u8282\u7f13\u5b58\u6587\u4ef6\uff0c\u5360\u7528\u7684Block\u4e0d\u591a\uff0c\u4f46\u662f\u5360\u7528\u4e86\u5927\u91cf\u7684inode\u3002<\/p>\n

\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n

1\u3001\u5220\u9664\/data\/cache\u76ee\u5f55\u4e2d\u7684\u90e8\u5206\u6587\u4ef6\uff0c\u91ca\u653e\u51fa\/data\u5206\u533a\u7684\u4e00\u90e8\u5206inode\u3002<\/p>\n

2\u3001\u7528\u8f6f\u8fde\u63a5\u5c06\u7a7a\u95f2\u5206\u533a\/opt\u4e2d\u7684newcache\u76ee\u5f55\u8fde\u63a5\u5230\/data\/cache\uff0c\u4f7f\u7528\/opt\u5206\u533a\u7684inode\u6765\u7f13\u89e3\/data\u5206\u533ainode\u4e0d\u8db3\u7684\u95ee\u9898\uff1a<\/p>\n

ln -s \/opt\/newcache \/data\/cache<\/pre>\n
\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/blog.chinaunix.net\/uid-7573623-id-2048961.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/linux-inode-record.html<\/a>\u7f16\u8f91\uff1a\u82cf\u897f\u4e91\uff0c\u5ba1\u6838\u5458\uff1a\u51af\u632f\u534e<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u6587\u4ef6\u50a8\u5b58\u5728\u786c\u76d8\u4e0a\uff0c\u786c\u76d8\u7684\u6700\u5c0f\u5b58\u50a8\u5355\u4f4d\u53eb\u505a”\u6247\u533a”\uff08Sector\uff09\u3002\u6bcf\u4e2a\u6247\u533a\u50a8\u5b58512\u5b57\u8282\uff08\u76f8\u5f53\u4e8e0.5K […]<\/p>\n","protected":false},"author":63,"featured_media":15283,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-15278","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/15278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=15278"}],"version-history":[{"count":9,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/15278\/revisions"}],"predecessor-version":[{"id":254180,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/15278\/revisions\/254180"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/15283"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=15278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=15278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=15278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}