Today's Question:  What are bad parts of Windows 10?       GIVE A SHOUT

Technical Article => Operating System =>  Linux/Unix

Recover deleted file in Linux EXT3 file system

 sonic0002     2013-08-16 07:06:45      3,057    0    0

Environment : CentOS 5.3 x86_64, /dev/sdb1 is the data segment /data0. EXT3 file system.

Problem : /data0/tcsql/cankao/phpcws-1.5.0/httpcws.cpp is deleted mistakenly and httpcws.cpp is not backed up. It will take much time to rewrite this program again. So we must recover it back.

debugfs is feasible in EXT2 file system, but in EXT3 file system, it's not very useful. There is one open source software called ext3grep which can help us recover deleted file in EXT3 file system. The recovery steps are:

1. Install ext3grep.

wget http://ext3grep.googlecode.com/files/ext3grep-0.10.1.tar.gz
tar zxvf ext3grep-0.10.1.tar.gz
cd ext3grep-0.10.1
./configure
make
make install

2. unmount /data0 segement

umount /data0

if it promts it's busy, please kill the process which is accessing this directory now, then unmount it:

fuser -k /data0
umount /data0

3. Check all Inode,this process may take a few minutes.

ext3grep /dev/sdb1 --ls --inode 2

点击在新窗口中浏览此图片

4. Check Inode recursively to see whether we can find the httpcws.cpp

点击在新窗口中浏览此图片

点击在新窗口中浏览此图片

5. Recover /data0/tcsql/cankao/phpcws-1.5.0/httpcws.cpp

ext3grep /dev/sdb1 --restore-file tcsql/cankao/phpcws-1.5.0/httpcws.cpp

点击在新窗口中浏览此图片

If you see below message, it means the recovery is successful:

Restoring tcsql/cankao/phpcws-1.5.0/httpcws.cpp

the current directory where the ext3grep command is executed will have a new generated directory named RESTORED_FILES. You can find tcsql/cankao/phpcws-1.5.0/httpcws.cpp in this directory.

6 mount /data0

mount /dev/sdb1 /data0

Source : http://blog.s135.com/linux_ext3_undelete/

 Tags : Linux,EXT3,File recovery   Read(3,057) Comment(0) Version(0)

  SAVE AS PDF   MARK AS READ   MARK AS IMPORTANT

 RELATED


 COMMENT  (TOTAL 0 COMMENT)


No comment for this article.


Nickname  
Email 
Comment

I am looking for an IT support job

By sonic0002
When an IT support engineer goes to a new job interview, how does s/he describes her/his job experience? "Because there are no issues encountered after I deployed the application, so later I was fired and I am looking for a new job."

 CONTRIBUTE


Share your geeky stuff now.
You make the world better, the world makes us better.

 WRITE ARTICLE

 VERSION


No other version available yet.