Today's Question: 


Different programming are similar in helping people build staff work as people want them to. But they all have their own features which differentiate them from other programming languages. The language type may be different, for example Java is OOP, some may have different syntax. A programming motto usually can best describe the characteristic of the programming language. For example, "Write once Run everywhere" for Java.Do you know any other programming language motto?
Do you know the mottos of programmig languages?
Description My Answer

Technical Article => Operating System =>  Linux/Unix

Recover deleted file in Linux EXT3 file system

Source : sonic0002    Date : 2013-08-16 07:06:45  

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.

tar zxvf ext3grep-0.10.1.tar.gz
cd ext3grep-0.10.1
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 :

Save as PDF Mark as read Mark as important
By clicking the "Mark as read" button, this article will be marked as read. It will be removed from the homepage's latest news and the article list on the "Technical article" page in following visits and it will be put to your read list which you can find in "Amin->Article read list". There you can unmark the read articles.
By clicking the "Mark as important" button, this article will be put to your important article list which you can find in "Amin->Article important list". Later when you want reread this article, it's easier for you to find it by checking the "Article important list".

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

Share on Facebook  Share on Twitter  Share on Google+  Share on Weibo  Share on Reddit  Share on Digg  Share on Tumblr    Delicious 

 Previous : If we use programming language names as building names
 Next : Art of code comment

  ::Related Articles

  ::Comment Zone  (Total 0 comment)

No comment for this article.



:: Other versions

No other versions available yet.

:: Recent articles

:: Most read

:: Contribute

Want to share with the world your understanding about technology? Want to record the process you solve a technical problem? Want to make the world benefit from your understanding and solution? Write them down. You make the world better, the world makes us better.

Write article

:: Find us

Back to top