Dump FAT (Filesystem)
Posted: July 2007
This program is based on and written to confirm information from Wikipedia's FAT page. dump_fat will dump headers from FAT (MSDOS to WINDOWS98) file systems. Currently it dumps the boot sector and directory information from the root directory. There is a second program here based on dump_fat that will recover JPEGs from a formatted FAT device (such as a flash memory card from a digital camera).
FAT, for the most part, is fairly simple to implement so far. The biggest problems I see are redundant fields and hackish things to make an archaic filesystem modern. The whole VFAT filename thing is absolutely disgusting. But this kind of garbage is pretty typical in a Microsoft file format :(. Unfortunately FAT is a pretty common filesystem still. Flash cards/drives (MMC/SD/CompactFlash, etc) are still formatted for FAT by default and cameras and mp3 players and such (minus the iPod which uses Apple's HFS by default on Macs). This is a really bad filesystem for flash memory since flash starts to wear out and fail as you write/rewrite blocks. Unless you mount your file system read-only (or noatime) which I don't think is an option on Windows as it is on Unix/Linux, every time you look at a file its access time will get updated and thus ruin your device fast. A better filesystem for flash memory would be jffs. Owell :(.
Update April 5, 2008 - I added a utility called recover_fat_jpegs. If you had a memory card for maybe a digital camera and you accidently formatted it, this program can recover all the jpegs off of it. To build it type: make recover. To run it, get a copy of your flash drive image and run the recover_fat_jpegs on it. An example would be this:
dd if=/dev/sda of=backup.img
Update November 21, 2007 - I have almost all my code written to read an SD card from an Atmel Atmega168. I updated dump_fat just now so it can recognize if the first sector is a MBR with a partition table and find the first partition to read, or if it's just a single partition disk (like a floppy).
Related Projects @mikekohn.net
Copyright 1997-2021 - Michael Kohn