{"id":326,"date":"2010-07-01T05:33:43","date_gmt":"2010-07-01T11:33:43","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=326"},"modified":"2020-03-30T01:54:04","modified_gmt":"2020-03-30T07:54:04","slug":"how-to-find-deleted-files-using-ext3grep","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/how-to-find-deleted-files-using-ext3grep\/","title":{"rendered":"How to find deleted files using EXT3GREP"},"content":{"rendered":"<p>1. Installing ext3grep<br \/>\nwget http:\/\/ext3grep.googlecode.com\/files\/ext3grep-0.7.0.tar.gz<br \/>\ntar -xvzf ext3grep-0.7.0.tar.gz<br \/>\ncd ext3grep<br \/>\n.\/configure<br \/>\nmake<\/p>\n<p><!--more--><\/p>\n<p>cd src<br \/>\n.\/ext3grep &#8211;help<br \/>\nDone, ext3grep is built and working<\/p>\n<p>3.Lets search for deleted folder:<br \/>\nEg: .\/ext3grep \/dev\/hda1 &#8211;search uaconsoleclientsample<br \/>\nExt3grep will find many deleted blocks, now we need to check each blocks to find exact block associated with our deleted folder.<br \/>\n4.Find exact block assosicated with our deleted folder by checking each block<br \/>\nEg: .\/ext3grep \/dev\/hda1 &#8211;ls &#8211;block 240017<br \/>\nUse this script to automate this checking process.<br \/>\n#!\/bin\/sh<\/p>\n<p>blocks=255079 336393 336518 336526 395434 395435 395457 737282 984250 1346129 1868670 1869273 1950436 3915933 3915935 4069411 4087953 4216611 4292193 4292196 4292275 4530219 4538370 4538371 4538372 4538376 4538378 4538382 4538385 4543743 4543750 4543752 4544514 4544517 4544528 4544539 4550683 4550707 4655509 4655533 4670417 4670423 4689385 4689746 4785120 5046823 6525842 7370457 7805912<\/p>\n<p># Replace above blocks with blocks found in step 3<\/p>\n<p>for block in $blocks; do<\/p>\n<p>.\/ext3grep \/dev\/hda1 ls block $block | tee -a output.txt<\/p>\n<p>done<br \/>\nThis script does the same procedure for each block in the list, shows the output on console and writes it to the file output.txt using tee. This way you can recheck the result later also in vim.<\/p>\n<p>Analyze the output.txt and find entries like<br \/>\n&#8220;Block 1869273 is a directory. The block is Allocated&#8221; and find all inode associated with this block<br \/>\n5.Check content of the block with inode from previous step<br \/>\nEg: .\/ext3grep \/dev\/hda1 &#8211;ls &#8211;inode 656495<br \/>\n6.Now just restore the files you want using the right inode.<br \/>\nEg: .\/ext3grep \/dev\/hda1 &#8211;restore-inode 2263308<\/p>\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n<p style=\"text-align: center;\"><!--HubSpot Call-to-Action Code --><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><!-- [if lte IE 8]><\/p>\n\n\n\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b\"><img decoding=\"async\" id=\"hs-cta-img-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b.png\" alt=\"Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '9d590242-d641-4383-94b4-8cfd62f0af6b', {}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Installing ext3grep wget http:\/\/ext3grep.googlecode.com\/files\/ext3grep-0.7.0.tar.gz tar -xvzf ext3grep-0.7.0.tar.gz cd ext3grep .\/configure make<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-326","post","type-post","status-publish","format-standard","hentry","category-technical-articles"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=326"}],"version-history":[{"count":4,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/326\/revisions"}],"predecessor-version":[{"id":4586,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/326\/revisions\/4586"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}