Linux - SoftwareThis 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
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)?
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.