can not mount a large FAT32 filesystem

Bruce Evans bde at zeta.org.au
Thu Sep 29 05:59:42 PDT 2005


On Wed, 28 Sep 2005, Peter Edwards wrote:

> On 9/28/05, Jim Rees <rees at umich.edu> wrote:
>> Note that the check also must be removed near the top of mountmsdosfs(), at
>> least in the cvs head version.
>>
> The only reference to BOOTSIG[23] in msdosfs_vnops.c were the ones I
> removed: Do you mean here (line 445 of msdos_vfsops.c v 1.144)
>
>> #ifndef MSDOSFS_NOCHECKSIG
>>         if (bsp->bs50.bsBootSectSig0 != BOOTSIG0
>>             || bsp->bs50.bsBootSectSig1 != BOOTSIG1) {
>>                 error = EINVAL;
>>                 goto error_exit;
>>         }
>> #endif
>
> This is a different check: It's testing a different signature: the
> "0xAA55" marker at the end of the bootblock, which _is_ actually
> documented.

Surely this one is very standard?

And MSDOSFS_NOCHECKSIG is unconditionally defined anyway)

This explains why the kernel can mount the file systems with misplaced
boot signatures created by newfs_msdosfs^H^H on media with a sector size
other than 512.  newfs_msdos writes BOOTSIG[0-1] to the end of the sector,
but msdosfs and fsck_msdosfs(8) want it at the end of a 512-block, except
MSDOSFS_NOCHECKSIG unconditionally breaks the check in msdosfs, so
file systems that fail fsck [-f] are permitted to be mounted.

OpenBSD removed the BOOTSIG[0-1] check in msdosfs in 1999 but hasn't
touched it in fsck_msdos or renamed fsck_msdos to fsck_msdosfs...

NetBSD still checks BOOTSIG[0-1] and BOOTSIG[2-3] unconditionally in
msdosfs and BOOTSIG[0-1] in fsck_msdos.

I think the checking for BOOTSIG[0-1] shouldn't be removed or a compile-
time option.

The \x55\xAA signature also occurs in the fsinfo and is messed up by
newfs_msdos for unusual sector sizes.  This results in msdosfs just
ignoring the fsinfo for unusual sector sizes.  Since the fsinfo is
mostly an optional optimization hint, this is almost harmless.

Bruce


More information about the freebsd-fs mailing list