Ok. Sorry for this late response. I've been playing around a little with fat file systems and dosfsck. This is (in short) what I did:
o I created a 1MB (1024 blocks) vfat file system as a file:
~> /sbin/mkdosfs -C fatfile 1024
o Then I could mount this in the file system:
~> mount -o loop -t vfat fatfile fatsys/
o Then I could copy some small text files in to the file system. After unmounting I had a 1MB file containing some text files.
o In an attempt to break stuff, I opened the file in an emacs hex-buffer, located the file system table and entered a few random characters
o I could still mount and umount the file system (as above) but the file sizes and names were now corrupted.
o The trick was to run dosfsck on the file and answer the questions correctly:
~> /sbin/dosfsck -r fatfile
Note here that I ran dosfsck on the
file, not the mounted file system.
I hope that this helps. Make a few backup copies of your file before running dosfsck on it, since dosfsck asks you questions about how to repair that are non-trivial.
Good luck!
Martin