{"id":797,"date":"2011-11-09T15:10:22","date_gmt":"2011-11-09T07:10:22","guid":{"rendered":"http:\/\/www.awaysoft.com\/taor\/?p=797"},"modified":"2011-11-09T15:10:22","modified_gmt":"2011-11-09T07:10:22","slug":"%e8%bd%aclinux%e4%b8%8b%e5%91%bd%e4%bb%a4rm-rf%e7%9a%84%e8%a1%a5%e6%95%91%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/actom.me\/blog\/%e8%bd%aclinux%e4%b8%8b%e5%91%bd%e4%bb%a4rm-rf%e7%9a%84%e8%a1%a5%e6%95%91%e6%96%b9%e6%b3%95.html","title":{"rendered":"[\u8f6c]Linux\u4e0b\u547d\u4ee4rm -rf\u7684\u8865\u6551\u65b9\u6cd5"},"content":{"rendered":"<p>\u5b58\u4e0b\u5f53\u7b14\u8bb0\u3002\u3002\u3002<\/p>\n<p>\u5728linux\u4e0brm -rf \u662f\u4e00\u4e2a\u5f88\u53ef\u6015\u7684\u547d\u4ee4\uff0c\u56e0\u4e3a\u4e0b\u8fbe\u8fd9\u4e2a\u547d\u4ee4\u610f\u5473\u7740\u4e00\u65e6\u5220\u9664\u7684\u6587\u4ef6\u662f\u65e0\u6cd5\u633d\u56de\u7684\uff0c\u4e8b\u5b9e\u662f\u5982\u6b64\u5417\uff1f\u771f\u7684\u6ca1\u6709\u8865\u6551\u63aa\u65bd\u4e86\u5417\uff1f\u7b54\u6848\u662f\u59d4\u5a49\u4e86\uff0c\u5728\u4e00\u5b9a\u7684\u6761\u4ef6\u4e0b\u53ef\u4ee5\u8865\u6551 \uff0c\u5927\u5bb6\u53ef\u80fd\u719f\u6089windows\u4e0b\u5220\u9664\u7684\u8865\u6551\u63aa\u65bd\u662f\u901a\u8fc7\u76f8\u5173\u7684\u8f6f\u4ef6\u5b9e\u73b0\u7684\uff0c\u5728linux\u4e0b\u540c\u6837\u53ef\u4ee5\u505a\u5230\u8865\u6551\uff0c\u4f46\u662f\u6709\u4e2a\u5927\u524d\u63d0\uff1a\u5c31\u662f\u4e0d\u80fd\u6709\u8986\u76d6\u7684\u52a8\u4f5c\uff08\u610f\u601d\u5c31\u662f\u5728\u5c1d\u8bd5\u6062\u590d\u5220\u9664\u7684\u6570\u636e\u524d\uff0c\u5220\u9664\u6587\u4ef6\u7684\u76ee\u5f55\u5185\u4e0d\u80fd\u5b58\u653e\u65b0\u4e1c\u897f\uff09\uff0c\u4e0d\u7136\u8986\u76d6\u591a\u5c11\u5c31\u635f\u5931\u591a\u5c11\uff01<\/p>\n<p>\u8fd9\u91cc\u7528\u5230\u7684\u5957\u4ef6\u662fext3grep\u3001\u7cfb\u7edf\u5fc5\u987b\u9ed8\u8ba4\u7684\u5b89\u88c5\u4e0ae2fsprogs-libs-1.39-23.el5e\u30012fsprogs-devel-1.39-23.el5\u3001e2fsprogs-1.39-23.el5\u8fd9\u4e9b\u8f6f\u4ef6<br \/>\n[root@localhost ~]# rpm -qa|grep e2fsprogs<br \/>\ne2fsprogs-libs-1.39-23.el5<br \/>\ne2fsprogs-devel-1.39-23.el5<br \/>\ne2fsprogs-1.39-23.el5<br \/>\n [root@localhost ~]# ll ext3grep-0.10.2.tar.gz<br \/>\n-rw-r&#8211;r&#8211; 1 root root 236364 Oct 17  2011 ext3grep-0.10.2.tar.gz<\/p>\n<p>[root@localhost ~]# tar zxvf ext3grep-0.10.2.tar.gz<br \/>\n[root@localhost ~]# cd ext3grep-0.10.2<br \/>\n[root@localhost ext3grep-0.10.2]# .\/configure<br \/>\n[root@localhost ext3grep-0.10.2]# make &#038;&#038; make install<br \/>\n[root@localhost ~]# ll \/usr\/local\/bin<br \/>\ntotal 2656<br \/>\n-rwxr-xr-x 1 root root 2709704 Oct 15 04:46 ext3grep   \/\/www.linuxidc.com\u8fd9\u53e5\u662f\u90a3\u4e2a\u53ef\u6267\u884c\u6587\u4ef6<\/p>\n<p>\u63a5\u4e0b\u6765\u6f14\u793a\u4e00\u4e2a\u8865\u6551\u7684\u8fc7\u7a0b\u5b9e\u4f8b<\/p>\n<p>[root@localhost ~]# mkdir \/data\/ \/ixdba\/<\/p>\n<p>[root@localhost data]# dd if=\/dev\/zero of=data-disk bs=1M count=105<br \/>\n[root@localhost data]# mkfs.ext3 data-disk   \/\/\u683c\u5f0f\u4e3aext3\u7684\u6587\u4ef6\u7cfb\u7edf\uff0c\u5728\u51fa\u73b0\u7684\u63d0\u793a\u7b26\u5904\u8f93\u5165y<br \/>\n[root@localhost data]# mount -o loop \/data\/data-disk \/ixdba\/  \/\/\u6302\u8f7d<br \/>\n[root@localhost data]# cp \/etc\/host* \/ixdba\/  \/\/\u5f80\u91cc\u8fb9\u653e\u6587\u4ef6<br \/>\n[root@localhost data]# cp \/etc\/passwd \/ixdba\/<br \/>\n[root@localhost data]# cd \/ixdba\/<br \/>\n[root@localhost data]# rm -rf *   \/\/\u5236\u9020\u5220\u9664\u7684\u52a8\u4f5c<br \/>\n[root@localhost data]# cd \/data\/<\/p>\n<p>[root@localhost data]# ext3grep \/data\/data-disk &#8211;ls &#8211;inode 2   \/\/\u67e5\u770b\u4e22\u5931\u7684\u6587\u4ef6<\/p>\n<p>[root@localhost data]# ext3grep \/data\/data-disk &#8211;restore-file passwd  \/\/\u4ec5\u4ec5\u6062\u590dpasswd\u8fd9\u4e2a\u6587\u4ef6<br \/>\n[root@localhost data]# ext3grep \/data\/data-disk &#8211;restore-all    \/\/\u6062\u590d\u7684\u52a8\u4f5c\uff0c\u5168\u90e8\u6062\u590d<\/p>\n<p>[root@localhost data]# ls<br \/>\ndata-disk  data-disk.ext3grep.stage1  data-disk.ext3grep.stage2  RESTORED_FILES<br \/>\n[root@localhost data]# ll RESTORED_FILES\/       \/\/\u6240\u6709\u6062\u590d\u7684\u6587\u4ef6\u5168\u5728\u8fd9\u4e2a\u6587\u4ef6\u5939\u91cc\u5b58\u653e\uff0c\u90fd\u627e\u56de\u6765\u4e86<br \/>\ntotal 48<br \/>\n-rw-r&#8211;r&#8211; 1 root root   17 Oct 15 06:03 host.conf<br \/>\n-rw-r&#8211;r&#8211; 1 root root  187 Oct 15 06:03 hosts<br \/>\n-rw-r&#8211;r&#8211; 1 root root  161 Oct 15 06:03 hosts.allow<br \/>\n-rw-r&#8211;r&#8211; 1 root root  347 Oct 15 06:03 hosts.deny<br \/>\ndrwx&#8212;&#8212; 2 root root 4096 Oct 15 06:04 lost+found<br \/>\n-rw-r&#8211;r&#8211; 1 root root 1635 Oct 15 06:03 passwd<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b58\u4e0b\u5f53\u7b14\u8bb0\u3002\u3002\u3002 \u5728linux\u4e0brm -rf \u662f\u4e00\u4e2a\u5f88\u53ef\u6015\u7684\u547d\u4ee4\uff0c\u56e0\u4e3a\u4e0b\u8fbe\u8fd9\u4e2a\u547d &#8230; <a class=\"more-link\" href=\"https:\/\/actom.me\/blog\/%e8%bd%aclinux%e4%b8%8b%e5%91%bd%e4%bb%a4rm-rf%e7%9a%84%e8%a1%a5%e6%95%91%e6%96%b9%e6%b3%95.html\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/posts\/797"}],"collection":[{"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/comments?post=797"}],"version-history":[{"count":1,"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/posts\/797\/revisions"}],"predecessor-version":[{"id":798,"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/posts\/797\/revisions\/798"}],"wp:attachment":[{"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/media?parent=797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/categories?post=797"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actom.me\/blog\/wp-json\/wp\/v2\/tags?post=797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}