LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-12-2009, 06:20 PM   #1
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
Data rescue with testdisk


I have a hard disk drive with two primary partitions:
sdc1 vfat
sdc2 Linux

Sector 0 (boot sector) of sdc1 seems to be damaged, so it cannot be mounted.
Testdisk in fact reported that the boot record of sdc1 was invalid, and the two copies of the FAT had been zeroed, but it could rebuild the boot sector of sdc1, and maybe the FAT too, as even the files and directories in the root of the file system could be listed in testdisk. It could not write them back to the hard disk, however, maybe due to physical damage of sector 0...

I thought I might copy sdc1 to sdc2, and repair it there (sdc2 was large enough and so far undamaged):
dd_rescue /dev/sdc1 /dev/sdc2

(dd found cca. 1000 bad blocks bellow 1G, but no bad blocks between 1G and 80G during copying)

After copying, I changed the type of sdc2 to vfat by fdisk, and checked sdc2 with testdisk, but this time with no success: testdisk could not find any valid partitions, and its file utility could not find the file system root or any files or directories in sdc2.

I have three questions:

1.) What is wrong with my concept of copying the damaged partition to an other area on the same hard disk and trying to repair it there?

2.) If it was a wrong concept, is there an other way to repair the vfat partition or just to save the files from it, taking into account the fact that I do not have any other partitions that would be large enough to accommodate the copy of that partition, except for the second partition on the same hard disk?

3.) I have read it on maxtor's website, that their hard disk firmwares try to detect bad sectors and replace it with an unused "spare sector". So, why did not it detect sector 0 as bad and replace it with a good one when I tried to write to it the first time with testdisk? (I tried to write the generated boot sector two times unsuccessfully.) Is it out of spare sectors, or self-curing hard disks are just urban legend (raised by some manufacturer's technical documents)?

Last edited by J_Szucs; 06-12-2009 at 07:06 PM.
 
Old 06-14-2009, 10:37 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Of course you could reformat sdc2 with say ext2 (you don't want/need journalling) and dd_rescue the image of sdc1 there as file to work on (Testdisk accepts files), but if a HD has already proven to malfunction (due to nearing EOL/MTBUR/whatever), wouldn't it be better to dd a backup onto another physical disk instead of mucking with it there? Once you got Testdisk working on the file note the /debug and /log switches. Doing a "dry run" with logging enabled might show some leads.
 
Old 06-17-2009, 02:34 PM   #3
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Thank you, I could save all important files with just some mouse clicks using a freeware tool on windows the next day. There was no need to create large image file with that tool.
I am just stupid enough to try to do things with linux tools first

Last edited by J_Szucs; 06-17-2009 at 02:35 PM.
 
  


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 rescue from Knoppix nnjond Linux - Newbie 16 05-21-2008 08:00 AM
Help me rescue my data using a Live CD sk381 Linux - Newbie 4 04-05-2007 12:47 AM
Data rescue on ext3 e-Gandalf Linux - Software 7 03-27-2007 11:10 PM
burning data in rescue mode aquaboot Ubuntu 1 09-24-2006 11:59 AM
how to get data off in rescue mode bmicielli Linux - Software 4 08-24-2003 01:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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