Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Sep 2005 09:49:37 -0700
From:      "Gayn Winters" <gayn.winters@bristolsystems.com>
To:        <mi@aldan.algebra.com>, <questions@freebsd.org>
Subject:   RE: can not mount a large FAT32 filesystem
Message-ID:  <02b301c5c2ba$4b2b9460$c901a8c0@workdog>
In-Reply-To: <200509260053.j8Q0rrJJ043848@symbion.zaytman.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> -----Original Message-----
> From: owner-freebsd-questions@freebsd.org 
> [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of 
> Mikhail Teterin
> Sent: Sunday, September 25, 2005 5:54 PM
> To: questions@freebsd.org
> Subject: can not mount a large FAT32 filesystem
> 
> 
> Hello!
> 
> I have a 4Gb flash-card with FAT32 filesystem. Whenever I try to mount
> it (on 5.x and 4.x) I get:
> 
> 	msdos: /dev/da0s1: Invalid argument
> 
> and the kernel complains:
> 
> 	da0: reading primary partition table: error reading fsbn 0
> 	mountmsdosfs(): bad FAT32 filesystem
> 
> The method works with smaller cards in the same card-reader. This card
> works fine inside the camera, and I can get the pictures via. PTP
> protocol using gphoto.
> 
> Fdisk da0 says:
> 
> 	******* Working on device /dev/da0 *******
> 	parameters extracted from in-core disklabel are:
> 	cylinders=7936 heads=16 sectors/track=63 (1008 blks/cyl)
> 
> 	Figures below won't work with BIOS for partitions not in cyl 1
> 	parameters to be used for BIOS calculations are:
> 	cylinders=7936 heads=16 sectors/track=63 (1008 blks/cyl)
> 
> 	Media sector size is 512
> 	Warning: BIOS sector numbering starts with sector 1
> 	Information from DOS bootblock is:
> 	The data for partition 1 is:
> 	sysid 12,(DOS or Windows 95 with 32 bit FAT, LBA)
> 	    start 63, size 7998417 (3905 Meg), flag 80 (active)
> 		beg: cyl 0/ head 1/ sector 1;
> 		end: cyl 766/ head 15/ sector 63
> 	The data for partition 2 is:
> 	<UNUSED>
> 	The data for partition 3 is:
> 	<UNUSED>
> 	The data for partition 4 is:
> 	<UNUSED>
> 
> Disklabel da0 says:
> 
> 	# /dev/da0:
> 	type: SCSI
> 	disk: SanDisk 
> 	label: ImageMate II    
> 	flags:
> 	bytes/sector: 512
> 	sectors/track: 63
> 	tracks/cylinder: 16
> 	sectors/cylinder: 1008
> 	cylinders: 7936
> 	sectors/unit: 7999489
> 	rpm: 3600
> 	interleave: 1
> 	trackskew: 0
> 	cylinderskew: 0
> 	headswitch: 0           # milliseconds
> 	track-to-track seek: 0  # milliseconds
> 	drivedata: 0 
> 
> 	8 partitions:
> 	#        size   offset    fstype   [fsize bsize bps/cpg]
> 	  c:  7999489        0    unused        0     0         
> # (Cyl.    0 - 7936*)

Perhaps someone else can help sort this out better than I can, but I do
note that fdisk doesn't seem to be using the last (logical) cylinder,
because it reports using 7998417 + 63 = 7998480 sectors which is exactly
1008 sectors less than 7936 cylinders * 1008 sectors/cylinder = 7999488
sectors.  (Why disklabel reports one more sector 7999489 is a mystery to
me.)

Assuming your BIOS supports LBA, you could try (back up first of course)
using fdisk to rewrite the label, or use fdisk to use all the logical
cylinders on the card.  Also, since you are not trying to boot from the
card, having it marked Active is unnecessary at best.

Good luck,

-gayn





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?02b301c5c2ba$4b2b9460$c901a8c0>