\u539f\u7406<\/strong><\/span><\/div>\n\u8fd9\u4e2a\u547d\u4ee4\u5b9e\u9645\u4e0a\u5e76\u4e0d\u80fd\u76f4\u63a5\u7528\u6765\u6062\u590d\u6587\u4ef6\uff0c\u4e0d\u8fc7\u5b83\u53ef\u4ee5\u5217\u51fa\u88ab\u5404\u79cd\u8fdb\u7a0b\u6253\u5f00\u7684\u6587\u4ef6\u4fe1\u606f\u3002<\/p>\n
\u914d\u5408\u5176\u4ed6\u547d\u4ee4\uff0c\u4ece\/proc\u76ee\u5f55\u4e0b\u7684\u4fe1\u606f\u4e2d\u6062\u590d\u201c\u6587\u4ef6\u5df2\u5220\u9664\uff0c\u4f46\u8fdb\u7a0b\u4ecd\u4fdd\u6301\u6253\u5f00\u8be5\u6587\u4ef6\u7684\u72b6\u6001\u201d\u7684\u6587\u4ef6\u3002<\/p>\n
\/proc\u76ee\u5f55\u662f\u6302\u8f7d\u7684\u662f\u5728\u5185\u5b58\u4e2d\u6240\u6620\u5c04\u7684\u4e00\u5757\u533a\u57df\uff0c\u5f53\u6211\u4eec\u5bf9\u8fd9\u4e9b\u6587\u4ef6\u8fdb\u884c\u8bfb\u53d6\u548c\u5199\u5165\u65f6\uff0c\u5b9e\u9645\u4e0a\u662f\u5728\u4ece\u5185\u5b58\u4e2d\u83b7\u53d6\u76f8\u5173\u4fe1\u606f\u3002<\/p>\n
\u56e0\u6b64\uff0c\u5f53\u6211\u4eec\u5bf9\u6587\u4ef6\u8fdb\u884c\u8bfb\u53d6\u6216\u5199\u5165\u65f6(\u5373\u6709\u8fdb\u7a0b\u6b63\u4f7f\u7528\u6587\u4ef6\u65f6)\uff0c\u54ea\u6015\u786c\u76d8\u4e2d\u7684\u8be5\u6587\u4ef6\u5df2\u5220\u9664\uff0c\u8fd8\u53ef\u4ee5\u4ece\u5185\u5b58\u4e2d\u7684\u4fe1\u606f\u6062\u590d\u6587\u4ef6\u3002<\/p>\n
\u6ce8\u610f\uff1a\u5fc5\u987b\u4ee5 root \u7528\u6237\u7684\u6743\u9650\u8fd0\u884c\uff0c \u56e0\u4e3alsof \u9700\u8981\u8bbf\u95ee\u6838\u5fc3\u5185\u5b58\u548c\u5404\u79cd\u6587\u4ef6\u3002<\/p>\n
\u53ea\u80fd\u6062\u590d\u201c\u6587\u4ef6\u5df2\u5220\u9664\uff0c\u4f46\u8fdb\u7a0b\u4ecd\u4fdd\u6301\u6253\u5f00\u8be5\u6587\u4ef6\u7684\u72b6\u6001\u201d\u7684\u6587\u4ef6\u3002<\/p>\n
\u5982\u679c\u8bef\u5220\u4e86\u76ee\u5f55\uff0c\u76ee\u5f55\u4e2d\u7684\u5176\u4ed6\u6587\u4ef6\u672a\u88ab\u8fdb\u7a0b\u6253\u5f00\uff0c\u6ca1\u6709\u8fdb\u884c\u4f7f\u7528\u7684\u6587\u4ef6\u5c06\u65e0\u6cd5\u4f7f\u7528\u6b64\u65b9\u6cd5\u6062\u590d\u3002<\/p>\n
lsof\u8f93\u51fa\u4fe1\u606f\u7684\u610f\u4e49\uff1a
\n<\/p>\n
COMMAND \u8fdb\u7a0b\u7684PID(\u8fdb\u7a0b\u6807\u8bc6\u7b26)\r\nUSER \u8fdb\u7a0b\u6240\u6709\u8005\r\nFD \u7528\u6765\u8bc6\u522b\u8be5\u6587\u4ef6(\u6587\u4ef6\u63cf\u8ff0\u7b26)\r\nDEVICE \u6307\u5b9a\u78c1\u76d8\u7684\u540d\u79f0\r\nSIZE \u6587\u4ef6\u7684\u5927\u5c0f\r\nNODE \u7d22\u5f15\u8282\u70b9(\u6587\u4ef6\u5728\u78c1\u76d8\u4e0a\u7684\u6807\u8bc6)\r\nNAME \u6253\u5f00\u6587\u4ef6\u7684\u786e\u5207\u540d\u79f0\r\n<\/pre>\n\u6700\u5e38\u7528\u53c2\u6570:<\/p>\n
-c \u663e\u793a\u67d0\u8fdb\u7a0b\u73b0\u5728\u6253\u5f00\u7684\u6587\u4ef6\r\n-p \u663e\u793a\u54ea\u4e9b\u6587\u4ef6\u88ab\u67d0pid\u8fdb\u7a0b\u6253\u5f00\r\n-g \u663e\u793a\u5f52\u5c5e\u67d0gid\u7684\u8fdb\u7a0b\u60c5\u51b5\r\n-d \u663e\u793a\u76ee\u5f55\u4e0b\u88ab\u8fdb\u7a0b\u5f00\u542f\u7684\u6587\u4ef6\r\n-d \u663e\u793a\u4f7f\u7528fd\u4e3a4\u7684\u8fdb\u7a0b\r\n-i:80 \u663e\u793a\u6253\u5f0080\u7aef\u53e3\u7684\u8fdb<\/pre>\n\u6062\u590d\u6587\u4ef6\u64cd\u4f5c<\/strong><\/span><\/div>\n\u73af\u5883\uff1a\u5728\/mnt\u4e0b\u6709\u4e00\u4e9b\u6587\u4ef6\uff0c\u5176\u4e2d\u4e00\u4e2a\u6587\u4ef6train.less\u6b63\u5728\u88ab\u67e5\u770b\uff0c\u7136\u540e\u53e6\u4e00\u4e2a\u7ec8\u7aef\u5c06\u5176\u5220\u9664<\/p>\n
\u30101\u3011lsof\u67e5\u770b<\/p>\n
\u67e5\u770b\u6b63\u5728\u4f7f\u7528\u5220\u9664\u6587\u4ef6\u7684\u8fdb\u7a0b\u53f7<\/p>\n
lsof \/mnt
\n<\/p>\n
<\/p>\n
\u30102\u3011\u6062\u590d<\/p>\n
\u5207\u6362\u5230\/proc\u4e0b\uff0c\u5220\u9664\u6587\u4ef6\u5bf9\u5e94\u7684\u8fdb\u7a0b\u7684pid\u4e0b\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\u4e2d\u7684\u76ee\u5f55\u4e2d\uff1b\u5c06\u5bf9\u5e94\u7684\u5185\u5bb9\u91cd\u5b9a\u5411\u6216cp\u5230\u5176\u4ed6\u6587\u4ef6\u4e2d \u91cd\u70b9\u5173\u6ce8\uff1aPID \u4e0e FD<\/p>\n
cd \/proc\/31284\/fd\/\r\ncat 4 > \/mnt\/ferris_train.less\r\n<\/pre>\n<\/p>\n
2\u3001extundelete<\/strong><\/div>\n\u539f\u7406\uff1a<\/strong><\/span><\/div>\n\u4f7f\u7528\u5b58\u50a8\u5728\u5206\u533a\u65e5\u5fd7\u4e2d\u7684\u4fe1\u606f\uff0c\u5c1d\u8bd5\u6062\u590d\u5df2\u4eceext3\u6216ext4\u7684\u5206\u533a\u4e2d\u5220\u9664\u7684\u6587\u4ef6<\/p>\n
\u4f18\u70b9\uff1a\u76f8\u6bd4\u4e8eext3grep\u53ea\u80fd\u6062\u590dext3\u6587\u4ef6\u7cfb\u7edf\u7684\u6587\u4ef6\uff0c\u5176\u9002\u7528\u8303\u56f4\u66f4\u5e7f\uff0c\u6062\u590d\u901f\u5ea6\u66f4\u5feb<\/p>\n
extundelete\u5b98\u65b9\u5730\u5740(\u5b98\u65b9\u6587\u6863)\uff1ahttp:\/\/extundelete.sourceforge.net<\/p>\n
extundelete\u4e0b\u8f7d\u5730\u5740\uff1ahttp:\/\/downloads.sourceforge.net\/project\/extundelete\/extundelete\/0.2.4\/extundelete-0.2.4.tar.bz2 (\u6700\u65b0\u7248\u672c\u7684extundelete\u662f0.2.4\uff0c\u4e8e2013\u5e741\u6708\u53d1\u5e03)<\/p>\n
\u6ce8\u610f\uff1a<\/p>\n
\u5728\u6570\u636e\u5220\u9664\u4e4b\u540e\uff0c\u8981\u5378\u8f7d\u88ab\u5220\u9664\u6570\u636e\u6240\u5728\u7684\u78c1\u76d8\u6216\u662f\u5206\u533a<\/p>\n
\u5982\u679c\u662f\u7cfb\u7edf\u6839\u5206\u533a\u906d\u5230\u8bef\u5220\u9664\uff0c\u5c31\u8981\u8fdb\u5165\u5355\u7528\u6237\u6a21\u5f0f,\u5c06\u6839\u5206\u533a\u4ee5\u53ea\u8bfb\u7684\u65b9\u5f0f\u6302\u8f7d,\u5c3d\u53ef\u80fd\u907f\u514d\u6570\u636e\u88ab\u8986\u76d6<\/p>\n
\u6570\u636e\u88ab\u8986\u76d6\u540e\u65e0\u6cd5\u627e\u56de<\/p>\n
\u6062\u590d\u4ecd\u6709\u4e00\u5b9a\u7684\u673a\u7387\u5931\u8d25\uff0c\u5e73\u65f6\u5e94\u5bf9\u91cd\u8981\u6570\u636e\u4f5c\u5907\u4efd\uff0c\u5c0f\u5fc3\u4f7f\u7528rm<\/p>\n
\u5b89\u88c5<\/strong><\/span><\/div>\n1\u3001\u4f9d\u8d56\u5b89\u88c5<\/p>\n
centos\u5b89\u88c5\u64cd\u4f5c<\/p>\n
yum install e2fsprogs-devel e2fsprogs* gcc*\r\n<\/pre>\nubuntu\u5b89\u88c5\u64cd\u4f5c
\napt-get install build-essential e2fslibs-dev e2fslibs-dev
\n2\u3001\u7f16\u8bd1\u5b89\u88c5<\/p>\n
wget http:\/\/downloads.sourceforge.net\/project\/extundelete\/extundelete\/0.2.4\/extundelete-0.2.4.tar.bz2\r\ntar xf extundelete-0.2.4.tar.bz2\r\ncd extundelete-0.2.4\r\n.\/configure\r\nmake\r\nmake install\r\n\r\ncd \/root\/extundelete-0.2.4\/src\r\n<\/pre>\n<\/p>\n
extundelete -v\r\n<\/pre>\n<\/p>\n
\u6267\u884cmake\u547d\u4ee4\u4f1a\u5728src\u76ee\u5f55\u4e0b\u751f\u6210extundelete\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u53ef\u5728\u6b64\u76f4\u63a5\u6267\u884c\u6062\u590d\u547d\u4ee4\u3002<\/p>\n
\u6267\u884cmake install\u4f1a\u5c06\u7a0b\u5e8f\u5b89\u88c5\u5728\/usr\/local\/bin\/\u4e0b<\/p>\n
\u6062\u590d\u6587\u4ef6\u64cd\u4f5c<\/strong><\/span><\/div>\n\u6267\u884cextundelete\u547d\u4ee4\u7684\u5f53\u524d\u76ee\u5f55\u5fc5\u987b\u662f\u53ef\u5199\u7684\u3002<\/p>\n
1\u3001\u67e5\u770b\u8981\u6062\u590d\u6587\u4ef6\u7684\u5206\u533a\u7684\u6587\u4ef6\u7cfb\u7edf<\/p>\n
df -Th<\/pre>\n2\u3001\u5bf9\u8981\u6062\u590d\u6587\u4ef6\u7684\u5206\u533a\u89e3\u9664\u6302\u8f7d<\/p>\n
umount \/mnt<\/pre>\n3\u3001\u67e5\u770b\u53ef\u4ee5\u6062\u590d\u7684\u6570\u636e<\/p>\n
\u6307\u5b9a\u8bef\u5220\u6587\u4ef6\u7684\u5206\u533a\u8fdb\u884c\u67e5\u627e \u6700\u540e\u4e00\u5217\u6807\u8bb0\u4e3aDeleted\u7684\u6587\u4ef6\uff0c\u5373\u4e3a\u5220\u9664\u4e86\u7684\u6587\u4ef6<\/p>\n
extundelete \/dev\/vdb1 --inode 2 \uff08\u6839\u5206\u533a\u7684inode\u503c\u662f2\uff09<\/pre>\n4\u3001\u6062\u590d\u5355\u4e2a\u76ee\u5f55<\/p>\n
\u6307\u5b9a\u8981\u6062\u590d\u7684\u76ee\u5f55\u540d \u5982\u679c\u662f\u7a7a\u76ee\u5f55\uff0c\u5219\u4e0d\u4f1a\u6062\u590d<\/p>\n
extundelete \/dev\/vdb1 --restore-directory ferris<\/pre>\n\u5f53\u6267\u884c\u6062\u590d\u6587\u4ef6\u7684\u547d\u4ee4\u540e\uff0c\u4f1a\u5728\u6267\u884c\u547d\u4ee4\u7684\u5f53\u524d\u7684\u76ee\u5f55\u4e0b\u751f\u6210RECOVERED_FILES\u76ee\u5f55\uff0c\u6062\u590d\u7684\u6587\u4ef6\u90fd\u4f1a\u653e\u5165\u6b64\u76ee\u5f55\u4e2d\u3002\u5982\u672a\u751f\u6210\u76ee\u5f55\uff0c\u5373\u4e3a\u5931\u8d25\u3002<\/p>\n
5\u3001\u6062\u590d\u5355\u4e2a\u6587\u4ef6<\/p>\n
\u6307\u5b9a\u8981\u6062\u590d\u7684\u6587\u4ef6\u540d \u5982\u679c\u51e0k\u5927\u5c0f\u7684\u5c0f\u6587\u4ef6\uff0c\u6709\u5f88\u5927\u51e0\u7387\u6062\u590d\u5931\u8d25<\/p>\n
extundelete \/dev\/vdb1 --restore-file openssh-7.7p1.tar.gz<\/pre>\n6\u3001\u6062\u590d\u5168\u90e8\u5220\u9664\u7684\u6587\u4ef6<\/p>\n
\u65e0\u9700\u6307\u5b9a\u6587\u4ef6\u540d\u6216\u76ee\u5f55\u540d\uff0c\u6062\u590d\u5168\u90e8\u5220\u9664\u7684\u6570\u636e<\/p>\n
extundelete \/dev\/vdb1 --restore-all<\/pre>\n","protected":false},"excerpt":{"rendered":"\u8fd9\u4e2a\u547d\u4ee4\u5b9e\u9645\u4e0a\u5e76\u4e0d\u80fd\u76f4\u63a5\u7528\u6765\u6062\u590d\u6587\u4ef6\uff0c\u4e0d\u8fc7\u5b83\u53ef\u4ee5\u5217\u51fa\u88ab\u5404\u79cd\u8fdb\u7a0b\u6253\u5f00\u7684\u6587\u4ef6\u4fe1\u606f\u3002 \u914d\u5408\u5176\u4ed6\u547d\u4ee4\uff0c\u4ece\/proc\u76ee\u5f55 […]<\/p>\n","protected":false},"author":1469,"featured_media":234591,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-234579","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\/234579","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\/1469"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=234579"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/234579\/revisions"}],"predecessor-version":[{"id":234612,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/234579\/revisions\/234612"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/234591"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=234579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=234579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=234579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}