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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-27-2007, 11:41 AM
|
#1
|
|
LQ Newbie
Registered: Oct 2005
Location: Saint-Hyacinthe, Quebec, Canada
Distribution: Ubuntu server 8.04
Posts: 21
Rep:
|
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
|
|
|
|
11-27-2007, 01:05 PM
|
#2
|
|
Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092
|
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.
|
|
|
|
11-27-2007, 07:56 PM
|
#3
|
|
Senior Member
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 4,554
|
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.
|
|
|
|
11-28-2007, 07:00 AM
|
#4
|
|
LQ Newbie
Registered: Oct 2005
Location: Saint-Hyacinthe, Quebec, Canada
Distribution: Ubuntu server 8.04
Posts: 21
Original Poster
Rep:
|
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
|
|
|
|
11-28-2007, 07:31 AM
|
#5
|
|
Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,624
|
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.
|
|
|
|
11-28-2007, 11:51 AM
|
#6
|
|
Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092
|
Quote:
Originally Posted by mr_sarge
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...
|
|
|
|
11-28-2007, 12:07 PM
|
#7
|
|
LQ Newbie
Registered: Oct 2005
Location: Saint-Hyacinthe, Quebec, Canada
Distribution: Ubuntu server 8.04
Posts: 21
Original Poster
Rep:
|
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...
|
|
|
|
11-28-2007, 01:10 PM
|
#8
|
|
Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092
|
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...
|
|
|
|
11-28-2007, 02:17 PM
|
#9
|
|
LQ Newbie
Registered: Oct 2005
Location: Saint-Hyacinthe, Quebec, Canada
Distribution: Ubuntu server 8.04
Posts: 21
Original Poster
Rep:
|
i'm writing ont a network drive
|
|
|
|
11-29-2007, 08:43 AM
|
#10
|
|
LQ Newbie
Registered: Oct 2005
Location: Saint-Hyacinthe, Quebec, Canada
Distribution: Ubuntu server 8.04
Posts: 21
Original Poster
Rep:
|
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
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:06 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|