1

Is there a way to identify the type of a FAT partition (if it is 16 or 32) only by reading its boot sector?

thanks.

bobbyBrown
  • 21
  • 5

2 Answers2

3

Not by reading the boot sector - You need to look into the file system itself.

Find the number of clusters. The file system subtype can be determined by this number:

less than 4086: FAT12

equal or more than 4086: FAT16

more than 65525: FAT32

Community
  • 1
  • 1
tofro
  • 5,640
  • 14
  • 31
  • by the filesystem itself, you mean inside the mbr of the device right? – bobbyBrown Aug 14 '16 at 15:07
  • MBR is the first sector of the *device* - You need to look into the first sector of the *partition*, though. That would typically be LBA 63 – tofro Aug 14 '16 at 17:06
  • The numbers are off. Here is the correct count from the FAT specifications: If(CountofClusters < 4085) { /* Volume is FAT12 */ } else if(CountofClusters < 65525) { /* Volume is FAT16 */ } else { /* Volume is FAT32 */ } – itisravi Aug 16 '16 at 11:38
1

If the sectors per FAT word in the FAT12/FAT16 BPB is zero, it is FAT32. (Regardless of the actual FAT size, FAT32 uses the EBPB's sectors per FAT dword.) Likewise, if the number of root directory entries word is zero, it is FAT32.

ecm
  • 2,583
  • 4
  • 21
  • 29