Re: mounting msdosfs

From: Jon Noack <noackjr_at_alumni.rice.edu>
Date: Sat, 17 Apr 2004 20:24:13 -0500
On 4/17/2004 3:56 AM, Christer Solskogen wrote:
> I got two msdosfs(fat32) partitions on my machine.
> I can mount them without any problems, but fsck wont work.
> 
> # fsck_msdosfs /dev/ad0s5
> ** /dev/ad0s5
> backup doesn't compare to primary bootblock
> 
> I did a clean FreeBSD 5.2.1 install(not upgraded or anything)
> 
> Since mounting them, and using them goes well I guess almost everything
> is alright. Is there a way of spesifying to not fsck them at boot, but
> mount them?
> 
> Hm, i think i remember netbsd had a simular problem, but it got fixed.
> But I`m not sure if it would work on FreeBSD.
> http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=11134

Assuming you can mount the partition without any complaints, set the 
sixth field in /etc/fstab to zero to avoid the fsck.  Here's the section 
from fstab(5):
The sixth field, (fs_passno), is used by the fsck(8) program to 
determine the order in which file system checks are done at reboot time. 
The root file system should be specified with a fs_passno of 1, and 
other file systems should have a fs_passno of 2. File systems within a 
drive will be checked sequentially, but file systems on different drives 
will be checked at the same time to utilize parallelism available in the 
hardware. If the sixth field is not present or is zero, a value of zero 
is returned and fsck(8) will assume that the file system does not need 
to be checked.

An example entry (note the 'Pass#' is set to '0'):
# Device	Mountpoint	FStype	Options		Dump	Pass#
/dev/ar0s5	/win98		msdos	rw		0	0

This appears to have been fixed in NetBSD (the bug says revision 1.9):
http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/fsck_msdos/boot.c

DOSBOOTBLOCKSIZE was replaced with 79?  Oh well, at least the /*XXX*/ is 
self-documenting ;-).

A diff of the current FreeBSD boot.c versus the NetBSD version shows one 
other change (made in revision 1.8).  I know we're doing a Darwin merge 
of msdosfs stuff, but I didn't see fsck_msdosfs in a quick browse of the 
Darwin 7.3 source.  Perhaps we should merge NetBSD's fsck_msdosfs...

Jon Noack
Received on Sat Apr 17 2004 - 16:24:21 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:51 UTC