Tech Support > Computers & Technology > Programming > filesystems
filesystems
Posted by Bill Cunningham on October 5th, 2005


What is the difference in HD geometry in the fat16 and fat32
filesystems? I know 32 bit block can be manually manipulated to be 16 bit
blocks. In other words changing fat32 to fat16. But there would be an
unavoidable loss of data wouldn't there be?

Bill



Posted by robertwessel2@yahoo.com on October 5th, 2005



Bill Cunningham wrote:

Perhaps the definitive description of FAT12/16/32 is:

http://www.microsoft.com/whdc/system...re/fatgen.mspx

In short, FAT32 volumes have 65,525 or more clusters, FAT12 volumes
have 4084 clusters or fewer, and volumes with cluster counts between
those limits are FAT16.

The only real difference between FAT12 and FAT16 is that FAT itself -
it's made up of 12 bit entries (packed two to every three bytes), where
as FAT16 uses two byte entries. FAT32 also changes the FAT in the
obvious way (FAT entries are now four bytes (of which only 28 bits are
usable as a cluster number). All three FAT formats have slightly
different conventions on what special cluster number values are defined
and how they're used.

Beyond that, FAT32 changes how the fields after byte 36 in the boot
sector are defined (FAT12/16 defines five fields in 26 bytes, FAT32
defines 11 fields in 54 bytes, including all of the FAT12/16 fields in
different places).

FAT32 also changes the way a few fields in the first 36 bytes of the
boot sector are used (for example, the field that specifies the number
of entries in the fixed root directory area must always be zero in
FAT32).

The major structural change is that FAT32 does not use a fixed root
directory area, rather the root directory is a directory like any
other, and one of the new FAT32 boot sector field points to the first
cluster.

In addition FAT32 has an additional sector containing some FAT
management data, plus there's a backup boot sector. Also, the boot
code on FAT32 volumes tends to take three sectors, and not just one.
These are all in the reserved area at the beginning of the disk (which
is usually 32 sectors on FAT32 vs. 1 sector on FAT12/16).

Conversion between FAT formats is non-trivial and not possible in all
cases (for example, you cannot have a 2MB storage device formatted with
anything other than FAT12, nor can a device bigger than about 2GB be
anything other than FAT32, unless you leave a large enough reserved
area to reduce it's capacity to 65,524 32KB clusters).

In general, switching to a format with smaller clusters is easier,
since you can just slice up the existing clusters. So a 40,000 cluster
FAT16 volume could be redefined as an 80,000 cluster FAT32 volume
(assuming the FAT16 clusters are at least 1KB). A similar scheme thing
could be done converting from FAT12 to FAT16. The big problem is that
the FATs themselves will increase in size, which will almost certainly
overlay the root directory area and perhaps the first data clusters on
the device.

If there's not enough space to handle the grown FATs (and some tweaks
are possible here - like deleting extra copies of the FAT or reducing
the size of the root directory area), the disk will need to be reorg'd
such that enough free space is left at the beginning. This is
more-or-less the defragmentation process with a tweak or two (although
it can be simpler since your goal is just moving data away from one
area of the disk rather than a full defragment).

Going the other way (smaller to larger clusters) is more difficult.
You have to reorg the disk in such a way that the smaller clusters are
used in groups that are multiples of the larger cluster size, with
padding clusters inserted as needed. Again, this is a tweaked
defragmentation process. Once you've done that, you can reorganize the
FATs and root directory areas as needed (and if you were starting with
FAT32, the reorg will need to leave enough space for the root directory
area).

In either case, once you get the clusters repacked and repositioned as
appropriate, you have to adjust all the directory entries on the volume
to use the "new" cluster numbers, rebuild the new format FATs, and
rebuild the reserved area at the beginning of the disk to match the new
format.


Posted by Bill Cunningham on October 6th, 2005


So if I used a partion manager, specifically linux's fdisk. And changed
a fat32 partition's signature to that of fat 16. What exactly is happening?
I've been trying this and have been successful in the past now I can't seem
to get things to work. I reboot into win98 and format the new fat16. Then
boot with a floppy ms-dos 6.21. I can't get the system to install. into 1st
or 2nd partition on the HD. DOS should be able to format a fat 16 partition
using it's 16 bit format command.
But it says it can't access the partition.

Bill




Posted by robertwessel2@yahoo.com on October 6th, 2005



Bill Cunningham wrote:

OK, the signature in the partition table has little to do with the
format of the volume, in fact fdisk does no formatting at all, and the
FAT12/16/32 determination doesn't happen until you format the
partition. The signature does (occasionally) have to match the
contents of the partition.

That being said, there are several different partition types that imply
FAT16 - 4, 6 and 14 come immediately to mind, but I think DOS 6 will
only recognize 4 and 6. Further, DOS is likely to spit up if you try
to feed it a partition bigger than about 2GB, tagged as FAT16 or not.


Posted by Bill Cunningham on October 7th, 2005


Makes sense. I believe there was a FAT12 too. I don't know which was
used extensively with floppies as FAT was designed by someone to do. I also
believe, at least it's what someone told me that DOS 6.x has to be at the
beginning of the drive. At the first cylinder in the first partition. That
may be true also.

Bill




Similar Posts