Fat repair

Using TestDisk to repair the filesystem
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Posts: 1
Joined: 15 Oct 2012, 17:41

Fat repair

#1 Post 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!!

User avatar
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France

Re: Fat repair

#2 Post 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.