Linux文件已经删除,但空间未释放怎么办
Last updated
2023-01-28 10:34:21
{"value":"### \u95ee\u9898\u73b0\u8c61\n\nLinux\u64cd\u4f5c\u7cfb\u7edf\u4e91\u670d\u52a1\u5668\u6839\u76ee\u5f55\u7a7a\u95f4\u5360\u7528\u7387\u8fc7\u9ad8\u3002\u4f8b\u5982\uff0c\u4ee5\u4e0b\u56fe\u4e3a\u4f8b\uff0c\u6839\u76ee\u5f55\u7a7a\u95f4\u5360\u7528\u7387\u4e3a96%\u3002\n\n![](https:\/\/97yw3pix.hk03.1112oss.com\/TechnicalQA%2F%E6%96%87%E6%A1%A3%2Fweek12%2FLinux%E6%96%87%E4%BB%B6%E5%B7%B2%E7%BB%8F%E5%88%A0%E9%99%A4%EF%BC%8C%E4%BD%86%E7%A9%BA%E9%97%B4%E6%9C%AA%E9%87%8A%E6%94%BE%E6%80%8E%E4%B9%88%E5%8A%9E%2F1.png)\n\n\u67e5\u8be2\u5f53\u524d\u7cfb\u7edf\u5b58\u5728\u4e00\u4e2a\u7ea642G\u5927\u5c0f\u7684\u6587\u4ef6access_log\uff0c\u8fd9\u4e2a\u6587\u4ef6\u662fapache\u4ea7\u751f\u7684\u8bbf\u95ee\u65e5\u5fd7\u6587\u4ef6\uff0c\u4ece\u65e5\u5fd7\u5927\u5c0f\u5224\u65ad\u662f\u5f88\u4e45\u6ca1\u6709\u6e05\u7406\u7684apache\u65e5\u5fd7\u6587\u4ef6\u4e86\u3002\n\n\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5220\u9664access_log\u3002\n\n\trm \/tmp\/access_log\n\n\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u6587\u4ef6\u7cfb\u7edf\u4f7f\u7528\u7387\u3002\n\n\tdf -h\n\n\u5220\u9664\u8be5\u6587\u4ef6\u540e\u4f7f\u7528df\u67e5\u770b\u6587\u4ef6\u7cfb\u7edf\u4f7f\u7528\u7387\u4ecd\u662f96%\u3002\n\n### \u89e3\u51b3\u65b9\u6cd5\n\n1\u3001\u4f7f\u7528lsof\u547d\u4ee4\u67e5\u770b\u662f\u5426\u6709\u8fdb\u7a0b\u4e00\u76f4\u5728\u5411access_log\u6587\u4ef6\u4e2d\u5199\u5165\u6570\u636e\u3002\n\n\tlsof -n |grep delete\n\n![](https:\/\/97yw3pix.hk03.1112oss.com\/TechnicalQA%2F%E6%96%87%E6%A1%A3%2Fweek12%2FLinux%E6%96%87%E4%BB%B6%E5%B7%B2%E7%BB%8F%E5%88%A0%E9%99%A4%EF%BC%8C%E4%BD%86%E7%A9%BA%E9%97%B4%E6%9C%AA%E9%87%8A%E6%94%BE%E6%80%8E%E4%B9%88%E5%8A%9E%2F2.png)\n\n\u5982\u56de\u663e\u4fe1\u606f\u6240\u793a\uff0c\/tmp\/access_log \u6587\u4ef6\u88ab\u8fdb\u7a0bhttpd\u9501\u5b9a\uff0c\u800chttpd\u8fdb\u7a0b\u8fd8\u4e00\u76f4\u5411\u8fd9\u4e2a\u6587\u4ef6\u5199\u5165\u65e5\u5fd7\u6570\u636e\uff0c\u6700\u540e\u4e00\u5217\u7684\u201cdeleted\u201d\u72b6\u6001\u8bf4\u660e\u8fd9\u4e2a\u65e5\u5fd7\u6587\u4ef6\u5df2\u7ecf\u88ab\u5220\u9664\uff0c\u4f46\u662f\u7531\u4e8e\u8fdb\u7a0b\u8fd8\u5728\u4e00\u76f4\u5411\u6b64\u6587\u4ef6\u5199\u5165\u6570\u636e\uff0c\u56e0\u6b64\u7a7a\u95f4\u5e76\u672a\u91ca\u653e\u3002\n\n2\u3001\u53ef\u4ee5\u9009\u62e9\u5173\u95ed\u6216\u8005\u91cd\u542fhttpd\u8fdb\u7a0b\uff0c\u6216\u91cd\u542f\u64cd\u4f5c\u7cfb\u7edf\u3002\u63a8\u8350\u5728\u7ebf\u6e05\u7a7aaccess_log\u3002\n\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u6e05\u7a7aaccess_log\u3002\n\n\techo \"\">\/access_log\n\n\u901a\u8fc7\u8fd9\u79cd\u65b9\u6cd5\uff0c\u78c1\u76d8\u7a7a\u95f4\u4e0d\u4f46\u53ef\u4ee5\u9a6c\u4e0a\u91ca\u653e\uff0c\u4e5f\u53ef\u4ee5\u4fdd\u8bc1\u8fdb\u7a0b\u7ee7\u7eed\u5411\u6587\u4ef6\u5199\u5165\u65e5\u5fd7\uff0c\u518d\u6b21\u6267\u884cdf -h\u67e5\u770b\u6839\u5206\u533a\u7a7a\u95f4\u5df2\u7ecf\u91ca\u653e\u3002\n\n\tdf -h\n\n![](https:\/\/97yw3pix.hk03.1112oss.com\/TechnicalQA%2F%E6%96%87%E6%A1%A3%2Fweek12%2FLinux%E6%96%87%E4%BB%B6%E5%B7%B2%E7%BB%8F%E5%88%A0%E9%99%A4%EF%BC%8C%E4%BD%86%E7%A9%BA%E9%97%B4%E6%9C%AA%E9%87%8A%E6%94%BE%E6%80%8E%E4%B9%88%E5%8A%9E%2F3.png)"}