From owner-freebsd-fs@FreeBSD.ORG Sun Oct 23 06:45:29 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 7B93816A41F for ; Sun, 23 Oct 2005 06:45:29 +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 D1F3443D45 for ; Sun, 23 Oct 2005 06:45:28 +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 j9N6jQER028829; Sun, 23 Oct 2005 16:45:26 +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 j9N6jNp4001404; Sun, 23 Oct 2005 16:45:25 +1000 Date: Sun, 23 Oct 2005 16:45:24 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Vulpes Velox In-Reply-To: <20051022162026.59e66eb6@vixen42.vulpes> Message-ID: <20051023150814.S11053@delplex.bde.org> References: <20051022162026.59e66eb6@vixen42.vulpes> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-fs@FreeBSD.org Subject: Re: newfs_msdos oddity 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: Sun, 23 Oct 2005 06:45:29 -0000 On Sat, 22 Oct 2005, Vulpes Velox wrote: > Running into one odd problem with Windows 2000. Apparently Windows > 2000 can read and install to a partition formated with FAT32 by > FreeBSD, but it can't boot it. > > Any one seen any thing odd like this before or have any suggestions? newfs_msdos was broken by GEOM. Try upgrading to FreeBSD-4 or determining the broken parameters manually and setting them on the command line: -o hidden (IIRC, this is just the offset of the subdevice relative to the whole disk; the latter should be given by a DICOGMEDIAOFFSET ioctl). newfs_msdos now almost always gets this wrong. -h heads -u track-size All utilities that deal with BIOS geometries are similarly broken and need similar workarounds. They need the BIOS geometry, but the kernel now only returns the firmware geometry. > I am installing it to a secondary drive in that box. Geometry problems probably only affect booting. In my tests, all versions of DOS and Windows tested (from DOS 4.01 to W95) had no problems recognizing or chkdsking the GEOMed file systems created by newfs_msdos, but I don't remember testing booting and may have done it only for floppies. At least some versions of DOS and/or Windows silently fix up the broken parameters if you run something like "sys d:" to make the disk bootable. This may give another workaround (or show that the bug is unreleated). FreeBSD fsck_msdosfs neither fixes nor finds the broken parameters. The commit log for the commit that cemented the breakage is: % RCS file: /home/ncvs/src/sbin/newfs_msdos/newfs_msdos.c,v % Working file: newfs_msdos.c % head: 1.20 % ---------------------------- % revision 1.19 % date: 2002/11/03 08:54:46; author: scottl; state: Exp; lines: +51 -85 % Bring newfs_msdos into the GEOM world. Totally rewrite and simplify % getdiskinfo(). For the fixed-disk case, bpb->hid probably isn't % handled correctly, but I'm not sure if this is a serious problem since % the primary use of this program is to format floppy disks. % % Reviewed by: phk % ---------------------------- getdiskinfo() actually needed considerable complications to work with GEOM. XML must be parsed to determine the number of hidden sectors, and the old kernel code for guessing the BIOS geometry from the DOS partition table and new or old kernel code for reading DOS partition tables must be cloned. For the fixed-disk case, bpb->hid isn't handled correctly with probablility 1-epsilon (bp->hid == 0 is only correct for the dangerously dedicated case, but WinDOS doesn't support this). The primary use of this program probably isn't to format floppy disks. I think its main use is now for flash disks. I last used it on a DVD+RW dangerously dedicated), and before that for running fs benchmarks on a FreeBSD partition on an ATA disk. Bruce