Recover directory structure after "rm -rf *"

If none of the more specific forums is the right place to ask

Recover directory structure after "rm -rf *"

Postby lego » 2010-05-19 11:20

Hi,

Unfortunately, I deleted my /home/ directory by running "rm -rf *" accidentally. The partition (/dev/sda3/) has an ext3 filesystem. After deleting the /home directory, I shutted down the PC and rebooted from a RIPLinux liveUSB, which has some tools that allowed me to recover some files. However, what I would like to do is to recover the directory tree structure, rather than the files, in order to see which files I deleted.

What I exactly want is the following:
I would like to have the output of "ls -lR /home/" before deleting all the files, but the problem is that now the /home directory is empty.

I hope I have explained clearly what I would like to do, I still have to improve my english.

Any help would be much appreciated!!
lego
 
Posts: 56
Joined: 2008-01-09 09:43

Re: Recover directory structure after "rm -rf *"

Postby Telemachus » 2010-05-19 11:44

lego wrote:Hi,

Unfortunately, I deleted my /home/ directory by running "rm -rf *" accidentally. The partition (/dev/sda3/) has an ext3 filesystem. After deleting the /home directory, I shutted down the PC and rebooted from a RIPLinux liveUSB, which has some tools that allowed me to recover some files. However, what I would like to do is to recover the directory tree structure, rather than the files, in order to see which files I deleted.

What I exactly want is the following:
I would like to have the output of "ls -lR /home/" before deleting all the files, but the problem is that now the /home directory is empty.

I hope I have explained clearly what I would like to do, I still have to improve my english.

Any help would be much appreciated!!

If I understand you correctly, you can't get what you want.

You seem to want a directory listing for your home directory before you deleted everything. Since none of us (?!) have a home directory that looks exactly like yours, I don't think we can help. (If you wanted to know, say, the basic layout of /etc in Debian, someone could help with that, as a counter-example.)

Home directories begin life empty (or very nearly so - a few Bash configuration files are probably there by default), so I think only you can determine what it looked like - from memory or backups (if you have any).
"We have not been faced with the need to satisfy someone else's requirements, and for this freedom we are grateful."
Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System
User avatar
Telemachus
 
Posts: 4676
Joined: 2006-12-25 15:53

Re: Recover directory structure after "rm -rf *"

Postby lego » 2010-05-19 11:53

So you say it is impossible? I hope it isn't, I am searching for recovery tools and I am trying them. I can recover some files, but what I want is the directory listing.

I also thought that recover deleted files after "rm -rf *" was impossible, but in fact it IS possible!
I hope that recover the directory list is possible.

Any ideas?
lego
 
Posts: 56
Joined: 2008-01-09 09:43

Re: Recover directory structure after "rm -rf *"

Postby frostschutz » 2010-05-19 12:01

If you were using slocate / updatedb on that system, 'locate /home' could give you a listing of the files it found in the last iteration. The only other thing you could try would be backup superblocks but most likely they'll already be updated to the new situation (home deleted)... especially if you did a clean shutdown and, later, another readwrite mount, so that's grasping at straws that are not there...

Rethink your backup strategy...
User avatar
frostschutz
 
Posts: 68
Joined: 2010-05-10 22:56

Re: Recover directory structure after "rm -rf *"

Postby lego » 2010-05-19 13:17

frostschutz wrote:If you were using slocate / updatedb on that system, 'locate /home' could give you a listing of the files it found in the last iteration. The only other thing you could try would be backup superblocks but most likely they'll already be updated to the new situation (home deleted)... especially if you did a clean shutdown and, later, another readwrite mount, so that's grasping at straws that are not there...

Rethink your backup strategy...


That's exactly what I need!!
I have mounted the partition in read-only mode (though its better to have a backup copy of the partition before mountion it, p.ex. with dd), and "locate /home/ > list.txt" gave me the list which I was loking for.
However, this list may be quite outdated.
I'll play with dbugfs and try to improve the output that I need..

Thank you frostschutz!
lego
 
Posts: 56
Joined: 2008-01-09 09:43


Return to General Questions

Who is online

Users browsing this forum: No registered users and 10 guests

fashionable