Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-16-2009, 11:06 AM   #1
Registered: Aug 2009
Posts: 537

Rep: Reputation: 32
How to restore a deleted directory?

Terrible, I just used rm -rf to delete a folder.

How can I restore it?
Old 09-16-2009, 11:11 AM   #2
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 67
There are recovery tools, but the first step is to turn off your computer!

Then boot from a live-cd and mount the drive READ ONLY.
Old 09-16-2009, 01:19 PM   #3
Registered: Aug 2009
Posts: 537

Original Poster
Rep: Reputation: 32
This solution seems quite complecate.

I haven't delete the original folder but mein own. I don't htink I have to mount the live-cd again.
Old 09-16-2009, 01:19 PM   #4
Registered: May 2008
Location: Romania
Distribution: Debian
Posts: 242

Rep: Reputation: 41
restore from backup ...

Old 09-16-2009, 01:44 PM   #5
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,077

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Originally Posted by thomas2004ch View Post
I haven't delete the original folder but mein own.
I have no idea what does that mean.

But every second that you continue using your drive mounted with write permissions you risk the old info being overwritten, and when that happens, there's no chance for recovery at all.

Being that said, you could use debugfs with its internal ls -d instruction to find the deleted files, but debugfs is *dangerous* unless you know what you are doing.
Old 09-16-2009, 01:56 PM   #6
Senior Member
Registered: Nov 2006
Distribution: Debian Squeeze SMP AMD64
Posts: 3,318

Rep: Reputation: 126Reputation: 126
Assuming that what you are trying to say is that you had a copy of another directory and you deleted that copy, then it's a simple issue of copying that original directory again.
Old 09-17-2009, 08:05 AM   #7
Registered: Aug 2009
Posts: 537

Original Poster
Rep: Reputation: 32
Sorry for misunderstanding. Here again:

I created a folder which contains sub-folders which contain files. Oversightly I deleted the folder. There is no copy or backup. Now I want to restore or recover it.
Old 09-17-2009, 08:22 AM   #8
Senior Member
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
As said before, shutdown the system and use Photorec or similar tools using the Live Cd. Photorec is available as tool built inside Trinity Rescue Kit.
Why you need to shutdown the system and not use it is already quite clearly explained.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Restore deleted "/etc/init.d" directory. Pimmy Debian 17 06-04-2008 11:21 AM
Restore deleted files Winanjaya Linux - Newbie 5 01-09-2007 02:23 AM
How can I restore a deleted /etc directory from installation disks? mikecoates Linux - Software 4 03-28-2006 05:31 AM
How to restore a deleted file satimis Linux - Newbie 1 09-12-2003 05:18 AM
how to restore deleted files ? ilyes Linux - General 3 08-01-2003 08:13 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:57 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration