LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-27-2007, 11:41 AM   #1
mr_sarge
LQ Newbie
 
Registered: Oct 2005
Location: Saint-Hyacinthe, Quebec, Canada
Distribution: Ubuntu server 8.04
Posts: 21

Rep: Reputation: 16
recover home directory after userdel


Write me it's possible... pls

I've deleted the bad user and important data where in is home folder.

Is there a way to recover it ?

Thanks
 
Old 11-27-2007, 01:05 PM   #2
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
Not sure if you can recreate the home folder or not.

But you might be able to recover the data by plugging the drive into another machine and using photorec and/or foremost. They're data recovery tools for when you accidentally mess up your drive or reformat it. But it should work here as well.

The only downside is that you have to manually sift through all the data and your filenames will be lost.
 
Old 11-27-2007, 07:56 PM   #3
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,327

Rep: Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099
Here's the question: does /home/username still exist ... or not?

If userdel nuked that directory, then I am very sorry to say that ... yer scro-o-o'd...

But if, by some happy happenstance, the directory does exist, then you can mv the files anywhere you want them to go, and chown them into the ownership of whomever you please.
 
Old 11-28-2007, 07:00 AM   #4
mr_sarge
LQ Newbie
 
Registered: Oct 2005
Location: Saint-Hyacinthe, Quebec, Canada
Distribution: Ubuntu server 8.04
Posts: 21

Original Poster
Rep: Reputation: 16
After some search, I've try "photorec". Lots of data where recovered but nothing that was in that folder.

I've also try a grep: "grep --binary-files=text -a50 -b300 "<?php" >/mnt/SomeNetwork"

This has recover most php file of this user in a huge 250mb text file ! Unfortunably, picture and all other file where lost but it's no big deal.

Thank you
 
Old 11-28-2007, 07:31 AM   #5
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
I've used foremost before and it's very good. Maybe try that, assuming while using photorec you didn't dump the recovered data to the same drive you were recovering from in which case you probably overwrote any other recoverable data.
 
Old 11-28-2007, 11:51 AM   #6
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by mr_sarge View Post
After some search, I've try "photorec". Lots of data where recovered but nothing that was in that folder.
Did you look at the data individually? All the filenames will have been lost and it will just have a generic filename. It finds photos especially well, but like I said, you can't just search a directory, it'll scan the whole hard disk. You'll even get images from your internet history...
 
Old 11-28-2007, 12:07 PM   #7
mr_sarge
LQ Newbie
 
Registered: Oct 2005
Location: Saint-Hyacinthe, Quebec, Canada
Distribution: Ubuntu server 8.04
Posts: 21

Original Poster
Rep: Reputation: 16
I've Switched the filter to only show up jpeg, gif, png and PSD.

8 hours remaining !!!

8000 file copied for now. I've found some that was in the user home folder.

I'll let it go...
 
Old 11-28-2007, 01:10 PM   #8
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
You are writing to a separate drive or partition, correct? Otherwise, the program will find the files it just copied over and over and over again. Not to mention it might overwrite some of the data you're trying to recover...
 
Old 11-28-2007, 02:17 PM   #9
mr_sarge
LQ Newbie
 
Registered: Oct 2005
Location: Saint-Hyacinthe, Quebec, Canada
Distribution: Ubuntu server 8.04
Posts: 21

Original Poster
Rep: Reputation: 16
i'm writing ont a network drive
 
Old 11-29-2007, 08:43 AM   #10
mr_sarge
LQ Newbie
 
Registered: Oct 2005
Location: Saint-Hyacinthe, Quebec, Canada
Distribution: Ubuntu server 8.04
Posts: 21

Original Poster
Rep: Reputation: 16
Hi,

Just want to thank you all.

I have successfully recover majority of lost file. We now have a little job of find and rename files !!

Discovered something about photorec.

I have first search with default option (all filter on) and restored 35 000 files. Didn't get what we had lost.

I have then made another search with only gif, jpg, png and PSD filter on. recover 23 000 images. the want we need where in there.

After that, made an txt file search (txt, html, php) and recover 55 000 files for a total of 78 000 files compared to 35 000 the first time !

If you have to recover something with photorec, search seperatly for each type of file you need !

Good day

SaRgE
 
  


Reply


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Active Directory User Cannot Write to Samba Home Directory jonwatson Linux - Networking 2 12-19-2006 12:40 PM
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 02:37 PM
How to protect a file/directory in your home login directory (RH Linux) jitsenho Linux - Security 9 07-03-2006 11:08 PM
recover user and home dir powadha Linux - General 5 04-16-2004 09:08 AM
Deleted Directory, how to Recover ?? GT I.N.C Linux - General 5 11-19-2002 08:20 AM


All times are GMT -5. The time now is 10:25 AM.

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