From owner-freebsd-fs@FreeBSD.ORG Mon Sep 26 20:54:51 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E740616A41F for ; Mon, 26 Sep 2005 20:54:51 +0000 (GMT) (envelope-from mi+mx@aldan.algebra.com) Received: from blue.virtual-estates.net (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D30943D7C for ; Mon, 26 Sep 2005 20:54:27 +0000 (GMT) (envelope-from mi+mx@aldan.algebra.com) Received: from corbulon.video-collage.com (static-151-204-231-237.bos.east.verizon.net [151.204.231.237]) by blue.virtual-estates.net (8.13.4/8.13.4) with ESMTP id j8QKsQV3089091 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 26 Sep 2005 16:54:26 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) Received: from mteterin.us.murex.com (195-11.customer.cloud9.net [168.100.195.11]) by corbulon.video-collage.com (8.13.4/8.13.1) with ESMTP id j8QKsJvd016404 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 26 Sep 2005 16:54:19 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) Received: from mteterin.us.murex.com (mteterin@localhost [127.0.0.1]) by mteterin.us.murex.com (8.13.3/8.13.3) with ESMTP id j8QKs5ZX030880; Mon, 26 Sep 2005 16:54:05 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) Received: from localhost (localhost [[UNIX: localhost]]) by mteterin.us.murex.com (8.13.3/8.13.3/Submit) id j8QKs1xW030879; Mon, 26 Sep 2005 16:54:01 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) X-Authentication-Warning: mteterin.us.murex.com: mteterin set sender to mi+mx@aldan.algebra.com using -f From: Mikhail Teterin Organization: Virtual Estates, Inc. To: gayn.winters@bristolsystems.com, fs@freebsd.org Date: Mon, 26 Sep 2005 16:54:01 -0400 User-Agent: KMail/1.8.2 References: <02b301c5c2ba$4b2b9460$c901a8c0@workdog> In-Reply-To: <02b301c5c2ba$4b2b9460$c901a8c0@workdog> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_p/FODwy0/lgs+Ac" Message-Id: <200509261654.01697.mi+mx@aldan.algebra.com> X-Virus-Scanned: ClamAV devel-20050525/1102/Sun Sep 25 10:04:56 2005 on corbulon.video-collage.com X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.43 Cc: Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2005 20:54:52 -0000 --Boundary-00=_p/FODwy0/lgs+Ac Content-Type: text/plain; charset="koi8-u" Content-Transfer-Encoding: 8bit Content-Disposition: inline ÐÏÎÅĦÌÏË 26 ×ÅÒÅÓÅÎØ 2005 12:49, Gayn Winters ÷É ÎÁÐÉÓÁÌÉ: > 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. This is a flash card (Hitachi microdrive) inserted into a USB flash-reader. There is no BIOS. Not only does the card work fine in the camera (which formatted it), but Windows has no problems with it either. I'd rather help fix our FAT32 support, than find a work-around... Is anyone on fs@ interested? The original symptomps and Gayn's comments are attached. Thanks! -mi --Boundary-00=_p/FODwy0/lgs+Ac Content-Type: message/rfc822; name="forwarded message" Content-Transfer-Encoding: 7bit Content-Description: "Gayn Winters" : RE: can not mount a large FAT32 filesystem Content-Disposition: inline Return-Path: Received: from bristolsystems.com (h-68-167-239-98.lsanca54.covad.net [68.167.239.98]) by corbulon.video-collage.com (8.13.4/8.13.1) with ESMTP id j8QGnqLd014285 for ; Mon, 26 Sep 2005 12:49:53 -0400 (EDT) (envelope-from gayn.winters@bristolsystems.com) Received: from workdog ([192.168.1.201]) by bristolsystems.com (8.11.6/8.11.6) with ESMTP id j8QGnln20241; Mon, 26 Sep 2005 09:49:47 -0700 Reply-To: From: "Gayn Winters" To: , Subject: RE: can not mount a large FAT32 filesystem Date: Mon, 26 Sep 2005 09:49:37 -0700 Message-ID: <02b301c5c2ba$4b2b9460$c901a8c0@workdog> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 In-Reply-To: <200509260053.j8Q0rrJJ043848@symbion.zaytman.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Importance: Normal X-Virus-Scanned: ClamAV devel-20050525/1102/Sun Sep 25 10:04:56 2005 on corbulon.video-collage.com X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.43 X-SpamProbe: GOOD 0,0001257 e95ddc92cc96d9e7374fa55a2854c852 X-UID: 32516 X-Length: 4232 > -----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: > > The data for partition 3 is: > > The data for partition 4 is: > > > 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 --Boundary-00=_p/FODwy0/lgs+Ac-- From owner-freebsd-fs@FreeBSD.ORG Mon Sep 26 21:22:40 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C171E16A41F for ; Mon, 26 Sep 2005 21:22:40 +0000 (GMT) (envelope-from rees@citi.umich.edu) Received: from citi.umich.edu (citi.umich.edu [141.211.133.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A2A843D58 for ; Mon, 26 Sep 2005 21:22:40 +0000 (GMT) (envelope-from rees@citi.umich.edu) Received: from citi.umich.edu (dumaguete.citi.umich.edu [141.211.133.51]) by citi.umich.edu (Postfix) with ESMTP id 0E4601BB08; Mon, 26 Sep 2005 17:22:40 -0400 (EDT) To: Mikhail Teterin From: Jim Rees In-Reply-To: Mikhail Teterin, Mon, 26 Sep 2005 16:54:01 EDT Date: Mon, 26 Sep 2005 17:22:40 -0400 Sender: rees@citi.umich.edu Message-Id: <20050926212240.0E4601BB08@citi.umich.edu> Cc: gayn.winters@bristolsystems.com, fs@freebsd.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2005 21:22:40 -0000 I doubt very much that adding the last cylinder to the file system or changing the "active" flag will make any difference. So this is a disk drive, not flash, but in a CF package, right? I would be curious to know if a 4GB flash card works, but I don't suppose you have one sitting around. Can you give us the full dmesg for this card/reader? From owner-freebsd-fs@FreeBSD.ORG Tue Sep 27 01:45:26 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AFF1716A41F for ; Tue, 27 Sep 2005 01:45:26 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B80843D49 for ; Tue, 27 Sep 2005 01:45:25 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [192.168.42.23] (andersonbox3.centtech.com [192.168.42.23]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id j8R1itMD065102; Mon, 26 Sep 2005 20:44:55 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <4338A411.10803@centtech.com> Date: Mon, 26 Sep 2005 20:44:49 -0500 From: Eric Anderson User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.11) Gecko/20050914 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jim Rees References: <20050926212240.0E4601BB08@citi.umich.edu> In-Reply-To: <20050926212240.0E4601BB08@citi.umich.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.82/1102/Sun Sep 25 09:04:56 2005 on mh2.centtech.com X-Virus-Status: Clean Cc: Mikhail Teterin , gayn.winters@bristolsystems.com, fs@freebsd.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2005 01:45:26 -0000 Jim Rees wrote: > I doubt very much that adding the last cylinder to the file system or > changing the "active" flag will make any difference. > > So this is a disk drive, not flash, but in a CF package, right? I would be > curious to know if a 4GB flash card works, but I don't suppose you have one > sitting around. > > Can you give us the full dmesg for this card/reader? Maybe a quick fsck_msdos would do the trick.. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-fs@FreeBSD.ORG Tue Sep 27 01:48:34 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DCD5B16A41F for ; Tue, 27 Sep 2005 01:48:34 +0000 (GMT) (envelope-from rees@citi.umich.edu) Received: from citi.umich.edu (citi.umich.edu [141.211.133.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7DDB243D4C for ; Tue, 27 Sep 2005 01:48:34 +0000 (GMT) (envelope-from rees@citi.umich.edu) Received: from citi.umich.edu (dsl093-001-248.det1.dsl.speakeasy.net [66.93.1.248]) by citi.umich.edu (Postfix) with ESMTP id 6378E1BB0B; Mon, 26 Sep 2005 21:48:25 -0400 (EDT) To: Eric Anderson From: Jim Rees In-Reply-To: Eric Anderson, Mon, 26 Sep 2005 20:44:49 CDT Date: Mon, 26 Sep 2005 21:48:25 -0400 Sender: rees@citi.umich.edu Message-Id: <20050927014825.6378E1BB0B@citi.umich.edu> Cc: Mikhail Teterin , gayn.winters@bristolsystems.com, fs@freebsd.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2005 01:48:35 -0000 Maybe a quick fsck_msdos would do the trick.. I doubt it. The message implies a problem with the partition table, not the file system. I suspect it's a geometry problem, especially since the CHS values don't match the LBA. From owner-freebsd-fs@FreeBSD.ORG Tue Sep 27 01:58:38 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A31A16A421 for ; Tue, 27 Sep 2005 01:58:38 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from mh1.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0743D43D6E for ; Tue, 27 Sep 2005 01:58:31 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [192.168.42.23] (andersonbox3.centtech.com [192.168.42.23]) by mh1.centtech.com (8.13.1/8.13.1) with ESMTP id j8R1wEKf084430; Mon, 26 Sep 2005 20:58:14 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <4338A731.9070003@centtech.com> Date: Mon, 26 Sep 2005 20:58:09 -0500 From: Eric Anderson User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.11) Gecko/20050914 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jim Rees References: <20050927014825.6378E1BB0B@citi.umich.edu> In-Reply-To: <20050927014825.6378E1BB0B@citi.umich.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.82/1102/Sun Sep 25 09:04:56 2005 on mh1.centtech.com X-Virus-Status: Clean Cc: Mikhail Teterin , gayn.winters@bristolsystems.com, fs@freebsd.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2005 01:58:38 -0000 Jim Rees wrote: > Maybe a quick fsck_msdos would do the trick.. > > I doubt it. The message implies a problem with the partition table, not the > file system. I suspect it's a geometry problem, especially since the CHS > values don't match the LBA. Agreed - however I've seen errors like this (not exactly the same) for similar problems, that don't quite tell you what's really going on. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-fs@FreeBSD.ORG Tue Sep 27 03:01:42 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F356A16A41F for ; Tue, 27 Sep 2005 03:01:41 +0000 (GMT) (envelope-from mi+kde@aldan.algebra.com) Received: from blue.virtual-estates.net (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B99A43D53 for ; Tue, 27 Sep 2005 03:01:41 +0000 (GMT) (envelope-from mi+kde@aldan.algebra.com) Received: from blue.virtual-estates.net (blue [127.0.0.1]) by blue.virtual-estates.net (8.13.4/8.13.4) with ESMTP id j8R31cHT090000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 Sep 2005 23:01:38 -0400 (EDT) (envelope-from mi+kde@aldan.algebra.com) Received: from localhost (localhost [[UNIX: localhost]]) by blue.virtual-estates.net (8.13.4/8.13.4/Submit) id j8R31brl089999; Mon, 26 Sep 2005 23:01:37 -0400 (EDT) (envelope-from mi+kde@aldan.algebra.com) X-Authentication-Warning: blue.virtual-estates.net: mi set sender to mi+kde@aldan.algebra.com using -f From: Mikhail Teterin To: Jim Rees Date: Mon, 26 Sep 2005 23:01:37 -0400 User-Agent: KMail/1.8.2 References: <20050926212240.0E4601BB08@citi.umich.edu> In-Reply-To: <20050926212240.0E4601BB08@citi.umich.edu> X-Face: %UW#n0|w>ydeGt/b@1-.UFP=K^~-:0f#O:D7whJ5G_<5143Bb3kOIs9XpX+"V+~$adGP:J|SLieM31VIhqXeLBli" Cc: gayn.winters@bristolsystems.com, fs@freebsd.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2005 03:01:42 -0000 On Monday 26 September 2005 05:22 pm, Jim Rees wrote: = So this is a disk drive, not flash, but in a CF package, right? I = would be curious to know if a 4GB flash card works, but I don't = suppose you have one sitting around. I don't... I tried this thing in two different readers, though, as well as inside the camera while in mass-storage (as opposite to PTP mode). = Can you give us the full dmesg for this card/reader? How about the following (on 6-BETA5 from Sep 22): umass0: Genesys USB Reader, rev 2.00/91.38, addr 2 da2 at umass-sim0 bus 0 target 0 lun 0 da2: Removable Direct Access SCSI-0 device da2: 1.000MB/s transfers da2: 3906MB (7999488 512 byte sectors: 255H 63S/T 497C) [...] mountmsdosfs(): bad FAT32 filesystem This is using a different reader and on an entirely different machine, so it is the fs on the card, not the reader... I can dd a few blocks from the beginning, if you'd like -- just send me the actual dd command -- I'll post a link to the output... Thanks, -mi From owner-freebsd-fs@FreeBSD.ORG Tue Sep 27 08:35:49 2005 Return-Path: X-Original-To: fs@FreeBSD.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B3A1016A41F for ; Tue, 27 Sep 2005 08:35:49 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B3AF43D48 for ; Tue, 27 Sep 2005 08:35:49 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j8R8Z7jf018484; Tue, 27 Sep 2005 18:35:07 +1000 Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j8R8Z4iS005252; Tue, 27 Sep 2005 18:35:05 +1000 Date: Tue, 27 Sep 2005 18:35:04 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Jim Rees In-Reply-To: <20050927014825.6378E1BB0B@citi.umich.edu> Message-ID: <20050927183235.T24493@delplex.bde.org> References: <20050927014825.6378E1BB0B@citi.umich.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: gayn.winters@bristolsystems.com, Mikhail Teterin , fs@FreeBSD.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2005 08:35:49 -0000 On Mon, 26 Sep 2005, Jim Rees wrote: > Maybe a quick fsck_msdos would do the trick.. > > I doubt it. The message implies a problem with the partition table, not the > file system. I suspect it's a geometry problem, especially since the CHS > values don't match the LBA. Except the eror is reading the partition table itself. This cannot be a "geometry" problem, except possibly one involving the sector size, since the partition table is in sector 0 and contains the geometry. This is a very strange error, since the kernel does the same read as fdisk to read the partition table, and fdisk seems to work. Bruce From owner-freebsd-fs@FreeBSD.ORG Tue Sep 27 09:53:23 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F86016A41F for ; Tue, 27 Sep 2005 09:53:23 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id F369C43D49 for ; Tue, 27 Sep 2005 09:53:22 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: by zproxy.gmail.com with SMTP id z31so257897nzd for ; Tue, 27 Sep 2005 02:53:22 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=DJI3nkf2IDnceV8Okj8nXs/urhC6EJxlewY1OhI2gL42HjhIsqB8oZufBkP/q15wOWW4TBG6gBcUGPBp3fLJAuitoFJNB9Ap1vgKjayYohw7nz6N1Eiue+zLeXoQcDDBsBzEgDMbQo/wFmHoSOMFyzhczCJ65HgCTnNlVf9tdA4= Received: by 10.36.222.3 with SMTP id u3mr204743nzg; Tue, 27 Sep 2005 02:53:22 -0700 (PDT) Received: by 10.36.68.16 with HTTP; Tue, 27 Sep 2005 02:53:22 -0700 (PDT) Message-ID: <34cb7c840509270253194f7487@mail.gmail.com> Date: Tue, 27 Sep 2005 10:53:22 +0100 From: Peter Edwards To: Mikhail Teterin In-Reply-To: <20050927183235.T24493@delplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_20258_22585234.1127814802045" References: <20050927014825.6378E1BB0B@citi.umich.edu> <20050927183235.T24493@delplex.bde.org> Cc: gayn.winters@bristolsystems.com, fs@freebsd.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Peter Edwards List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2005 09:53:23 -0000 ------=_Part_20258_22585234.1127814802045 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 9/27/05, Bruce Evans wrote: > On Mon, 26 Sep 2005, Jim Rees wrote: > > > Maybe a quick fsck_msdos would do the trick.. > > > > I doubt it. The message implies a problem with the partition table, no= t the > > file system. I suspect it's a geometry problem, especially since the C= HS > > values don't match the LBA. > > Except the eror is reading the partition table itself. This cannot be a > "geometry" problem, except possibly one involving the sector size, since > the partition table is in sector 0 and contains the geometry. This is > a very strange error, since the kernel does the same read as fdisk to > read the partition table, and fdisk seems to work. > I think I've seen this before: the validation of the boot sector is a bit OTT. The description of the bootblock on the microsoft website at http://support.microsoft.com/kb/q140418/ Gives no description at all of the BOOTSIG3 and BOOTSIG3 fields that are validated: I don't think there's any reason to check them. Can you try this patch? ------=_Part_20258_22585234.1127814802045 Content-Type: text/plain; name="msdos.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="msdos.txt" SW5kZXg6IG1zZG9zZnNfdmZzb3BzLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL25mcy9keXNvbi9l eHBvcnQvaG9tZS9wZXRlcmUvZnJlZWJzZC1jdnMvY3ZzL0ZyZWVCU0Qvc3JjL3N5cy9mcy9tc2Rv c2ZzL21zZG9zZnNfdmZzb3BzLmMsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuMTQ0CmRpZmYgLXUg LXIxLjE0NCBtc2Rvc2ZzX3Zmc29wcy5jCi0tLSBtc2Rvc2ZzX3Zmc29wcy5jCTI0IE1hciAyMDA1 IDA3OjM2OjEzIC0wMDAwCTEuMTQ0CisrKyBtc2Rvc2ZzX3Zmc29wcy5jCTI3IFNlcCAyMDA1IDA5 OjQwOjE5IC0wMDAwCkBAIC01MTIsOSArNTEyLDcgQEAKICNlbmRpZgkvKiAhTVNET1NGU19MQVJH RSAqLwogCiAJaWYgKHBtcC0+cG1fUm9vdERpckVudHMgPT0gMCkgewotCQlpZiAoYnNwLT5iczcx MC5ic0Jvb3RTZWN0U2lnMiAhPSBCT09UU0lHMgotCQkgICAgfHwgYnNwLT5iczcxMC5ic0Jvb3RT ZWN0U2lnMyAhPSBCT09UU0lHMwotCQkgICAgfHwgcG1wLT5wbV9TZWN0b3JzCisJCWlmIChwbXAt PnBtX1NlY3RvcnMKIAkJICAgIHx8IHBtcC0+cG1fRkFUc2VjcwogCQkgICAgfHwgZ2V0dXNob3J0 KGI3MTAtPmJwYkZTVmVycykpIHsKIAkJCWVycm9yID0gRUlOVkFMOwo= ------=_Part_20258_22585234.1127814802045-- From owner-freebsd-fs@FreeBSD.ORG Tue Sep 27 11:55:13 2005 Return-Path: X-Original-To: fs@FreeBSD.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BC6F16A41F for ; Tue, 27 Sep 2005 11:55:13 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id C668943D53 for ; Tue, 27 Sep 2005 11:55:12 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j8RBsbjo003183; Tue, 27 Sep 2005 21:54:37 +1000 Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j8RBsWU2013878; Tue, 27 Sep 2005 21:54:33 +1000 Date: Tue, 27 Sep 2005 21:54:32 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Mikhail Teterin In-Reply-To: <200509261654.01697.mi+mx@aldan.algebra.com> Message-ID: <20050927201946.C24713@delplex.bde.org> References: <02b301c5c2ba$4b2b9460$c901a8c0@workdog> <200509261654.01697.mi+mx@aldan.algebra.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: gayn.winters@bristolsystems.com, fs@FreeBSD.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2005 11:55:13 -0000 On Mon, 26 Sep 2005, Mikhail Teterin wrote: > This is a flash card (Hitachi microdrive) inserted into a USB flash-reader. > There is no BIOS. > > Not only does the card work fine in the camera (which formatted it), but > Windows has no problems with it either. I'd rather help fix our FAT32 > support, than find a work-around... > > Is anyone on fs@ interested? The original symptomps and Gayn's comments are > attached. Thanks! Attachment is even better than top posting inhibiting replies, although not as good as a url. %% > 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 (It should actually say "msdosfs" in 5.x. This renaming mainly breaks compatibility.) mount(8)'s error reporting is bad. The EINVAL error here is not completely obscure -- it normally means that the file system is invalid, but the error for msdosfs vs msdos is very obscure -- IIRC it is ENOENT meaning that the module for the file system wasn't found, but mount(8) reports this as mount_msdos[fs] not being found despite this mount utility being present. %% > and the kernel complains: %% > %% > da0: reading primary partition table: error reading fsbn 0 I think this error message is only printed by 4.x. While error messages printed using diskerr() are much better than their replacements in 5+.x, this one is unfortunately missing the low-level error code so it is hard to tell why the read failed. %% > mountmsdosfs(): bad FAT32 filesystem This error seems to be unrelated. (I don't know how msdosfs got this far, since the previous error is for the whole disk and should be fatal -- see below.) The code in msdosfs in 4.x for this is: % if (pmp->pm_RootDirEnts == 0) { % if (bsp->bs710.bsBootSectSig2 != BOOTSIG2 % || bsp->bs710.bsBootSectSig3 != BOOTSIG3 % || pmp->pm_Sectors % || pmp->pm_FATsecs % || getushort(b710->bpbFSVers)) { % error = EINVAL; % printf("mountmsdosfs(): bad FAT32 filesystem\n"); % goto error_exit; % } % pmp->pm_fatmask = FAT32_MASK; % pmp->pm_fatmult = 4; % pmp->pm_fatdiv = 1; % pmp->pm_FATsecs = getulong(b710->bpbBigFATsecs); % if (getushort(b710->bpbExtFlags) & FATMIRROR) % pmp->pm_curfat = getushort(b710->bpbExtFlags) & FATNUM; % else % pmp->pm_flags |= MSDOSFS_FATMIRROR; % } else % pmp->pm_flags |= MSDOSFS_FATMIRROR; The file system's boot block passed several checks before here; in particular it must have been readable. Apparently (pmp->pm_RootDirEnts == 0) implies FAT32 and then one of the other checks fails. If it weren't for the error reading sector 0, I would expect just a minor compatibility problem here. %% > 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 I don't know how fdisk managed to read the MBR, since the kernel couldn't. There seem to be no "geometry" problems here. 63 sectors/track is normal. 16 heads only works with not-very-old BIOSes, since it gives more than 1024 cylinders, but the card is new so it may assume a not-very-old BIOS). The ending head number in the partition entry matches 16 heads. The star and size match the starting and ending C/H/S (C matches mod 1024). For some reason, the last complete cylinder isn't used, and for the usual reasons, the 1 sector following the last complete cylinder isn't used. %% > 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 %% > ... This is consistent with the fdisk output. %% 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.) Disklabel probably reports 7999489 sectors because that is the actual number of sectors. Remember that the geometry of H=16/S=63 is invented. 16*63 just happens not to divide 7999489 evenly. It seems to be normal for ATA disks for the number of sectors to be dumbed down so that it is a multiple of H*S, but this is a SCSI disk. %% 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. This probably won't help. In 4.x, the initial error is from subr_diskmbr.c: % mbr_offset = DOSBBSECTOR; % reread_mbr: % /* Read master boot record. */ % bp = geteblk((int)lp->d_secsize); % bp->b_dev = dkmodpart(dkmodslice(dev, WHOLE_DISK_SLICE), RAW_PART); % bp->b_blkno = mbr_offset; % bp->b_bcount = lp->d_secsize; % bp->b_flags |= B_READ; % BUF_STRATEGY(bp, 1); % if (biowait(bp) != 0) { % diskerr(bp, "reading primary partition table: error", % LOG_PRINTF, 0, (struct disklabel *)NULL); % printf("\n"); % error = EIO; % goto done; % } % ... % done: % bp->b_flags |= B_INVAL | B_AGE; % brelse(bp); % if (error == EINVAL) % error = 0; % return (error); % } It is hard to see how this causes the observed symptoms. An error here seems most likely to be caused by the sector size being wrong, but should prevent all opens of the disk. But we know that both fdisk(8) and the start of msdosfs mount can open and read the disk. fdisk opens the whole disk and sees normal things. msdosfs mount should be opening slice s1, and that is more likely to not work than opening the whole disk. Certainly the above error prevents slice s1 being correctly located, so msdosfs mount shouldn't see normal things. But we know that msdosfs sees some normal things before it sees a problem. Try reading slice s1 using dd. I would expect this to fail. Bruce From owner-freebsd-fs@FreeBSD.ORG Tue Sep 27 14:25:01 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 07C9D16A41F for ; Tue, 27 Sep 2005 14:25:00 +0000 (GMT) (envelope-from mi+kde@aldan.algebra.com) Received: from blue.virtual-estates.net (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6F71443D48 for ; Tue, 27 Sep 2005 14:24:58 +0000 (GMT) (envelope-from mi+kde@aldan.algebra.com) Received: from blue.virtual-estates.net (blue [127.0.0.1]) by blue.virtual-estates.net (8.13.4/8.13.4) with ESMTP id j8REOttl002544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 27 Sep 2005 10:24:55 -0400 (EDT) (envelope-from mi+kde@aldan.algebra.com) Received: from localhost (localhost [[UNIX: localhost]]) by blue.virtual-estates.net (8.13.4/8.13.4/Submit) id j8REOqXu002543; Tue, 27 Sep 2005 10:24:52 -0400 (EDT) (envelope-from mi+kde@aldan.algebra.com) X-Authentication-Warning: blue.virtual-estates.net: mi set sender to mi+kde@aldan.algebra.com using -f From: Mikhail Teterin To: Bruce Evans Date: Tue, 27 Sep 2005 10:24:51 -0400 User-Agent: KMail/1.8.2 References: <02b301c5c2ba$4b2b9460$c901a8c0@workdog> <200509261654.01697.mi+mx@aldan.algebra.com> <20050927201946.C24713@delplex.bde.org> In-Reply-To: <20050927201946.C24713@delplex.bde.org> X-Face: %UW#n0|w>ydeGt/b@1-.UFP=K^~-:0f#O:D7whJ5G_<5143Bb3kOIs9XpX+"V+~$adGP:J|SLieM31VIhqXeLBli" Cc: gayn.winters@bristolsystems.com, fs@freebsd.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2005 14:25:01 -0000 On Tuesday 27 September 2005 07:54 am, Bruce Evans wrote: %% > da0: reading primary partition table: error reading fsbn 0 =I think this error message is only printed by 4.x. Yes, it was. I tried the same card on 4.x (i386) and 6.0 (amd64). = Try reading slice s1 using dd.  I would expect this to fail Both dd bs=512 count=1024 if=/dev/da2s1 of=~mi/public_html/s1.beginning.dd and dd bs=512 count=1024 if=/dev/da2 of=~mi/public_html/card.beginning.dd worked fine. You can take a look at the results at http://aldan.algebra.com:8015/~mi/card.beginning.dd.bz2 http://aldan.algebra.com:8015/~mi/s1.beginning.dd.bz2 I'll try Peter's patch today... -mi From owner-freebsd-fs@FreeBSD.ORG Wed Sep 28 05:37:55 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 954F116A41F; Wed, 28 Sep 2005 05:37:55 +0000 (GMT) (envelope-from mi@corbulon.video-collage.com) Received: from blue.virtual-estates.net (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 049A443D48; Wed, 28 Sep 2005 05:37:52 +0000 (GMT) (envelope-from mi@corbulon.video-collage.com) Received: from corbulon.video-collage.com (static-151-204-231-237.bos.east.verizon.net [151.204.231.237]) by blue.virtual-estates.net (8.13.4/8.13.4) with ESMTP id j8S5bMC7000871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Sep 2005 01:37:23 -0400 (EDT) (envelope-from mi@corbulon.video-collage.com) Received: from corbulon.video-collage.com (mi@localhost.video-collage.com [127.0.0.1]) by corbulon.video-collage.com (8.13.4/8.13.1) with ESMTP id j8S5bHQg050601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 28 Sep 2005 01:37:17 -0400 (EDT) (envelope-from mi@corbulon.video-collage.com) Received: (from mi@localhost) by corbulon.video-collage.com (8.13.4/8.13.4/Submit) id j8S5b1rN050598; Wed, 28 Sep 2005 01:37:01 -0400 (EDT) (envelope-from mi) From: Mikhail Teterin Message-Id: <200509280537.j8S5b1rN050598@corbulon.video-collage.com> To: peadar.edwards@gmail.com Date: Wed, 28 Sep 2005 01:37:01 -0400 (EDT) In-Reply-To: <34cb7c840509270253194f7487@mail.gmail.com> X-Mailer: ELM [version 2.5 PL7] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV devel-20050525/1102/Sun Sep 25 10:04:56 2005 on corbulon.video-collage.com X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.43 Cc: re@freebsd.org, gayn.winters@bristolsystems.com, fs@freebsd.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2005 05:37:55 -0000 Thank you very much, Peter! Your patch below makes the card "mountable" and usable. I'm copying my photos right now. I think, this should be merged into 6.0 -- these cards are a popular item... Thanks, again! -mi Index: msdosfs_vfsops.c =================================================================== RCS file: /nfs/dyson/export/home/petere/freebsd-cvs/cvs/FreeBSD/src/sys/fs/msdosfs/msdosfs_vfsops.c,v retrieving revision 1.144 diff -u -r1.144 msdosfs_vfsops.c --- msdosfs_vfsops.c 24 Mar 2005 07:36:13 -0000 1.144 +++ msdosfs_vfsops.c 27 Sep 2005 09:40:19 -0000 @@ -512,9 +512,7 @@ #endif /* !MSDOSFS_LARGE */ if (pmp->pm_RootDirEnts == 0) { - if (bsp->bs710.bsBootSectSig2 != BOOTSIG2 - || bsp->bs710.bsBootSectSig3 != BOOTSIG3 - || pmp->pm_Sectors + if (pmp->pm_Sectors || pmp->pm_FATsecs || getushort(b710->bpbFSVers)) { error = EINVAL; From owner-freebsd-fs@FreeBSD.ORG Wed Sep 28 06:05:49 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 383B816A47D for ; Wed, 28 Sep 2005 06:05:49 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAFE743D48 for ; Wed, 28 Sep 2005 06:05:48 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.11] (junior.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id j8S65ZsM016153; Wed, 28 Sep 2005 00:05:35 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <433A32AE.1030802@samsco.org> Date: Wed, 28 Sep 2005 00:05:34 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050615 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mikhail Teterin References: <200509280537.j8S5b1rN050598@corbulon.video-collage.com> In-Reply-To: <200509280537.j8S5b1rN050598@corbulon.video-collage.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on pooker.samsco.org Cc: re@freebsd.org, peadar.edwards@gmail.com, fs@freebsd.org, gayn.winters@bristolsystems.com Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2005 06:05:50 -0000 Mikhail Teterin wrote: > Thank you very much, Peter! > > Your patch below makes the card "mountable" and usable. I'm copying > my photos right now. > > I think, this should be merged into 6.0 -- these cards are a popular > item... Thanks, again! > > -mi > > Index: msdosfs_vfsops.c > =================================================================== > RCS file: /nfs/dyson/export/home/petere/freebsd-cvs/cvs/FreeBSD/src/sys/fs/msdosfs/msdosfs_vfsops.c,v > retrieving revision 1.144 > diff -u -r1.144 msdosfs_vfsops.c > --- msdosfs_vfsops.c 24 Mar 2005 07:36:13 -0000 1.144 > +++ msdosfs_vfsops.c 27 Sep 2005 09:40:19 -0000 > @@ -512,9 +512,7 @@ > #endif /* !MSDOSFS_LARGE */ > > if (pmp->pm_RootDirEnts == 0) { > - if (bsp->bs710.bsBootSectSig2 != BOOTSIG2 > - || bsp->bs710.bsBootSectSig3 != BOOTSIG3 > - || pmp->pm_Sectors > + if (pmp->pm_Sectors > || pmp->pm_FATsecs > || getushort(b710->bpbFSVers)) { > error = EINVAL; Might this be an attempt by the manufacturer to avoid the potential patent litigation from using msdosfs? I.e. create a slightly non-conformant filesystem so that it can't claim to explicitely be msdosfs/vfat/fat32/whatever, thereby avoiding the patents on those technologies? Since these checks are done after other magic number checks, it's likely safe. I'm fine with it going into RELENG_6 once it hass been committed to HEAD. Scott From owner-freebsd-fs@FreeBSD.ORG Wed Sep 28 06:44:35 2005 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21CF316A41F for ; Wed, 28 Sep 2005 06:44:35 +0000 (GMT) (envelope-from arne_woerner@yahoo.com) Received: from web30309.mail.mud.yahoo.com (web30309.mail.mud.yahoo.com [68.142.200.102]) by mx1.FreeBSD.org (Postfix) with SMTP id 9F3D343D4C for ; Wed, 28 Sep 2005 06:44:34 +0000 (GMT) (envelope-from arne_woerner@yahoo.com) Received: (qmail 10411 invoked by uid 60001); 28 Sep 2005 06:44:34 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=htAlEUciVUleDPYek4itTS+AjLChISLyiSp2JjK90a/jVbIQ0tVZyj4kIDhgUjs8LrXKCqw+mppoxRZDeMZb+xrapDUmQNPBSezpafTjBykgi3kSFGQmUrJca70lBvo5Mv1hLDCUXaN8SCLxbs61zIQ6YiPA4V7Hr4xz5N/eeR8= ; Message-ID: <20050928064434.10409.qmail@web30309.mail.mud.yahoo.com> Received: from [213.54.78.250] by web30309.mail.mud.yahoo.com via HTTP; Tue, 27 Sep 2005 23:44:34 PDT Date: Tue, 27 Sep 2005 23:44:34 -0700 (PDT) From: Arne "Wörner" To: Scott Long , freebsd-fs@freebsd.org In-Reply-To: <433A32AE.1030802@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2005 06:44:35 -0000 > Might this be an attempt by the manufacturer to avoid the > potential patent litigation from using msdosfs? I.e. > create a slightly non-conformant filesystem so that it > can't claim to explicitely be msdosfs/vfat/fat32/whatever, > thereby avoiding the patents on those technologies? > Then that software patent idea wouldn't make much sense, because: It wants to protect the complicated "new" ideas and not things "everybody" could do... Furthermore the FAT filesystem is most likely (I never looked at it myself) quite primitive and based on principles, that are quite old and well known in "administration science" (directories, files, names, references, ...), so that there is nothing "new"... > Since these checks are done after other magic number checks, > it's likely safe. > One message in this thread says, that M*cr*s*ft does not use that values anyway (somehow that data field might be "reserved for later use")... I do not know, why that data field was checked by the FreeBSD code... I say, is the content of that data field somewhere explained or specified? -Arne __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com From owner-freebsd-fs@FreeBSD.ORG Wed Sep 28 08:50:55 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B604716A425 for ; Wed, 28 Sep 2005 08:50:55 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9115743D49 for ; Wed, 28 Sep 2005 08:50:54 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: by zproxy.gmail.com with SMTP id z31so11480nzd for ; Wed, 28 Sep 2005 01:50:54 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=MNlY/MpYPLJbfeda06j4OJ/7A5viC/CYrw4Fv66MWHlIKGqsfahZZ+jxiGgZFz3jnC+tPaah+ul/gWTeYRwazdITAMet/JOxp2EsbNbVJ1ZTE/fTugh0gSKPokcejGS1tyw/uBSzVLUo+Nj4d1cA2ltnNNMzCHy/zwGU+G0K0Cw= Received: by 10.36.12.9 with SMTP id 9mr3358655nzl; Wed, 28 Sep 2005 01:50:54 -0700 (PDT) Received: by 10.36.68.16 with HTTP; Wed, 28 Sep 2005 01:50:53 -0700 (PDT) Message-ID: <34cb7c840509280150212d2bba@mail.gmail.com> Date: Wed, 28 Sep 2005 09:50:53 +0100 From: Peter Edwards To: Scott Long In-Reply-To: <433A32AE.1030802@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200509280537.j8S5b1rN050598@corbulon.video-collage.com> <433A32AE.1030802@samsco.org> Cc: gayn.winters@bristolsystems.com, re@freebsd.org, fs@freebsd.org, Mikhail Teterin Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Peter Edwards List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2005 08:50:55 -0000 On 9/28/05, Scott Long wrote: > Mikhail Teterin wrote: > > Thank you very much, Peter! > > > > Your patch below makes the card "mountable" and usable. I'm copying > > my photos right now. > > > > I think, this should be merged into 6.0 -- these cards are a popular > > item... Thanks, again! > > > > -mi > > > > Index: msdosfs_vfsops.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > RCS file: /nfs/dyson/export/home/petere/freebsd-cvs/cvs/FreeBSD/src/sys= /fs/msdosfs/msdosfs_vfsops.c,v > > retrieving revision 1.144 > > diff -u -r1.144 msdosfs_vfsops.c > > --- msdosfs_vfsops.c 24 Mar 2005 07:36:13 -0000 1.144 > > +++ msdosfs_vfsops.c 27 Sep 2005 09:40:19 -0000 > > @@ -512,9 +512,7 @@ > > #endif /* !MSDOSFS_LARGE */ > > > > if (pmp->pm_RootDirEnts =3D=3D 0) { > > - if (bsp->bs710.bsBootSectSig2 !=3D BOOTSIG2 > > - || bsp->bs710.bsBootSectSig3 !=3D BOOTSIG3 > > - || pmp->pm_Sectors > > + if (pmp->pm_Sectors > > || pmp->pm_FATsecs > > || getushort(b710->bpbFSVers)) { > > error =3D EINVAL; > > Might this be an attempt by the manufacturer to avoid the potential > patent litigation from using msdosfs? I.e. create a slightly > non-conformant filesystem so that it can't claim to explicitely be > msdosfs/vfat/fat32/whatever, thereby avoiding the patents on those > technologies? > > Since these checks are done after other magic number checks, it's likely > safe. I'm fine with it going into RELENG_6 once it hass been committed > to HEAD. > > Scott As I said, I can't see any reference to this signature in the "official" specification for the FAT boot-sector anyway, so I doubt you could claim it wasn't a FAT boot-sector based on that change anyway. I imagine the've just relaxed the spec, and new implementations don't have the baggage of 20 years of evolving operating systems and disk technology lying about :-) I'll commit it this evening. From owner-freebsd-fs@FreeBSD.ORG Wed Sep 28 12:00:34 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 544F416A420 for ; Wed, 28 Sep 2005 12:00:34 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B7E9F43D48 for ; Wed, 28 Sep 2005 12:00:33 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j8SC07Td023780; Wed, 28 Sep 2005 22:00:07 +1000 Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j8SC05nu005433; Wed, 28 Sep 2005 22:00:06 +1000 Date: Wed, 28 Sep 2005 22:00:05 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Mikhail Teterin In-Reply-To: <200509271024.52443@aldan> Message-ID: <20050928214221.S28097@delplex.bde.org> References: <02b301c5c2ba$4b2b9460$c901a8c0@workdog> <200509261654.01697.mi+mx@aldan.algebra.com> <20050927201946.C24713@delplex.bde.org> <200509271024.52443@aldan> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1195320785-1127908805=:28097" Cc: gayn.winters@bristolsystems.com, fs@freebsd.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2005 12:00:34 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1195320785-1127908805=:28097 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Tue, 27 Sep 2005, Mikhail Teterin wrote: > On Tuesday 27 September 2005 07:54 am, Bruce Evans wrote: > %% > da0: reading primary partition table: error reading fsbn 0 > > =3DI think this error message is only printed by 4.x. > > Yes, it was. I tried the same card on 4.x (i386) and 6.0 (amd64). I verified that this error "can't happen" in combination with the other errors, at least in my version of 5.2-CURRENT (which does disk open in essentially the same way as 4.x). When I forced it to happen, open failed as expected for all devices on the disk, so the disk was not readable by msdosfs, fdisk or disklabel. > =3D Try reading slice s1 using dd. =A0I would expect this to fail > > Both > > =09dd bs=3D512 count=3D1024 if=3D/dev/da2s1 of=3D~mi/public_html/s1.begin= ning.dd > and > =09dd bs=3D512 count=3D1024 if=3D/dev/da2 of=3D~mi/public_html/card.begin= ning.dd > > worked fine. You can take a look at the results at > > =09http://aldan.algebra.com:8015/~mi/card.beginning.dd.bz2 > =09http://aldan.algebra.com:8015/~mi/s1.beginning.dd.bz2 > > I'll try Peter's patch today... That patch seems reasonable (except it is missing removal of dead/wrong code in bootsect.h). We got the excessive signature checking from NetBSD, and NetBSD still has it in at least the 2005/01/09 version. Signature checking or initialization is also broken for sector sizes of other than 512. newfs_msdosfs^H^H writes signatures at the end of the sector, but msdosfs and fsck_msdosfs want them at the end of a 512-block. The important signatures are the primary signature and the fsinfo signature= =2E Bruce --0-1195320785-1127908805=:28097-- From owner-freebsd-fs@FreeBSD.ORG Wed Sep 28 12:54:36 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 77DA916A41F; Wed, 28 Sep 2005 12:54:36 +0000 (GMT) (envelope-from rees@citi.umich.edu) Received: from citi.umich.edu (citi.umich.edu [141.211.133.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0805F43D5A; Wed, 28 Sep 2005 12:54:35 +0000 (GMT) (envelope-from rees@citi.umich.edu) Received: from citi.umich.edu (dsl093-001-248.det1.dsl.speakeasy.net [66.93.1.248]) by citi.umich.edu (Postfix) with ESMTP id 620941BBD4; Wed, 28 Sep 2005 08:54:35 -0400 (EDT) To: fs@freebsd.org, re@freebsd.org From: Jim Rees In-Reply-To: Mikhail Teterin, Wed, 28 Sep 2005 01:37:01 EDT Date: Wed, 28 Sep 2005 08:54:35 -0400 Sender: rees@citi.umich.edu Message-Id: <20050928125435.620941BBD4@citi.umich.edu> Cc: Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2005 12:54:36 -0000 Note that the check also must be removed near the top of mountmsdosfs(), at least in the cvs head version. OpenBSD fixed this in 1999, so it's had some testing there. revision 1.17 date: 1999/05/01 23:47:21; author: deraadt; state: Exp; lines: +3 -13 do not count on BOOTSIG0 and BOOTSIG1 being in a msdos filesystem. Not all filesystems need to contain those; mark@nfr.net From owner-freebsd-fs@FreeBSD.ORG Wed Sep 28 13:09:58 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1BB1516A41F for ; Wed, 28 Sep 2005 13:09:58 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE10443D55 for ; Wed, 28 Sep 2005 13:09:57 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: by zproxy.gmail.com with SMTP id z31so39987nzd for ; Wed, 28 Sep 2005 06:09:57 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=eUEnLNFN3l3Zu0uxmvS4hW8wZj6770YtkOAfHe9jmz0V578jzLEjUv8SJirbDlt4LpD7ln+C+kMkwM4XmyFJ8th1g0SkJW5v1rpb37s3F2kKuVddsbeE813bX4w37Gh0GyI0B2J3cP1ft+L+gL7QKkiFIHZuxkajuYlfC1YITes= Received: by 10.36.222.3 with SMTP id u3mr1532390nzg; Wed, 28 Sep 2005 06:09:57 -0700 (PDT) Received: by 10.36.68.16 with HTTP; Wed, 28 Sep 2005 06:09:57 -0700 (PDT) Message-ID: <34cb7c84050928060976c15ecf@mail.gmail.com> Date: Wed, 28 Sep 2005 14:09:57 +0100 From: Peter Edwards To: Jim Rees In-Reply-To: <20050928125435.620941BBD4@citi.umich.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050928125435.620941BBD4@citi.umich.edu> Cc: fs@freebsd.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Peter Edwards List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2005 13:09:58 -0000 On 9/28/05, Jim Rees 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 !=3D BOOTSIG0 > || bsp->bs50.bsBootSectSig1 !=3D BOOTSIG1) { > error =3D 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. (And MSDOSFS_NOCHECKSIG is unconditionally defined anyway) From owner-freebsd-fs@FreeBSD.ORG Wed Sep 28 13:41:30 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1DB6816A41F for ; Wed, 28 Sep 2005 13:41:30 +0000 (GMT) (envelope-from rees@citi.umich.edu) Received: from citi.umich.edu (citi.umich.edu [141.211.133.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFD4943D48 for ; Wed, 28 Sep 2005 13:41:29 +0000 (GMT) (envelope-from rees@citi.umich.edu) Received: from citi.umich.edu (dumaguete.citi.umich.edu [141.211.133.51]) by citi.umich.edu (Postfix) with ESMTP id 638631BBD4; Wed, 28 Sep 2005 09:41:29 -0400 (EDT) To: Peter Edwards From: Jim Rees In-Reply-To: Peter Edwards, Wed, 28 Sep 2005 14:09:57 BST Date: Wed, 28 Sep 2005 09:41:29 -0400 Sender: rees@citi.umich.edu Message-Id: <20050928134129.638631BBD4@citi.umich.edu> Cc: fs@freebsd.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2005 13:41:30 -0000 So the code is there but we never use it? I guess that's ok. OpenBSD just removed it. I think it would make more sense to surround it with ifdef MSDOSFS_CHECKSIG instead. It would be clearer and then you could easily turn it on if you really wanted it. From owner-freebsd-fs@FreeBSD.ORG Thu Sep 29 12:59:42 2005 Return-Path: X-Original-To: fs@FreeBSD.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 785F716A41F for ; Thu, 29 Sep 2005 12:59:42 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E53BE43D49 for ; Thu, 29 Sep 2005 12:59:41 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout2.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j8TCxecL017007; Thu, 29 Sep 2005 22:59:40 +1000 Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy1.pacific.net.au (8.13.4/8.13.4/Debian-3) with ESMTP id j8TCxc6s006696; Thu, 29 Sep 2005 22:59:39 +1000 Date: Thu, 29 Sep 2005 22:59:38 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Peter Edwards In-Reply-To: <34cb7c84050928060976c15ecf@mail.gmail.com> Message-ID: <20050929221805.Y31383@delplex.bde.org> References: <20050928125435.620941BBD4@citi.umich.edu> <34cb7c84050928060976c15ecf@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: fs@FreeBSD.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2005 12:59:42 -0000 On Wed, 28 Sep 2005, Peter Edwards wrote: > On 9/28/05, Jim Rees 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 From owner-freebsd-fs@FreeBSD.ORG Thu Sep 29 13:37:38 2005 Return-Path: X-Original-To: fs@freebsd.org Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 58E6816A41F for ; Thu, 29 Sep 2005 13:37:38 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5F0143D48 for ; Thu, 29 Sep 2005 13:37:37 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: by zproxy.gmail.com with SMTP id z31so220499nzd for ; Thu, 29 Sep 2005 06:37:37 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=m6PGO6AJsZFCRan53mKVxgfN4i3Ael1+VBTjDnKBlasWhGGX1KBiwD0lbeRxoVCD4s6dgBrfVEHrv4irM/PfGNRlpCTbqhXGhzvqfHt04D/Fvdqr9HzUgBKUZLubjZihPWrpeW2bmQSEUxukQLVRhA+dEAQXHFgInFddePRAV4g= Received: by 10.36.13.11 with SMTP id 11mr4477041nzm; Thu, 29 Sep 2005 06:37:37 -0700 (PDT) Received: by 10.36.68.16 with HTTP; Thu, 29 Sep 2005 06:37:37 -0700 (PDT) Message-ID: <34cb7c8405092906377231b78e@mail.gmail.com> Date: Thu, 29 Sep 2005 14:37:37 +0100 From: Peter Edwards To: Bruce Evans In-Reply-To: <20050929221805.Y31383@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050928125435.620941BBD4@citi.umich.edu> <34cb7c84050928060976c15ecf@mail.gmail.com> <20050929221805.Y31383@delplex.bde.org> Cc: fs@freebsd.org Subject: Re: can not mount a large FAT32 filesystem X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Peter Edwards List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2005 13:37:38 -0000 On 9/29/05, Bruce Evans wrote: > On Wed, 28 Sep 2005, Peter Edwards wrote: > > > On 9/28/05, Jim Rees 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 !=3D BOOTSIG0 > >> || bsp->bs50.bsBootSectSig1 !=3D BOOTSIG1) { > >> error =3D 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? Yes: that's what I was saying: I haven't touched the AA55 stuff at all, and I don't really intend to: even if it's #ifdeffed away, it makes sense that the code at least documents the expected layout, even if it doesn't enforce it. > I think the checking for BOOTSIG[0-1] shouldn't be removed or a compile- > time option. I'd be somewhat reticent about re-inserting the check: I have to assume it was removed for valid reasons, and breaking existing filesystems doesn't seem wise. The argument is of course somewhat orthogonal to the original patch, which was to remove the BOOTSIG[23] stuff. > > 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. > When I get some of that mythical free time, I might shove some patches for newfs_msdos in front of you for review :-) From owner-freebsd-fs@FreeBSD.ORG Thu Sep 29 19:45:28 2005 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 519C816A41F for ; Thu, 29 Sep 2005 19:45:28 +0000 (GMT) (envelope-from bsd@unixforge.net) Received: from mail.sectornotfound.com (mail.sectornotfound.com [209.139.233.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id D122743D48 for ; Thu, 29 Sep 2005 19:45:27 +0000 (GMT) (envelope-from bsd@unixforge.net) Received: from hannibal.int.sectornotfound.com (hannibal.int.sectornotfound.com [192.168.98.3]) by murdock.sectornotfound.com (8.13.1/8.13.1) with ESMTP id j8TJjJuT036031 for ; Thu, 29 Sep 2005 12:45:20 -0700 (PDT) (envelope-from bsd@unixforge.net) Received: from [192.168.3.212] (gw.activestate.com [209.17.183.249]) (authenticated bits=0) by hannibal.int.sectornotfound.com (8.13.1/8.12.10) with ESMTP id j8TJjJAZ097483 for ; Thu, 29 Sep 2005 12:45:19 -0700 (PDT) (envelope-from bsd@unixforge.net) Message-ID: <433C444A.7020902@unixforge.net> Date: Thu, 29 Sep 2005 12:45:14 -0700 From: "Eli K. Breen" User-Agent: Mozilla Thunderbird 1.0 (X11/20050101) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: jUFS / UFSj Status Tracking X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2005 19:45:28 -0000 Hello list (and specifically Scott Long), I'm looking for a way to track the status of the jUFS/UFSj (journaled UFS) project. Searching the web at large, the mailing lists, and the FreeBSD site returns a fairly random smattering of statuses/statusii for this/these projects (seemingly run by ScottLong/MattDillion/and others). I've had a look at the oft-mentioned http://repoman.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/user/scottl/ufsj site, which although it offers up the code, doesn't really help in terms of overall status etc. As a sidenote, we're hoping to leverage this to allow for multi-machine access to a consistent file store, in this case it would [hopefully] be accomplished by having a centralized journal, with all machines applying the journal to their local filesystems. Call me madcap if you will... Is there / could there be a central location for tracking this project? Many thanks, Eli K. Breen From owner-freebsd-fs@FreeBSD.ORG Thu Sep 29 19:53:43 2005 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EBEFA16A41F for ; Thu, 29 Sep 2005 19:53:43 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E23843D48 for ; Thu, 29 Sep 2005 19:53:41 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.14] (imini.samsco.home [192.168.254.14]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id j8TJrbo6000817; Thu, 29 Sep 2005 13:53:38 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <433C4641.1000405@samsco.org> Date: Thu, 29 Sep 2005 13:53:37 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.7) Gecko/20050416 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Eli K. Breen" References: <433C444A.7020902@unixforge.net> In-Reply-To: <433C444A.7020902@unixforge.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on pooker.samsco.org Cc: freebsd-fs@freebsd.org Subject: Re: jUFS / UFSj Status Tracking X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2005 19:53:44 -0000 Eli K. Breen wrote: > Hello list (and specifically Scott Long), > > I'm looking for a way to track the status of the jUFS/UFSj (journaled > UFS) project. Searching the web at large, the mailing lists, and the > FreeBSD site returns a fairly random smattering of statuses/statusii for > this/these projects (seemingly run by ScottLong/MattDillion/and others). > I've had a look at the oft-mentioned > http://repoman.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/user/scottl/ufsj > > site, which although it offers up the code, doesn't really help in terms > of overall status etc. > > As a sidenote, we're hoping to leverage this to allow for multi-machine > access to a consistent file store, in this case it would [hopefully] be > accomplished by having a centralized journal, with all machines applying > the journal to their local filesystems. Call me madcap if you will... You want gjournal for this, not ufsj. Here is the project page: http://wikitest.freebsd.org/moin.cgi/gjournal Confusing names, I know, but I didn't pick the name for gjournal =-) Scott From owner-freebsd-fs@FreeBSD.ORG Fri Sep 30 00:51:57 2005 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E53DD16A41F for ; Fri, 30 Sep 2005 00:51:57 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 826A443D53 for ; Fri, 30 Sep 2005 00:51:56 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [192.168.42.23] (andersonbox3.centtech.com [192.168.42.23]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id j8U0plWL036183; Thu, 29 Sep 2005 19:51:55 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <433C8C1C.5070705@centtech.com> Date: Thu, 29 Sep 2005 19:51:40 -0500 From: Eric Anderson User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.11) Gecko/20050914 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Scott Long References: <433C444A.7020902@unixforge.net> <433C4641.1000405@samsco.org> In-Reply-To: <433C4641.1000405@samsco.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.82/1105/Thu Sep 29 16:31:04 2005 on mh2.centtech.com X-Virus-Status: Clean Cc: freebsd-fs@freebsd.org Subject: Re: jUFS / UFSj Status Tracking X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2005 00:51:58 -0000 Scott Long wrote: > Eli K. Breen wrote: > >> Hello list (and specifically Scott Long), >> >> I'm looking for a way to track the status of the jUFS/UFSj (journaled >> UFS) project. Searching the web at large, the mailing lists, and the >> FreeBSD site returns a fairly random smattering of statuses/statusii >> for this/these projects (seemingly run by ScottLong/MattDillion/and >> others). I've had a look at the oft-mentioned >> http://repoman.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/user/scottl/ufsj >> >> site, which although it offers up the code, doesn't really help in >> terms of overall status etc. >> >> As a sidenote, we're hoping to leverage this to allow for >> multi-machine access to a consistent file store, in this case it would >> [hopefully] be accomplished by having a centralized journal, with all >> machines applying the journal to their local filesystems. Call me >> madcap if you will... > > > You want gjournal for this, not ufsj. Here is the project page: > > http://wikitest.freebsd.org/moin.cgi/gjournal > > Confusing names, I know, but I didn't pick the name for gjournal =-) How does gjournal help with this? Seems like the OP wanted a setup more like what Dragonfly is trying to offer - many hosts with up-to-date filesystem copies. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------