{"id":209407,"date":"2021-01-26T08:33:57","date_gmt":"2021-01-26T00:33:57","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=209407"},"modified":"2021-01-20T14:42:43","modified_gmt":"2021-01-20T06:42:43","slug":"du-df-diffurit","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/du-df-diffurit.html","title":{"rendered":"\u8be6\u7ec6\u5206\u6790du\u548cdf\u7684\u7edf\u8ba1\u7ed3\u679c\u4e3a\u4ec0\u4e48\u4e0d\u4e00\u6837"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4f7f\u7528du\u548cdf\u6765\u83b7\u53d6\u76ee\u5f55\u6216\u6587\u4ef6\u7cfb\u7edf\u5df2\u5360\u7528\u7a7a\u95f4\u7684\u60c5\u51b5\u3002\u4f46\u5b83\u4eec\u7684\u7edf\u8ba1\u7ed3\u679c\u662f\u4e0d\u4e00\u81f4\u7684\uff0c\u5927\u591a\u6570\u65f6\u5019\uff0c\u5b83\u4eec\u7684\u7ed3\u679c\u76f8\u5dee\u4e0d\u4f1a\u5f88\u5927\uff0c\u4f46\u6709\u65f6\u5019\u5b83\u4eec\u7684\u7edf\u8ba1\u7ed3\u679c\u4f1a\u76f8\u5dee\u975e\u5e38\u5927\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/a><\/p>\n

df\u7684\u7edf\u8ba1\u7ed3\u679c<\/strong><\/span><\/div>\n
[root@xuexi\u00a0~]#\u00a0df\u00a0-hT\r\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Type\u00a0\u00a0\u00a0Size\u00a0\u00a0Used\u00a0Avail\u00a0Use%\u00a0Mounted\u00a0on\r\n\/dev\/sda2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ext4\u00a0\u00a0\u00a0\u00a018G\u00a0\u00a01.7G\u00a0\u00a0\u00a015G\u00a0\u00a011%\u00a0\/\r\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0tmpfs\u00a0\u00a0491M\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0491M\u00a0\u00a0\u00a00%\u00a0\/dev\/shm\r\n\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ext4\u00a0\u00a0\u00a0239M\u00a0\u00a0\u00a068M\u00a0\u00a0159M\u00a0\u00a030%\u00a0\/boot\r\n\/\/192.168.0.124\/win\u00a0cifs\u00a0\u00a0\u00a0381G\u00a0\u00a0243G\u00a0\u00a0138G\u00a0\u00a064%\u00a0\/mnt\r\n<\/pre>\n
du\u5bf9\u6839\u76ee\u5f55\u7684\u7edf\u8ba1\u7ed3\u679c<\/strong><\/span><\/div>\n
[root@xuexi\u00a0~]#\u00a0du\u00a0-sh\u00a0\/\u00a0\u00a02><\/span>\/dev\/null\r\n244G\u00a0\u00a0\u00a0\u00a0\/\r\ndf\u4e2d\"\/\"\u7684\u4f7f\u7528\u7a7a\u95f4\u662f1.7G\uff0c\u4f46\u662fdu\u7684\u7ed3\u679c\u5374\u662f244G\u3002\u8fd9\u91ccdu\u7684\u7edf\u8ba1\u7ed3\u679c\u5927\u4e8edf\u3002\u518d\u770b\u770b\u5bf9\/boot\u5206\u533a\u7684\u7edf\u8ba1\u7ed3\u679c\u3002\r\n[root@xuexi\u00a0~]#\u00a0df\u00a0-hT\u00a0\/boot;echo;du\u00a0-sh\u00a0\/boot\r\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0Type\u00a0\u00a0Size\u00a0\u00a0Used\u00a0Avail\u00a0Use%\u00a0Mounted\u00a0on\r\n\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ext4\u00a0\u00a0239M\u00a0\u00a0\u00a068M\u00a0\u00a0159M\u00a0\u00a030%\u00a0\/boot\r\n66M\u00a0\u00a0\u00a0\u00a0\u00a0\/boot\r\n<\/pre>\n

du\u7684\u7ed3\u679c\u662f66M\uff0cdf\u7684\u7ed3\u679c\u662f68M\uff0c\u76f8\u5dee\u4e0d\u5927\uff0c\u4f46df\u7684\u7ed3\u679c\u5927\u4e8edu\u3002
\n<\/p>\n

\u6587\u4ef6\u5b58\u50a8\u548c\u5220\u9664\u7684\u5e95\u5c42\u8fc7\u7a0b<\/strong><\/span><\/div>\n

<\/strong>
\n\u8fd9\u91cc\u7b80\u5355\u8bf4\u660e\u4e0b\u6587\u4ef6\u7cfb\u7edf\u76f8\u5173\u7684\u5e95\u5c42\u673a\u5236\uff0c\u9996\u5148\u8bf4\u660e\u4e0b\u6587\u4ef6\u662f\u600e\u4e48\u5b58\u50a8\u5230\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u3002\u5047\u5982\u8981\u5b58\u50a8a.txt\u5230\/tmp\u76ee\u5f55\u4e0b\u3002
\n
\"\"<\/a>
\n\u5f53a.txt\u6587\u4ef6\u8981\u5b58\u50a8\u5230\/tmp\u4e0b\u65f6\uff1a<\/strong><\/p>\n

    \n
  1. \u00a0\u9996\u5148\u4eceinode table\u4e2d\u627e\u4e00\u4e2a\u7a7a\u95f2\u7684inode\u53f7\u5206\u914d\u7ed9a.txt\uff0c\u4f8b\u59822222\u3002\u518d\u5c06inode map(imap)\u4e2d2222\u8fd9\u4e2ainode\u53f7\u6807\u8bb0\u4e3a\u5df2\u4f7f\u7528\u3002<\/li>\n
  2. \u00a0\u5728\/tmp\u7684data block\u4e2d\u6dfb\u52a0\u4e00\u6761a.txt\u6587\u4ef6\u7684\u8bb0\u5f55\u3002\u8be5\u8bb0\u5f55\u4e2d\u5305\u62ec\u4e00\u4e2a\u6307\u5411inode\u53f7\u7684\u6307\u9488\uff0c\u4f8b\u5982\"0x2222\"\u3002<\/li>\n
  3. \u00a0\u7136\u540e\u4eceblock map(bmap)\u4e2d\u627e\u51fa\u7a7a\u95f2\u7684data block\uff0c\u5e76\u5f00\u59cb\u5c06a.txt\u4e2d\u7684\u6570\u636e\u5199\u5165\u5230data block\u4e2d\u3002\u6bcf\u5199\u4e00\u6bb5\u7a7a\u95f4(ext4\u6bcf\u6b21\u5206\u914d\u4e00\u6bb5\u7a7a\u95f4)\u5c31\u4ecebmap\u4e2d\u627e\u4e00\u6b21\u7a7a\u95f2\u7684data block\uff0c\u76f4\u5230\u5b58\u5b8c\u6240\u6709\u6570\u636e\u3002<\/li>\n
  4. \u00a0\u8bbe\u7f6einode table\u4e2d\u5173\u4e8e2222\u8fd9\u6761\u8bb0\u5f55\u7684data block\u6307\u9488\uff0c\u901a\u8fc7\u8be5\u6307\u9488\u53ef\u4ee5\u627e\u5230a.txt\u4f7f\u7528\u4e86\u54ea\u4e9bdata block\u3002<\/li>\n<\/ol>\n

    \u5f53\u8981\u5220\u9664a.txt\u6587\u4ef6\u65f6\uff1a<\/strong><\/p>\n

      \n
    1. \u00a0\u5728inode table\u4e2d\u5220\u9664\u6307\u5411a.txt\u7684data block\u6307\u9488\u3002\u8fd9\u91cc\u53ea\u8981\u4e00\u5220\u9664\uff0c\u5916\u754c\u5c31\u627e\u4e0d\u5230a.txt\u7684\u6570\u636e\u4e86\u3002\u4f46\u662f\u8fd9\u4e2a\u6587\u4ef6\u8fd8\u5b58\u5728\uff0c\u53ea\u662f\u5b83\u662f\u88ab\"\u635f\u574f\"\u7684\u6587\u4ef6\uff0c\u56e0\u4e3a\u6ca1\u6709\u4efb\u4f55\u6307\u9488\u6307\u5411\u6570\u636e\u5757\u3002<\/li>\n
    2. \u00a0\u5728imap\u4e2d\u5c062222\u7684inode\u53f7\u6807\u8bb0\u4e3a\u672a\u4f7f\u7528\u3002\u4e8e\u662f\u8fd9\u4e2ainode\u53f7\u5c31\u88ab\u91ca\u653e\uff0c\u53ef\u4ee5\u88ab\u540e\u7eed\u7684\u6587\u4ef6\u91cd\u7528\u3002<\/li>\n
    3. \u00a0\u5220\u9664\u7236\u76ee\u5f55\/tmp\u7684data block\u4e2d\u5173\u4e8ea.txt\u7684\u8bb0\u5f55\u3002\u8fd9\u91cc\u53ea\u8981\u4e00\u5220\u9664\uff0c\u5916\u754c\u5c31\u770b\u4e0d\u5230\u4e5f\u627e\u4e0d\u5230\u8fd9\u4e2a\u6587\u4ef6\u4e86\u3002<\/li>\n
    4. \u00a0\u5728bmap\u4e2d\u5c06a.txt\u5360\u7528\u7684block\u6807\u8bb0\u4e3a\u672a\u4f7f\u7528\u3002\u8fd9\u91cc\u88ab\u6807\u8bb0\u4e3a\u672a\u4f7f\u7528\u540e\uff0c\u8fd9\u4e9bdata block\u5c31\u53ef\u4ee5\u88ab\u540e\u7eed\u6587\u4ef6\u8986\u76d6\u91cd\u7528\u3002<\/li>\n<\/ol>\n

      \u8003\u8651\u4e00\u79cd\u60c5\u51b5\uff0c\u5f53\u4e00\u4e2a\u6587\u4ef6\u88ab\u5220\u9664\u65f6\uff0c\u4f46\u6b64\u65f6\u8fd8\u6709\u8fdb\u7a0b\u5728\u4f7f\u7528\u8fd9\u4e2a\u6587\u4ef6\uff0c\u8fd9\u65f6\u662f\u600e\u6837\u7684\u60c5\u51b5\u5462\uff1f\u5916\u754c\u662f\u770b\u4e0d\u5230\u4e5f\u627e\u4e0d\u5230\u8fd9\u4e2a\u6587\u4ef6\u7684\uff0c\u6240\u4ee5\u5220\u9664\u7684\u8fc7\u7a0b\u5df2\u7ecf\u8fdb\u884c\u5230\u4e86\u7b2c(3)\u6b65\u3002<\/p>\n

      \u4f46\u8fdb\u7a0b\u8fd8\u5728\u4f7f\u7528\u8fd9\u4e2a\u6587\u4ef6\u7684\u6570\u636e\uff0c\u4e5f\u80fd\u627e\u5230\u8fd9\u4e2a\u6587\u4ef6\u7684\u6570\u636e\uff0c\u662f\u56e0\u4e3a\u8fdb\u7a0b\u5728\u52a0\u8f7d\u8fd9\u4e2a\u6587\u4ef6\u7684\u65f6\u5019\u5c31\u5df2\u7ecf\u83b7\u53d6\u5230\u4e86\u8be5\u6587\u4ef6\u5360\u7528\u54ea\u4e9bdata block\uff0c\u867d\u7136\u5220\u9664\u4e86\u6587\u4ef6\uff0c\u4f46bmap\u4e2d\u8fd9\u4e9bdata block\u8fd8\u6ca1\u6709\u6807\u8bb0\u4e3a\u672a\u4f7f\u7528\u3002<\/p>\n

      du\u7edf\u8ba1\u7684\u539f\u7406<\/strong><\/strong><\/div>\n

      du\u662f\u901a\u8fc7stat\u547d\u4ee4\u6765\u7edf\u8ba1\u6bcf\u4e2a\u6587\u4ef6(\u5305\u62ec\u5b50\u76ee\u5f55)\u7684\u7a7a\u95f4\u5360\u7528\u603b\u548c\u3002\u56e0\u4e3a\u4f1a\u5bf9\u6bcf\u4e2a\u6d89\u53ca\u5230\u7684\u6587\u4ef6\u4f7f\u7528stat\u547d\u4ee4\uff0c\u6240\u4ee5\u901f\u5ea6\u8f83\u6162\u3002
      \n\u5982\u679c\u7edf\u8ba1\u76ee\u5f55\u4e0b\u6302\u8f7d\u4e86\u5176\u4ed6\u6587\u4ef6\u7cfb\u7edf\uff0c\u90a3\u4e48\u4e5f\u4f1a\u5bf9\u8fd9\u4e2a\u6587\u4ef6\u7cfb\u7edf\u8fdb\u884c\u7edf\u8ba1\u3002\u4f8b\u5982\"du -sh \/\"\u7684\u65f6\u5019\uff0c\u4f1a\u7edf\u8ba1\u6240\u6709\u5206\u533a\u7684\u6587\u4ef6\uff0c\u5305\u62ec\u6302\u8f7d\u4e0a\u6765\u7684\u3002\u6b63\u5982\u672c\u6587\u5f00\u5934\u7edf\u8ba1\u7684\"\/\"\u4e00\u6837\uff0cdu\u7684\u7ed3\u679c\u662f244G\uff0c\u660e\u663e\u6bd4df\u7edf\u8ba1\u7684\u7ed3\u679c\u5927\uff0c\u5c31\u662f\u56e0\u4e3a\u5c06\u67d0\u4e2a\u5206\u533a\u6302\u8f7d\u5230\u4e86\/mnt\u76ee\u5f55\u4e0b\u3002<\/p>\n

      ##\u00a0df\u7684\u7edf\u8ba1\u7ed3\u679c\r\n[root@xuexi\u00a0~]#\u00a0df\u00a0-hT\r\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Type\u00a0\u00a0\u00a0Size\u00a0\u00a0Used\u00a0Avail\u00a0Use%\u00a0Mounted\u00a0on\r\n\/dev\/sda2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ext4\u00a0\u00a0\u00a0\u00a018G\u00a0\u00a01.7G\u00a0\u00a0\u00a015G\u00a0\u00a011%\u00a0\/\r\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0tmpfs\u00a0\u00a0491M\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0491M\u00a0\u00a0\u00a00%\u00a0\/dev\/shm\r\n\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ext4\u00a0\u00a0\u00a0239M\u00a0\u00a0\u00a068M\u00a0\u00a0159M\u00a0\u00a030%\u00a0\/boot\r\n\/\/192.168.0.124\/win\u00a0cifs\u00a0\u00a0\u00a0381G\u00a0\u00a0243G\u00a0\u00a0138G\u00a0\u00a064%\u00a0\/mnt\r\n##\u00a0du\u5bf9\u6839\u76ee\u5f55\u7684\u7edf\u8ba1\u7ed3\u679c\r\n[root@xuexi\u00a0~]#\u00a0du\u00a0-sh\u00a0\/\u00a0\u00a02><\/span>\/dev\/null\r\n244G\u00a0\u00a0\u00a0\u00a0\/\r\n<\/pre>\n

      \u5982\u679c\u6587\u4ef6\u88ab\u5220\u9664\uff0c\u5373\u4f7f\u88ab\u5176\u4ed6\u8fdb\u7a0b\u5f15\u7528\u4e86\uff0cdu\u547d\u4ee4\u4e5f\u65e0\u6cd5\u5bf9\u5176\u7edf\u8ba1\u3002\u56e0\u4e3astat\u547d\u4ee4\u627e\u4e0d\u5230\u8fd9\u4e2a\u6587\u4ef6\u3002
      \n\u53ef\u4ee5\u8de8\u5206\u533a\u7edf\u8ba1\u67d0\u4e9b\u4f60\u60f3\u7edf\u8ba1\u7684\u6587\u4ef6\u5927\u5c0f\u603b\u548c\u3002\u56e0\u4e3a\u5b83\u4eec\u90fd\u80fd\u88abstat\u627e\u5230\u5e76\u7edf\u8ba1\u3002\u4f8b\u5982\uff1a\u7edf\u8ba1Linux\u4e0b\u6240\u6709img\u6587\u4ef6\u7684\u5927\u5c0f\u3002<\/p>\n

      ##\u00a0df\u7684\u7edf\u8ba1\u7ed3\u679c\r\n[root@xuexi\u00a0~]#\u00a0find\u00a0\/\u00a0-type\u00a0f\u00a0-name\u00a0\"*.img\"\u00a0-print0\u00a0|\u00a0xargs\u00a0-0\u00a0du\u00a0-csh\r\n19M\u00a0\u00a0\u00a0\u00a0\u00a0\/boot\/initramfs-2.6.32-504.el6.x86_64.img\r\n13M\u00a0\u00a0\u00a0\u00a0\u00a0\/mnt\/linux\u5de5\u5177\/cirros-0.3.4-x86_64-disk.img\r\n31M\u00a0\u00a0\u00a0\u00a0\u00a0total<\/pre>\n

      \u8fd9\u91cc\u7edf\u8ba1\u7684\u4e24\u4e2aimg\u6587\u4ef6\u5c31\u662f\u5728\u4e0d\u540c\u5206\u533a\u5185\u7684\u3002<\/p>\n

      df\u7edf\u8ba1\u7684\u539f\u7406<\/strong><\/strong><\/div>\n

      df\u662f\u8bfb\u53d6\u6bcf\u4e2a\u5206\u533a\u7684superblock\u6765\u83b7\u53d6\u7a7a\u95f2\u6570\u636e\u5757\u3001\u5df2\u4f7f\u7528\u6570\u636e\u5757\uff0c\u4ece\u800c\u8ba1\u7b97\u51fa\u7a7a\u95f2\u7a7a\u95f4\u548c\u5df2\u4f7f\u7528\u7a7a\u95f4\uff0c\u56e0\u6b64df\u7edf\u8ba1\u7684\u901f\u5ea6\u6781\u5feb(superblock\u624d\u5360\u75281024\u5b57\u8282)\u3002
      \n\u5f53\u67d0\u4e2a\u6587\u4ef6\u7cfb\u7edf\u4e0b\u6302\u8f7d\u4e86\u5176\u4ed6\u5206\u533a\uff0cdf\u4e0d\u4f1a\u628a\u8fd9\u4e2a\u5206\u533a\u4e5f\u7edf\u8ba1\u8fdb\u53bb\u3002\u8fd9\u5f88\u5bb9\u6613\u7406\u89e3\uff0c\u56e0\u4e3adf\u8bfb\u53d6\u7684\u662f\u5404\u81ea\u5206\u533a\u7684superblock\uff0c\u5373\u4f7f\u5206\u533a1\u6302\u8f7d\u5728\u5206\u533a0\u7684\u76ee\u5f55\u4e0b\uff0cdf\u7edf\u8ba1\u5206\u533a0\u7684\u65f6\u5019\uff0c\u4e5f\u53ea\u80fd\u8bfb\u53d6\u5206\u533a0\u7684superblock\u3002
      \n\u4f8b\u5982\uff0c\u4e0b\u9762\u7684\/mnt\u3001\/boot\u90fd\u6ca1\u6709\u7edf\u8ba1\u5728\"\/\"\u4e2d\u3002<\/p>\n

      [root@xuexi\u00a0~]#\u00a0df\u00a0-hT\r\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Type\u00a0\u00a0\u00a0Size\u00a0\u00a0Used\u00a0Avail\u00a0Use%\u00a0Mounted\u00a0on\r\n\/dev\/sda2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ext4\u00a0\u00a0\u00a0\u00a018G\u00a0\u00a01.7G\u00a0\u00a0\u00a015G\u00a0\u00a011%\u00a0\/\r\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0tmpfs\u00a0\u00a0491M\u00a0\u00a0\u00a0\u00a0\u00a00\u00a0\u00a0491M\u00a0\u00a0\u00a00%\u00a0\/dev\/shm\r\n\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ext4\u00a0\u00a0\u00a0239M\u00a0\u00a0\u00a068M\u00a0\u00a0159M\u00a0\u00a030%\u00a0\/boot\r\n\/\/192.168.0.124\/win\u00a0cifs\u00a0\u00a0\u00a0381G\u00a0\u00a0243G\u00a0\u00a0138G\u00a0\u00a064%\u00a0\/mnt\r\n<\/pre>\n

      \u7531\u4e8edf\u6bcf\u6b21\u7edf\u8ba1\u90fd\u662f\u8bfb\u53d6superblock\uff0c\u6240\u4ee5df\u5bf9\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u67d0\u4e2a\u6587\u4ef6\u8fdb\u884c\u7edf\u8ba1\u65f6\uff0c\u4f1a\u81ea\u52a8\u8f6c\u4e3a\u7edf\u8ba1\u8fd9\u4e2a\u6587\u4ef6\u7cfb\u7edf\u7684\u4fe1\u606f\u3002<\/p>\n

      [root@xuexi\u00a0~]#\u00a0df\u00a0-hT\u00a0\/etc\/fstab\r\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0Type\u00a0\u00a0Size\u00a0\u00a0Used\u00a0Avail\u00a0Use%\u00a0Mounted\u00a0on\r\n\/dev\/sda2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ext4\u00a0\u00a0\u00a018G\u00a0\u00a01.7G\u00a0\u00a0\u00a015G\u00a0\u00a011%\u00a0\/\r\n<\/pre>\n

      df\u4f1a\u7edf\u8ba1\u5df2\u5220\u9664\u4f46\u5374\u4ecd\u6709\u8fdb\u7a0b\u5f15\u7528\u7684\u6587\u4ef6\u3002<\/p>\n

      \u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u5220\u9664\u6587\u4ef6\u4f1a\u7acb\u523b\u91ca\u653e\u76f8\u5173\u6307\u9488\uff0c\u5e76\u5c06imap\u548cbmap\u4e2d\u76f8\u5173\u7684\u4f4d\u56fe\u6807\u8bb0\u4e3a\u672a\u4f7f\u7528\u3002bmap\u53ea\u8981\u4e00\u6539\u53d8\uff0c\u6587\u4ef6\u7cfb\u7edf\u7acb\u523b\u5c31\u80fd\u77e5\u9053\u6bcf\u4e2a\u5757\u7ec4\u4e2d\u54ea\u4e9b\u6570\u636e\u5757\u662f\u7a7a\u95f2\u7684\uff0c\u54ea\u4e9b\u6570\u636e\u5757\u662f\u88ab\u4f7f\u7528\u7684\uff0c\u8fd9\u4e9b\u4fe1\u606f\u90fd\u4f1a\u66f4\u65b0\u5230\u5206\u533a\u7684superblock\u4e2d\u3002\u4e8e\u662fdf\u80fd\u7acb\u523b\u7edf\u8ba1\u5230\u5b9e\u65f6\u7684\u7a7a\u95f4\u4fe1\u606f\u3002<\/p>\n

      \u4f46\u662f\u5f53\u4e00\u4e2a\u6587\u4ef6\u88ab\u5220\u9664\u65f6\uff0c\u5982\u679c\u8fd8\u6709\u8fdb\u7a0b\u5728\u5f15\u7528\u8fd9\u4e2a\u6587\u4ef6\uff0c\u6839\u636e\u524d\u6587\u7684\u5206\u6790\uff0cbmap\u4e2d\u4e0d\u4f1a\u5c06\u8fd9\u4e2a\u6587\u4ef6\u7684data block\u6807\u8bb0\u4e3a\u672a\u4f7f\u7528\uff0c\u4e5f\u5c31\u4e0d\u4f1a\u5c06\u6570\u636e\u5757\u7684\u4f7f\u7528\u60c5\u51b5\u66f4\u65b0\u5230superblock\u4e2d\u3002\u7531\u4e8edf\u662f\u6839\u636esuperblock\u4e2d\u7a7a\u95f2\u548c\u4f7f\u7528\u6570\u636e\u5757\u7684\u6570\u91cf\u6765\u8ba1\u7b97\u7a7a\u95f2\u7a7a\u95f4\u548c\u5df2\u4f7f\u7528\u7a7a\u95f4\u7684\uff0c\u6240\u4ee5df\u7edf\u8ba1\u7684\u65f6\u5019\u4f1a\u5c06\u8fd9\u4e2a\u5df2\u88ab\"\u5220\u9664\"\u7684\u6587\u4ef6\u7edf\u8ba1\u5230\u5df2\u4f7f\u7528\u7a7a\u95f4\u4e2d\u3002<\/p>\n

      \u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u8f83\u5927\u4e00\u70b9\u7684\u6587\u4ef6\u653e\u5728\"\/\"\u76ee\u5f55\u4e0b\uff0c\u5e76du\u548cdf\u7edf\u8ba1\u6839\u76ee\u5f55\u7684\u5df2\u4f7f\u7528\u7a7a\u95f4\u3002<\/p>\n

      [root@xuexi\u00a0~]#\u00a0dd\u00a0if<\/span>=\/dev\/zero\u00a0of<\/span>=\/my.iso\u00a0bs<\/span>=1M<\/span>\u00a0count<\/span>=1000<\/span>\r\n[root@xuexi\u00a0~]#\u00a0df\u00a0-hT\u00a0\/\r\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0Type\u00a0\u00a0Size\u00a0\u00a0Used\u00a0Avail\u00a0Use%\u00a0Mounted\u00a0on\r\n\/dev\/sda2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ext4\u00a0\u00a0\u00a018G\u00a0\u00a02.7G\u00a0\u00a0\u00a014G\u00a0\u00a017%\u00a0\/\r\n[root@xuexi\u00a0~]#\u00a0du\u00a0-sh\u00a0--exclude<\/span>=\"\/mnt\"<\/span>\u00a0\/\u00a02><\/span>\/dev\/null\r\n2.7G\u00a0\u00a0\u00a0\u00a0\/\r\n<\/pre>\n

      \u5b83\u4eec\u5728GB\u7ea7\u7684\u5355\u4f4d\u4e0a\u662f\u76f8\u7b49\u7684\u3002\u73b0\u5728\u4f7f\u7528\u4e00\u4e2a\u8fdb\u7a0b\u6765\u5f15\u7528\u8fd9\u4e2a\u6587\u4ef6\uff0c\u7136\u540e\u5220\u9664\u8fd9\u4e2a\u6587\u4ef6\uff0c\u518ddu\u548cdf\u7edf\u8ba1\u3002<\/p>\n

      [root@xuexi\u00a0~]#\u00a0tail\u00a0-f\u00a0\/my.iso\u00a0&\r\n[root@xuexi\u00a0~]#\u00a0rm\u00a0-rf\u00a0\/my.iso\r\n[root@xuexi\u00a0~]#\u00a0ls\u00a0\/my.iso\r\nls:\u00a0cannot\u00a0access\u00a0\/my.iso:\u00a0No\u00a0such\u00a0file\u00a0or\u00a0directory\r\n[root@xuexi\u00a0~]#\u00a0du\u00a0-sh\u00a0--exclude<\/span>=\"\/mnt\"<\/span>\u00a0\/\u00a02><\/span>\/dev\/null\r\n1.8G\u00a0\u00a0\u00a0\u00a0\/\r\n[root@xuexi\u00a0~]#\u00a0df\u00a0-hT\u00a0\/\r\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0Type\u00a0\u00a0Size\u00a0\u00a0Used\u00a0Avail\u00a0Use%\u00a0Mounted\u00a0on\r\n\/dev\/sda2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ext4\u00a0\u00a0\u00a018G\u00a0\u00a02.7G\u00a0\u00a0\u00a014G\u00a0\u00a017%\u00a0\/\r\n<\/pre>\n

      \u53ef\u4ee5\u53d1\u73b0\uff0c\u5916\u754c\u5df2\u7ecf\u83b7\u53d6\u4e0d\u5230my.iso\u6587\u4ef6\u4e86\uff0c\u6240\u4ee5du\u65e0\u6cd5\u7edf\u8ba1\u8fd9\u4e2a\u6587\u4ef6\u3002\u800cdf\u5374\u5c06\u8be5\u6587\u4ef6\u5927\u5c0f\u7edf\u8ba1\u8fdb\u53bb\u4e86\uff0c\u56e0\u4e3amy.iso\u5360\u7528\u7684data block\u8fd8\u672a\u88ab\u6807\u8bb0\u4e3a\u672a\u4f7f\u7528\u3002\u518d\u5173\u6389tail\u8fdb\u7a0b\uff0c\u7136\u540edf\u518d\u7edf\u8ba1\u7a7a\u95f4\uff0c\u7ed3\u679c\u5c06\u548cdu\u4e00\u6837\u663e\u793a\u4e3a\u6b63\u5e38\u7684\u5927\u5c0f\u3002<\/p>\n

      [root@xuexi\u00a0~]#\u00a0jobs\r\n[1]+\u00a0\u00a0Running\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0tail\u00a0-f\u00a0\/my.iso\u00a0&\r\n[root@xuexi\u00a0~]#\u00a0kill\u00a0%1\r\n[root@xuexi\u00a0~]#\u00a0df\u00a0-hT\u00a0\/\r\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0Type\u00a0\u00a0Size\u00a0\u00a0Used\u00a0Avail\u00a0Use%\u00a0Mounted\u00a0on\r\n\/dev\/sda2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ext4\u00a0\u00a0\u00a018G\u00a0\u00a01.7G\u00a0\u00a0\u00a015G\u00a0\u00a011%\u00a0\/\r\n<\/pre>\n

      \u5982\u679c\u4e0d\u77e5\u9053\u6587\u4ef6\u7cfb\u7edf\u4e2d\u54ea\u4e9b\u5df2\u88ab\u5220\u9664\uff0c\u4f46\u5374\u8fd8\u88ab\u8fdb\u7a0b\u5f15\u7528\u7684\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528lsof\u6765\u83b7\u53d6\u3002\u901a\u8fc7\u5b83\u8fd8\u80fd\u83b7\u53d6\u5230\u6587\u4ef6\u7684\u5927\u5c0f\uff0c\u770b\u770b\u5230\u5e95\u662f\u54ea\u4e2a\u6587\u4ef6\u5728\"\u5360\u7740\u8305\u5751\u4ee5\u53ca\u5360\u4e86\u591a\u5c11\u8305\u5751\"\u3002\u4f8b\u5982\uff0c\u5173\u6389tail\u8fdb\u7a0b\u524d\uff0c\u4f7f\u7528lsof\u67e5\u770b\u3002\u53ef\u4ee5\u770b\u5230tail\u8fdb\u7a0b\u5360\u7528\u4e86\/my.iso\uff0c\u4e14\u8fd9\u4e2a\u6587\u4ef6\u7684\u5927\u5c0f\u4e3a1048576000\u5b57\u8282\u3002<\/p>\n

      [root@xuexi\u00a0~]#\u00a0lsof\u00a0|\u00a0grep\u00a0deleted\r\nphp-fpm\u00a0\u00a0\u00a012597\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0root\u00a0\u00a0txt\u00a0\u00a0\u00a0\u00a0\u00a0REG\u00a0\u00a0\u00a08,2\u00a0\u00a0\u00a0\u00a04058416\u00a0\u00a0\u00a0931143\u00a0\/usr\/sbin\/php-fpm\u00a0(deleted)\r\nphp-fpm\u00a0\u00a0\u00a012657\u00a0\u00a0\u00a0\u00a0nobody\u00a0\u00a0txt\u00a0\u00a0\u00a0\u00a0\u00a0REG\u00a0\u00a0\u00a08,2\u00a0\u00a0\u00a0\u00a04058416\u00a0\u00a0\u00a0931143\u00a0\/usr\/sbin\/php-fpm\u00a0(deleted)\r\nphp-fpm\u00a0\u00a0\u00a012707\u00a0\u00a0\u00a0\u00a0nobody\u00a0\u00a0txt\u00a0\u00a0\u00a0\u00a0\u00a0REG\u00a0\u00a0\u00a08,2\u00a0\u00a0\u00a0\u00a04058416\u00a0\u00a0\u00a0931143\u00a0\/usr\/sbin\/php-fpm\u00a0(deleted)\r\nphp-fpm\u00a0\u00a0\u00a012708\u00a0\u00a0\u00a0\u00a0nobody\u00a0\u00a0txt\u00a0\u00a0\u00a0\u00a0\u00a0REG\u00a0\u00a0\u00a08,2\u00a0\u00a0\u00a0\u00a04058416\u00a0\u00a0\u00a0931143\u00a0\/usr\/sbin\/php-fpm\u00a0(deleted)\r\ntail\u00a0\u00a0\u00a0\u00a0\u00a0\u00a014437\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0root\u00a0\u00a0\u00a0\u00a03r\u00a0\u00a0\u00a0\u00a0REG\u00a0\u00a0\u00a08,2\u00a01048576000\u00a0\u00a0\u00a0\u00a0\u00a07171\u00a0\/my.iso\u00a0(deleted)\r\n<\/pre>\n

      \u7ecf\u8fc7\u4e0a\u9762\u7684\u5206\u6790\uff0c\u60f3\u5fc5\u5bf9du\u548cdf\u7684\u7ed3\u679c\u4e0d\u4f1a\u518d\u6709\u4efb\u4f55\u7591\u60d1\u4e86\u5427\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

      [root@xuexi\u00a0~]#\u00a0df\u00a0-hT Filesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Type\u00a0\u00a0\u00a0Size\u00a0 […]<\/p>\n","protected":false},"author":643,"featured_media":209439,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-209407","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\/209407","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\/643"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=209407"}],"version-history":[{"count":8,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/209407\/revisions"}],"predecessor-version":[{"id":209465,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/209407\/revisions\/209465"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/209439"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=209407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=209407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=209407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}