LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-18-2008, 04:20 AM   #1
vjcarthek
LQ Newbie
 
Registered: Jul 2008
Posts: 3

Rep: Reputation: 0
Question data recovery in fedora 7


Hi,

I am new user of Linux and i use Fedora 7 due to official needs. Recently i added a new hard disk and mounted as dev/sdb1 and updated my fstab file too. I stored some important data in this drive.Last week i tried writing an .img to a compact flash card connected as dev/sdc1 but ended up in specifying the destination as /dev/sdb1. Now all my data that was present in /dev/sdb1 has gone.

Is there a way to get the data back?

Please help. Thanks in advance.

-Vijay
 
Old 07-18-2008, 04:54 AM   #2
vjcarthek
LQ Newbie
 
Registered: Jul 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Additional information on my post:- I used dd if=<source img path> of=/dev/sdb1
 
Old 07-18-2008, 05:04 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
Try to find if this can help you out.

http://www.canadiancontent.net/tech/...d/R-Linux.html
 
Old 07-18-2008, 05:45 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by linuxlover.chaitanya View Post
Try to find if this can help you out. (...)R-Linux.html
Not to smack you down for your reply and posting that link but how would that help him? If you must post links on this subject I would suggest next time you search Linuxquestions for terms like "file recovery" "undelete" and such and read a few of those threads because there's a huge difference between deleting files (unlink, journalling), reformatting a partition (filesystem structure change) and overwriting the filesystem structure and contents (equivalent to sort of uncontrolled, sloppy "wiping"). Much has been written about it to the point that you don't have to "try to find if it can help" but can say that overwriting a large chunk of diskspace means that items previously occupying that space are lost (partially if on the boundary of the write), that making a backup would be the first thing to do next, that recovering the partition table can be attempted with Testdisk and that for recovering the partial filesystem and files beyond the overwritten area often-used applications are Photorec and Foremost.
 
Old 07-18-2008, 05:53 AM   #5
FranDango
Member
 
Registered: Jun 2008
Posts: 101

Rep: Reputation: 15
'dd' has overwritten your partition for the length of the '.img' file. All content beyond that length is still valid, but not accessible. You will need to set up all meta-information (nodes, etc) again, somehow masking out the over-written part. This needs an amount of skills and time that is usually out of question, unless your data is extremely important and worth a few thousand USD.

As an alternative you could write the hard-disk contents to an image file with dd, then browse that (large) file with a hex-editor or rather a custom program to search for a few specified file-types that you need. Some files like JPEG, TIFF, etc have easy to trace file headers and predictable file-endings, so these can be relatively easily extracted from that image file. You need to know what you are looking for.

Either way - there is no easy solution. For fast results you should consider a professional service provider for data recovery, and prepare for relevant costs. On the long term regular backups are the cheapest solution.

Linux Archive

Last edited by FranDango; 09-20-2008 at 05:01 AM.
 
Old 07-18-2008, 06:03 AM   #6
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
I would suggest that you give photorec a try, it's free and it works great in many cases. It has helped me out in one or two cases where I accidentally formatted the wrong partition. Now your situation is rather different since you also overwrote at least part of the data but, who knows, maybe they were written to a location that wasn't used yet.
In order to use photorec you'll need a back-up partition or drive that is at the very least the size of the one you are trying to recover (should be larger, actually, as photorec will also turn up things that you thought you deleted a long time ago). Bear in mind your files will be restored using numbers for names so you'll have to sort and rename them manually. Also it obviously will not be any good to restore system data. And the larger the file, the more likely it is to fail. For example, I have found that movie files in particular tend to be irrecoverable. It's still very much worth a try, though.

Last edited by jay73; 07-18-2008 at 06:06 AM.
 
Old 07-22-2008, 12:14 AM   #7
vjcarthek
LQ Newbie
 
Registered: Jul 2008
Posts: 3

Original Poster
Rep: Reputation: 0
The situation got more worse. When i restarted the system, it was not able to boot in Fedora reporting that the file system is corrupted and forced to use fsck from the shell. When i issued the command with default byte sizes, the problem was resolved but my drive shows only 10MB of disk space against 80 GB.

Is there a way to connect this Hard disk to a different linux machine and try out something to get the data?
 
  


Reply



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
Data recovery mike_morley Linux - General 3 05-23-2007 07:11 AM
LXer: Linux Data Recovery on Windows - Is possible through Disk Doctors Linux Recovery Software LXer Syndicated Linux News 0 10-22-2006 12:21 PM
data recovery time112852 Linux - Software 2 12-28-2005 10:17 PM
Need help with data recovery. A.C. Helm Linux - Newbie 2 10-15-2005 10:58 AM
Data Recovery plisken General 3 07-04-2004 01:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration