Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto: Recover deleted files on ext3/4
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
fincoop
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2004
Posts: 131

PostPosted: Sun Apr 10, 2011 5:00 pm    Post subject: Howto: Recover deleted files on ext3/4 Reply with quote

Having hastily/accidently deleted many files.. i searched long and hard for an undelete solution. I struggled to find any other howto on the net. I have this to share, but was unable to verify it. Im my case it did restore a file that was about the same size, but the file was corrupted. I hope that it brings your files back, should cost you nothing to try it.

Commands needed: extundelete, debugfs. The former I definitely merged but was masked. The latter may have been existing in my Gentoo install.

Procedure:
Code:
$DEV = storage device where deleted file was
# Remember to stop any processes that are attached to this volume before continuing
mount -o remount,ro <$DEV>
debugfs <$DEV>

In Debugfs:
cd <directory where deleted file/dir was>
ls -d
# Note the inode of the deleted item that comes up in the list
quit

Restore:
cd <directory where you want the file recovered to>
extundelete --restore-inode <inode num above> <$DEV>

#If your file recovered, then:
mount -o remount,rw <$DEV>
# Start up processes that use this volume
# Else, you should leave the volume mounted RO and try to find some other recovery methods
# This method is exhaustive, make sure you have plenty of space on the target
extundelete --restore-all <$DEV>



Happy hunting.
Back to top
View user's profile Send private message
dberkholz
Retired Dev
Retired Dev


Joined: 18 Mar 2003
Posts: 1008
Location: Minneapolis, MN, USA

PostPosted: Tue Apr 12, 2011 9:51 pm    Post subject: Reply with quote

There's a few other options in the tree too, in app-forensics/ — magicrescue and foremost have both come in useful.
Back to top
View user's profile Send private message
orange_juice
Guru
Guru


Joined: 16 Feb 2006
Posts: 588
Location: Athens - Greece

PostPosted: Tue Apr 19, 2011 11:57 pm    Post subject: Reply with quote

Thanx! It worked charmingly!

Kind regards,
orange_juice
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum