FAT32 Boot Sector Repair vs Reconstruction: What Works

Patching a FAT32 boot sector and rebuilding a volume without one are different jobs with different risks. What each needs, and when repair makes things worse.

A FAT32 volume that will not mount usually gets one piece of advice: repair the boot sector. Sometimes that is right, and one damaged sector is the whole problem. Often it is not, and the sector is just the most visible casualty of damage that also took the directory structure. Writing a plausible replacement into a volume whose remaining metadata disagrees with it is a reliable way to finish off data that was still recoverable.

What the boot sector holds#

The first sector of a FAT32 volume is a parameter block, not a description of files. It records how to interpret everything else: bytes per sector, sectors per cluster, how many sectors are reserved, how large each allocation table is, where the root directory starts. Get one number wrong and every later read is aimed at the wrong place.

By convention a copy sits at sector 6, which is why repair is possible at all.

text
offset  size  field                   note on FAT32
0x00    3     jump instruction        EB xx 90
0x03    8     OEM name
0x0B    2     bytes per sector        512 or 4096
0x0D    1     sectors per cluster     power of two, 1 to 128
0x0E    2     reserved sectors        usually 32
0x10    1     number of FATs          usually 2
0x11    2     root entry count        must be 0 on FAT32
0x13    2     total sectors, 16-bit   0 when the volume is large
0x15    1     media descriptor
0x16    2     FAT size, 16-bit        0 on FAT32
0x20    4     total sectors, 32-bit
0x24    4     FAT size in sectors     each FAT, not both
0x2C    4     root directory cluster  usually 2
0x30    2     FSInfo sector           usually 1
0x32    2     backup boot sector      usually 6
0x1FE   2     signature               0x55AA

Repair writes numbers into one sector#

A repair has three possible sources of truth: the backup copy in the reserved area, the values implied by the allocation tables, and someone's judgement. Only the first involves no guessing. If sector 6 reads cleanly and describes a geometry that fits the volume, copying it over sector 0 usually restores access.

That works when the damage really is limited to the first sector, a failed write, malware, a partitioning tool that wrote a boot sector from a different disk. It fails when the damage is broader. On a reformatted volume, a repaired boot sector describes the new file system, not the old files. If the backup is gone as well, every field is a guess, and a wrong sectors-per-cluster value makes the volume look valid while pointing every file at the wrong clusters.

Where repair turns destructive#

  • A repaired volume can mount, and once it mounts Windows may run a repair pass that truncates or deletes whatever it cannot reconcile.
  • A boot sector copied from another disk is internally consistent and completely wrong for this one.
  • A 4Kn disk behind a bridge that reports 512-byte sectors will be repaired against the wrong sector size.
  • Two allocation tables that disagree mean the FAT is damaged too, not just the boot sector.

The first is the one people underestimate. A volume that mounts is treated as healthy by everything that touches it afterwards.

Reconstruction infers the layout from records#

Reconstruction assumes nothing about the boot sector and derives the layout from what is on the disk. FAT directory entries are 32-byte records with a fixed internal structure: attribute byte, timestamps, first cluster, file size, and a name. They can be located without knowing the geometry, because their structure does not depend on it.

Once enough entries are found, the parameters that fit them are heavily constrained. A candidate geometry has to pass several tests at once: the root directory cluster has to contain entries, every chain in the allocation table has to stay inside the data region, file sizes have to match chain lengths, the two tables have to agree where they overlap, and the entry list has to end at 0x00 where a directory end belongs. On 4Kn media the same tests run with 4096-byte sectors and different offsets. A geometry that passes all of them is evidence, not a guess.

That is the approach Carve Data Recovery takes. The layout is rebuilt from the directory records it actually finds rather than read from a boot sector, the file system that replaced the old one is skipped, and files whose entries are gone are carved by their internal structure.

SituationBoot sector repairReconstruction
Backup at sector 6 intactReasonable, after imagingAlso works
Reserved area fully overwrittenGuessworkRequired
Volume reformatted, cluster size changedDescribes the wrong file systemRequired
Allocation tables disagreeNot enough on its ownRequired
4Kn disk behind a 512-byte bridgeWrong sector sizeRequired, at the real size

The safe order#

  1. Stop writing. Every write to the volume reduces what is left.
  2. Image the device if it is failing, and work from the image.
  3. Scan and preview first. It is read-only, it is free, and it tells you whether the directory records survived before you change a sector.
  4. Only then consider a patch, and only with the backup copy in hand.

Warning

Do not accept a repair that has not been preceded by an image. Writing to a volume you have not copied is irreversible, and a wrong boot sector can make later reconstruction harder by making the volume mount.

A boot sector is one sector of evidence. The identity of a volume is spread across thousands of directory entries and allocation table records, and reconstruction works by making those agree. Repair is safe when they already do.

Find out what is still on your drive

Scanning and previewing are free, and nothing is written to the source disk. You will know within minutes whether the files can be recovered.

Download for Windows