Recover deleted file in Linux EXT3 file system
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
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:
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
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".
Previous : If we use programming language names as building names Next : Art of code comment
::Comment Zone (Total 0 comment)
:: Other versions
No other versions available yet.
:: Recent articles
- HeartBleed: OpenBSD now starts to clean up OpenSSL
- HeartBleed: Should C be blamed for the HeartBleed bug?
- HeartBleed: Inside the heart, what happens to a normal WEB user?
- Learning Python as your first programming language
- PHP Apache MySQL Set-up Note
- Hey, you may be happy to know these mottos about programming languages
- Tips for a better first-time hackathon experience
- <=> operator in MySQL
- Why does LinkedIn migrate to NodeJS from Ruby?
- more ►
:: Most read
- Cross Browser HTML5 Drag and Drop
- Sony is to release PlayStation4 in 2015
- GCC is compiled with C++ compiler
- TIOBE : C overtakes Java as the No.1 programming language
- 5 Free Open Source Chat Applications For Developers
- Which programming language should I learn first?
- Disposable Email address
- Why PHP is (so much) better than Ruby?
- Is Ubuntu becoming a big name in enterprise Linux servers?
- Great code is written twice (or more)
- more ►
:: Find us