Subject: Re: bin/3998: Trying to mount a filesystem you don't have is cryptic
To: Christian Hattemer <>
From: Greg Troxel <>
List: current-users
Date: 09/29/2006 15:29:10

  The msdos code is very bad at that - and can fail in many ways.
  Maybe the kernel code could report the actual error to the console.
  (at least for some of the 'usual' errors).

But, printf to the kernel is about what device?  We really want to
have richer errors than just errno.   That said, I think a kernel
printf for something that's rare is more helpful than harmful.

I fixed a problem in the kernel msdosfs mount code that rejected
filesystems with MBRs with bytes 251-252 nonzero.  There appears to be
no actual rule that says they have to be.  This may be your problem.
I am 99% sure the fix is in current and netbsd-4.

  From: Greg Troxel <>
  Subject: CVS commit: src/sys/fs/msdosfs
  Date: Mon, 14 Aug 2006 14:06:26 +0000 (UTC)

  Module Name:	src
  Committed By:	gdt
  Date:		Mon Aug 14 14:06:26 UTC 2006

  Modified Files:
          src/sys/fs/msdosfs: bootsect.h msdosfs_vfsops.c

  Log Message:
  When mounting an MSDOS fileysystem, do not require that bytes 252 and
  253 of the superblock be zero.  Searching the net failed to find any
  justification for checking these bytes; all available references say
  that they are part of the boot code and not BOOTSIG2 and BOOTSIG3.

  Modify the MSDOS 7.1 bootsector definition to have 420 bytes of boot
  code and no BOOTSIG[23], rather than 418 bytes of boot code, to follow
  available references and apparent Windows practice.  A test build
  showed that these defines are not used other than in the check removed
  by this commit.

  Patch tested on netbsd-3, and enabled mounting of a 4 GB CF formatted
  under Windows XP and then in a digital camera.  The CF was previously

  Concept approved on tech-kern by christos@ and martin@.

  To generate a diff of this commit:
  cvs rdiff -r1.3 -r1.4 src/sys/fs/msdosfs/bootsect.h
  cvs rdiff -r1.33 -r1.34 src/sys/fs/msdosfs/msdosfs_vfsops.c

  Please note that diffs are not public domain; they are subject to the
  copyright notices on the relevant files.

Content-Type: application/pgp-signature

Version: GnuPG v1.4.5 (NetBSD)