{"id":111624,"date":"2024-12-05T23:04:11","date_gmt":"2024-12-05T15:04:11","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=111624"},"modified":"2024-12-05T23:04:11","modified_gmt":"2024-12-05T15:04:11","slug":"dd-ext3grep-extundelete","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/dd-ext3grep-extundelete.html","title":{"rendered":"\u7b80\u5355\u4e86\u89e3dd\u3001ext3grep\u3001extundelete\u4e0elinux\u6570\u636e\u6062\u590d"},"content":{"rendered":"
\u73b0\u7f51\u4e00\u53f0SUSE\u4e3b\u673a\uff0c\u88ab\u540c\u4e8b\u4e0d\u5c0f\u5fc3\u5e72\u6389\u4e86\u4e00\u4e2a\u6587\u4ef6\u3002\u4e0d\u8fc7\u5728\u7528\u60f3\u901a\u8fc7ext3grep\u6216extundelete\u8fd9\u7c7b\u5de5\u5177\u8fdb\u884c\u6062\u590d\u65f6\uff0c\u53d1\u73b0\u5728\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\uff0c\u603b\u662f\u63d0\u793a\u201cconfigure: error: Can't find ext2fs library\u201d\u3002\u56e0\u4e3a\u5728SUSE\u6e90\u91cc\u6ca1\u6709e2fsprogs-devel\u3001e2fsprogs-libs\u5305\uff0c\u5728\u901a\u8fc7\u6e90\u7801\u5b89\u88c5e2fsprogs\u540e\uff0c\u53d1\u73b0\u8fd8\u662f\u6709\u8be5\u95ee\u9898\u3002\u800credhat\u4e0a\u4e0d\u5b58\u5728\u8be5\u95ee\u9898\uff0credhat\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u5b89\u88c5\u4f9d\u8d56\uff1a<\/p>\n
yum install e2fsprogs e2fsprogs-libs e2fsprogs-devel\r\n<\/pre>\n\u6ce8\uff1a\u65e0\u8bbaext3grep\u8fd8\u662fextundelete\uff0c\u90fd\u9700\u8981\u4f9d\u8d56\u548c\u5e95\u5c42\u6587\u4ef6\u7cfb\u7edf\u76f8\u5173\u7684\u5305e2fsprogs e2fsprogs-libs e2fsprogs-devel \u3002<\/p>\n
<\/a><\/p>\n
\u4e8c\u3001\u5f02\u673a\u6062\u590d\u8bbe\u60f3\u4e0e\u64cd\u4f5c<\/strong><\/div>\n1\u3001\u5f02\u673a\u6062\u590d\u7406\u8bba\u57fa\u7840<\/strong><\/span><\/div>\n\u5148\u8bf4\u4e0bLINUX\u4e0a\u7684\u6587\u4ef6\u5220\u9664rm\uff0c\u5b9e\u9645\u4e0a rm \u6587\u4ef6\u5e76\u672a\u4ece\u78c1\u76d8\u4e0a\u6e05\u7406\uff0c\u53ea\u662f\u5c06\u5176\u6240\u5728\u7684\u5757\uff08inode\uff09\u8fdb\u884c\u4e86\u91cd\u65b0\u6807\u8bb0\uff0c\u6807\u8bb0\u4e3a\u53ef\u64e6\u9664\u53ef\u5199\u3002\u800c\u6570\u636e\u6062\u590d\u8f6f\u4ef6\u5c31\u662f\u8bfb\u53d6\u5230\u8fd9\u4e9binode\uff0c\u518d\u4ece\u800c\u6062\u590d\u76f8\u5e94\u7684\u6570\u636e\uff08\u524d\u63d0\u662f\u672a\u88ab\u5176\u4ed6\u6570\u636e\u8986\u5199\u7684\u60c5\u51b5\u4e0b\uff09\u3002<\/p>\n
\u5728LINUX\u5728\u6709\u4e00\u4e2a\u6309\u6570\u636e\u5757\u8fdb\u884c\u8bfb\u53d6\u5907\u4efd\u7684\u5de5\u5177dd\uff0c\u65e2\u7136dd\u662f\u6309\u6570\u636e\u5e93\u8bfb\u53d6\u5907\u4efd\u7684\uff0c\u90a3\u5176\u5728\u4ed6\u6570\u636e\u76d8\u6216\u5206\u533a\u4e0a\u8fd8\u539f\u65f6\uff0c\u4e5f\u4f1a\u628a rm \u5220\u9664\u7684\u6570\u636e\u5757\u540c\u6837\u5199\u8fc7\u53bb\u3002\u5728\u53e6\u4e00\u53f0\u53ef\u4ee5\u6b63\u5e38\u5b89\u88c5\u6062\u590d\u8f6f\u4ef6\u7684\u4e3b\u673a\u4e0a\uff0c\u901a\u8fc7\u76f8\u5e94\u7684\u6062\u590d\u8f6f\u4ef6\u626b\u63cf\u5c31\u53ef\u4ee5\u6062\u590d\u6570\u636e\u4e86\u3002<\/p>\n
2\u3001\u78c1\u76d8\u548c\u5206\u533a\u6062\u590d<\/strong><\/span><\/div>\n\u6e90\u4e3b\u673a\uff1aSUSE\u88ab\u5220\u9664\u6570\u636e\u4e3b\u673a\uff08\/dev\/sda6\uff09<\/p>\n
\u76ee\u6807\u673a\uff1aredhat\u4e3b\u673a\uff08\/dev\/sda2\uff09<\/p>\n
\u6ce8\u610f\uff0c\u8fd9\u91cc\u6709\u4e00\u4e2a\u8981\u6c42\uff0c\u76ee\u6807\u4e3b\u673a\u7684\/sda2\u7a7a\u95f4\u4e00\u5b9a\u8981\u5927\u4e8e\u6216\u7b49\u4e8esda6\u3002\u65b0\u8001\u4e3b\u673a\u4e0a\u5206\u533a\u683c\u5f0f\u8981\u4e00\u81f4\uff0c\u8981\u540c\u4e3aext3 \u6216 ext4<\/p>\n
# \u8001\u4e3b\u673a\u4e0a\r\ndd if=\/dev\/sda6 | gzip -9 > \/mnt\/tmpback.img.gz\r\n# \u65b0\u4e3b\u673a\u4e0a\r\nmkfs.ext3 \/dev\/sda2\r\nzcat \/tmp\/tmpback.img.gz | dd of=\/dev\/sda2\r\nextundelete \/dev\/sda2 --inode 2\r\n<\/pre>\n\u4e0a\u9762\u5728\u5907\u4efd\u7684\u65f6\u5019\u4f7f\u7528\u4e86gzip\u8fdb\u884c\u6700\u9ad8\u7ea7\u522b\u7684\u538b\u7f29\uff0c\u7531\u4e8e dd\u548cgzip\u90fd\u53ea\u80fd\u4f7f\u7528\u5355\u6838\u8d44\u6e90\uff0c\u6240\u4ee5\u64cd\u4f5c\u4f1a\u6bd4\u8f83\u6162\uff0c\u5982\u679c\u7a7a\u95f4\u8db3\u591f\uff0c\u65b0\u8001\u4e3b\u673a\u4e4b\u95f4\u7f51\u7edc\u4f20\u8f93\u53c8\u5feb\u7684\uff0c\u53ef\u4ee5\u76f4\u63a5 dd if=\/dev\/sda6 of=\/opt\/tmpbackup.dd \u4e0d\u538b\u7f29\u5907\u4efd\uff0c\u5907\u4efd\u51fa\u7684\u5927\u5c0f\u4f1a\u548c\u539f\u6765\u7684\u78c1\u76d8\u5206\u533a\u5927\u5c0f\u4e00\u6837\u5927\u3002<\/p>\n
\u4e09\u3001\u6062\u590d\u547d\u4ee4<\/strong><\/div>\n1\u3001extundelete\u6062\u590d<\/strong><\/span><\/div>\n\u6062\u590d\u5355\u4e2a\u6587\u4ef6\uff0c\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u751f\u6210\u4e00\u4e2aRECOVERED_FILES\u76ee\u5f55\uff0c\u91cc\u9762\u4fdd\u5b58\u5df2\u7ecf\u6062\u590d\u7684\u6587\u4ef6\uff1a\r\nextundelete \/dev\/sda2 --restore-file passwd\r\n\u6839\u636einode\u8fdb\u884c\u6062\u590d\r\nextundelete \/dev\/sda2 --restore-inode\r\n\u6062\u590d\u5355\u4e2a\u76ee\u5f55\uff1a\r\nextundelete \/dev\/sda2 --restore-directory \/mongodb\r\n\u6062\u590d\u6240\u6709\u8bef\u5220\u6587\u4ef6\uff1a\r\nextundelete \/dev\/sda2 --restore-all\r\n<\/pre>\nextundelete\u8fd8\u53ef\u4ee5\u5b9e\u73b0\u6062\u590d\u67d0\u4e2a\u65f6\u95f4\u6bb5\u7684\u6570\u636e\u3002\u53ef\u4ee5\u901a\u8fc7\u201c--after\u201d\u548c\u201c--before\u201d\u53c2\u6570\u5b9e\u73b0\uff01<\/p>\n
2\u3001ext3grep\u6062\u590d<\/strong><\/span><\/div>\n\u67e5\u8be2\u9700\u8981\u6062\u590d\u7684\u6570\u636e\u4fe1\u606f\uff1a\r\n# ext3grep \/mydata\/disk1 --ls --inode 2\r\n\u6062\u590d\u5355\u4e2a\u6587\u4ef6\r\n# ext3grep \/mydata\/disk1 --restore-file ext3grep.txt\r\n\u6839\u636einode\u6062\u590d\r\n# ext3grep \/mydata\/disk1 --restore-inode 12\r\n\u6062\u590d\u6240\u6709\u6587\u4ef6\r\n# ext3grep \/mydata\/disk1 --restore-all\r\n<\/pre>\n3\u3001ext3grep\u4e0eextundelete<\/strong><\/span><\/div>\nextundelete\uff1a\u626b\u63cfinode\u548c\u6062\u590d\u6570\u636e\u540c\u65f6\u8fdb\u884c\uff0c\u56e0\u6b64\u6062\u590d\u901f\u5ea6\u5f88\u5feb\u3002\u652f\u6301\u5355\u4e2a\u6587\u4ef6\uff0c\u5355\u4e2a\u76ee\u5f55\u548c\u5b8c\u6574\u78c1\u76d8\u6062\u590d\uff1b<\/p>\n
ex3grep\uff1a\u53ea\u80fd\u6062\u590dex3\u7684\u6570\u636e\uff0c\u4e0d\u652f\u6301\u76ee\u5f55\u6062\u590d\u548c\u65f6\u95f4\u6062\u590d\u3002<\/p>\n
\u56db\u3001dd\u7684\u5907\u4efd\u7684\u597d\u5904<\/strong><\/div>\ndd\u5907\u4efd\u51fa\u6765\u518d\u5728\u5176\u4ed6\u4e3b\u673a\u4e0a\u6062\u590d\u8fd8\u6709\u4e00\u4e2a\u597d\u5904\uff0c\u5373\u4f7f\u5728\u6062\u590d\u8fc7\u7a0b\u4e2d\u6709\u4e0d\u5f53\u64cd\u4f5c\uff0c\u6211\u4eec\u4ecd\u4fdd\u7559\u4e00\u4efd\u6e90\u6570\u636e\uff0c\u4f9d\u7136\u53ef\u4ee5\u901a\u8fc7\u8fd8\u539f\u540e\uff0c\u518d\u7528\u5176\u4ed6\u5de5\u5177\u626b\u63cf\u3002<\/p>\n
\u7279\u522b\u9700\u8981\u6ce8\u610f\u7684\u4e00\u70b9\uff1a\u4e00\u4f46\u4e3b\u673a\u53d1\u751f\u610f\u5916\u5220\u9664\u7684\uff0c\u4e00\u5b9a\u8981\u5148\u5c06\u5f53\u524d\u5206\u533a\u7f6e\u4e3a\u53ea\u8bfb\uff0c\u5982\uff1a mount -o remount,ro \/tmp<\/span><\/strong> \u3002<\/p>\n
\n\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.361way.com\/rm-dd-ext3grep-extundelete\/5729.html<\/a><\/p>\n