Gregwar/fatcat

Need help rebuilding FAT1 and FAT2

bsdimp opened this issue · 2 comments

I have a disk where FAT1 and FAT2 are missing. It's a very old drive, so heads 1 and 2 are no longer over the tracks for the first several tracks (I'm using an advanced imaging tool that tells me things like this about the drive). So, the drive cannot read those areas and so my image has 0's in them. It would be nice to be able to start somewhere and initialize a FAT whose chains are all 1 long, based on different parameters I give on the command line. This may also mean the first N sectors of the root directory are zero'd too, I don't know yet. The first entry is weird, so I strongly suspect that's the case:

00002400  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00006c00  57 53 4d 53 47 53 20 20  4f 56 52 20 00 00 00 00  |WSMSGS  OVR ....|
00006c10  00 00 00 00 00 00 9a 06  21 09 21 00 80 71 00 00  |........!.!..q..|
00006c20  4c 4f 54 55 53 32 20 20  20 20 20 10 00 00 00 00  |LOTUS2     .....|
00006c30  00 00 00 00 00 00 34 6e  07 11 dd 04 00 00 00 00  |......4n........|

It's a 10MB file from a non PC-DOS compatible computer (it ran MS-DOS 2.11), so there's also some weird stuff at front for the non-standard partitioning scheme that it uses. It's clearly more damaged than you're used to dealing with in your fatcat program...

Hi
I guess you could use fatcat with orphan (lost+found) feature
One issue is that you at least need fat headers there, so maybe we can consider rebuilding them
Also, if FAT are missing, it means that files will be read contiguously, which might not be be perfect

I would try:

  1. Make a volume of the same size using mkfs (is it fat12?)
  2. Copy the fat headers to the missing sectors (the 0s of your file)
  3. Run fatcat in -o mode and see what you get