Page 1 of 1

Fat repair

Posted: 15 Oct 2012, 18:03
by aguywithsocks
Hi everyone

I have an old drive (with win 95 on) that I would like to create into a virtual machine, since there are some programs on there that for various reasons I cannot run on newer PCs. However, the FAT for the primary partition seems to be completely damaged. Windows moans that it would like to format the drive before I can use it. CHKDSK reveals the following:

Code: Select all

C:\>chkdsk q: /f
The type of the file system is FAT.
An error occurred while reading the file allocation table (FAT 1).
An error occurred while reading the file allocation table (FAT 2).
There are no readable file allocation tables (FAT).
Using testdisk, I am able to list the files on the partition. I have already copied all the files as well as created a dd image for backup, using testdisk.

Recreating the BS does not make any difference. It seems that I have to do a FAT repair. Here is where I get confused: the wiki says here http://www.cgsecurity.org/wiki/Advanced ... FAT_tables that
To repair the FAT, the menu Repair FAT will have TestDisk compare the two FAT copies. If the FATs mismatch (sector by sector check) or contains errors, TestDisk uses the FAT copy with less errors and removes the obvious errors. This function must only be used on FAT filesystems with correct values in the boot sector. It has been used with success when scandisk, chkdsk or fsck.vfat crashed or refused to repair the filesystem.
When I run FAT repair, testdisk scans the drive for a while then asks

Code: Select all

Use FAT1 to repair FAT2 table, confirm ? (Y/N)
Upon saying no, it goes on for a little while longer and then asks

Code: Select all

Use FAT2 to repair FAT1 table, confirm ? (Y/N)
According to my understanding from the wiki, it is supposed to decide automatically which FAT to use to repair the other? I'm just a bit apprehensive, as there is very little documentation on this feature, and the WARNING! DANGEROUS! signs in the software :P

Thanks for any help!!

Re: Fat repair

Posted: 04 Nov 2012, 20:45
by cgrenier
As the original disk probably contains bad sectors, run TestDisk on the disk image instead of the original disk and try to repair the FAT.