Date: Sun, 23 Oct 2005 16:45:24 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Vulpes Velox <v.velox@vvelox.net> Cc: freebsd-fs@FreeBSD.org Subject: Re: newfs_msdos oddity Message-ID: <20051023150814.S11053@delplex.bde.org> In-Reply-To: <20051022162026.59e66eb6@vixen42.vulpes> References: <20051022162026.59e66eb6@vixen42.vulpes>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051023150814.S11053>