After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 668491 - Formatting small FAT32 partitions (32MB) violates FAT32 specifications
Formatting small FAT32 partitions (32MB) violates FAT32 specifications
Status: RESOLVED FIXED
Product: gparted
Classification: Other
Component: application
0.11.0
Other Linux
: Normal normal
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2012-01-23 11:33 UTC by Gerd Wetzel
Modified: 2012-02-22 00:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Microsoft Whitepaper for FAT32 (217.50 KB, application/msword)
2012-01-23 11:33 UTC, Gerd Wetzel
Details
fat32_32mb_gparted0.7.0_dump.hex (1.00 KB, application/octet-stream)
2012-01-25 08:35 UTC, Gerd Wetzel
Details
fat32_32mb_gparted0.11.0_dump.hex (1.00 KB, application/octet-stream)
2012-01-25 08:35 UTC, Gerd Wetzel
Details

Description Gerd Wetzel 2012-01-23 11:33:00 UTC
Created attachment 205869 [details]
Microsoft Whitepaper for FAT32

GParted 0.7.0 allows to FAT32 format partitions with 32MB. 
This is not possible e.g. with mkdosfs.

E.g. 32MB partition on a 2GB USB stick.

BPB_RootEntCnt:		x0000
BPB_BytsPerSec:		0x0200 (512)
BPB_FATSz16:		0
BPB_FATSz32:		0x000001f8 (504)
BPB_TotSec16:		0
BPB_TotSec32:		0x00010000 (65536)
BPB_ResvdSecCnt:	0x0020 (32)
BPB_NumFATs:		0x02
BPB_SecPerClus:		1


DataSec = 65536 – (32 + 2*504) + 0 = 64496
CountOfClusters = 64496 / 1 = 64496
                              =====

The result violates the Microsoft Whitepaper for FAT32 filesystem: fatgen103.doc
Please see page 14, for "FAT Type Determination"

A FAT32 volume must have at least 65,525 clusters.
                                  ======
Comment 1 André Klapper 2012-01-23 16:10:59 UTC
Version 0.7.0 is an old version from November 2010. 
Please use a recent version and reopen this bug report if the problem still exists in a recent version: http://gparted.sourceforge.net/download.php
Comment 2 Gerd Wetzel 2012-01-25 08:35:19 UTC
Created attachment 206069 [details]
fat32_32mb_gparted0.7.0_dump.hex

Hex dump of first 1K of 32MB FAT32 partition on USB stick.
This partition was created and formatted with GParted 0.7.0 on Ubuntu 10.04
Comment 3 Gerd Wetzel 2012-01-25 08:35:57 UTC
Created attachment 206070 [details]
fat32_32mb_gparted0.11.0_dump.hex

Hex dump of first 1K of 32MB FAT32 partition on USB stick.
This partition was created and formatted with GParted 0.11.0 on Ubuntu 11.10
Comment 4 Gerd Wetzel 2012-01-25 08:37:20 UTC
Tested again with GParted 0.11.0, build from source on Ubuntu 11.10.

The results were exactly the same. 
Please see attached hex dumps of the first 1K of both partitions
Comment 5 Curtis Gedak 2012-01-25 17:20:53 UTC
Thank you Gerd for reporting this issue.

Do you know what the minimum size should be for a FAT32 file system partition?
Comment 6 Gerd Wetzel 2012-01-25 20:34:56 UTC
I'm not a specialist, and this is only the result from my investigations.
According to the white paper, I come to following minimum values for fat32.

A FAT32 partition must have a minimum of 65,525 data clusters.
With a minimum size of 512 bytes per sector and 1 sector per cluster
I get round about 66576 total sectors/clusters as a minimum, but this is only my best guess.

The sector size in relation to the disk size is given by the table on page 20.

Following article on the Microsoft support portal implies that there were support for FAT32 smaller than 32MB for Windows NT, but it seems this was discontinued. 

http://support.microsoft.com/kb/140365
Comment 7 Curtis Gedak 2012-01-25 23:36:51 UTC
Gerd, thank you for the link.

The current limit in the source code is 32 MB and has the following comment beside it:

<begin fat32.cc code snippet>

fs .MIN = 32 * MEBIBYTE ; //smaller fs'es will cause windows scandisk to fail..

<end fat32.cc code snippet>

So I decided to test this limit.  Since it is no longer obvious where to find scandisk in Windows, a quick Internet search brought me to the following instructions:

How to Perform Scandisk in Windows
http://support.microsoft.com/kb/156571


For the test I created FAT32 partition sizes of 32, 33, and 34 MB in GParted Live 0.11.0-10 and the booted into Windows XP.

When I tried to run a scandisk on the 32 MB FAT32 partition, a dialog box with the following message popped up.

     "Windows was unable to complete the disk check."

The scandisk was able to successfully complete on the larger FAT32 partition sizes.  Hence it appears that you are correct.  A 32 MB FAT32 partition is too small.

33 MB does appear to work so I will set that as the minimum size.
Comment 8 Curtis Gedak 2012-01-25 23:59:28 UTC
The minimum size for a FAT32 file system partition has been increased to 33 MiB.

This enhancement has been committed to the git repository for inclusion in the next release of GParted.

The relevant git commit can be viewed at the following link:
http://git.gnome.org/browse/gparted/commit/?id=fcdd853cb9d63ad86114fa15a267d353bfa0789f
Comment 9 Curtis Gedak 2012-02-22 00:54:42 UTC
This enhancement has been included in GParted 0.12.0 released on
February, 21, 2012.