[syslinux] [PATCH 1/5] fat: fix minfatsize for large FAT32

H. Peter Anvin
Tue, 01 Mar 2016 19:30:55 -0000

On 02/26/16 09:54, Gene Cumm via Syslinux wrote:
>>
>> I'm not exactly sure how that would work (how would you mark those
clusters
>> as wasted when my understanding is that the FAT's can't provide
any
>> knowledge about them in the first place?) and unless it is
automatically
>> integrated and ran during the Syslinux installation, it sounds quite
>> inconvenient for users.
>
> Total size and last-known free space should be adjusted accordingly.
> I don't think there's anything more but a fsck/chkdsk or similar
tool
> should also be able to fix this error.  Ending the file system before
> the end of the partition may seem unusual but helps in this instance.
>

And that is, indeed, what this formatter should do if it wishes to
continue using this specific algorithm for some reason.  This is, in
fact, required anyway for some specific reasons.

That being said, if Windows accepts such a filesystem then Syslinux
really should, too; perhaps with a warning.  libfat is sometimes overly
paranoid, on purpose, in order to avoid problems.

It is also worth noting that someone ported mkdosfs to Windows; perhaps
the best thing would be if this could be folded into the stock
dosfstools upstream (if it hasn't been already):

	http://www1.mager.org/mkdosfs/

	---

TL;DR: Ridgecrop's tool has a bug that needs to be fixed.  They can
either extend the FAT size to cover the entire volume, or they can
adjust the filesystem size to account for the limited size of the FAT.
Both are legitimate; which one results in the higher capacity is the
preferred one (which will usually be making the FAT larger.)

However, if Windows accepts this, and *especially* if chkdsk doesn't
take any action, we really ought to change Syslinux to match.