From owner-freebsd-current Sat Nov 2 11:25:24 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 25C3037B401; Sat, 2 Nov 2002 11:25:23 -0800 (PST) Received: from zibbi.icomtek.csir.co.za (zibbi.icomtek.csir.co.za [146.64.24.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A4CC43E4A; Sat, 2 Nov 2002 11:25:20 -0800 (PST) (envelope-from jhay@zibbi.icomtek.csir.co.za) Received: from zibbi.icomtek.csir.co.za (localhost [IPv6:::1]) by zibbi.icomtek.csir.co.za (8.12.6/8.12.6) with ESMTP id gA2JP8D8010113; Sat, 2 Nov 2002 21:25:08 +0200 (SAT) (envelope-from jhay@zibbi.icomtek.csir.co.za) Received: (from jhay@localhost) by zibbi.icomtek.csir.co.za (8.12.6/8.12.6/Submit) id gA2JP8IY010112; Sat, 2 Nov 2002 21:25:08 +0200 (SAT) (envelope-from jhay) From: John Hay Message-Id: <200211021925.gA2JP8IY010112@zibbi.icomtek.csir.co.za> Subject: Re: fdisk -BI ob clean disk broken In-Reply-To: <20021102.111356.12003004.imp@bsdimp.com> from "M. Warner Losh" at "Nov 2, 2002 11:13:56 am" To: imp@bsdimp.com (M. Warner Losh) Date: Sat, 2 Nov 2002 21:25:08 +0200 (SAT) Cc: current@freebsd.org, phk@freebsd.org X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > : On 4.x I have been using a slightly modified version of Warner's diskprep > : to write new compact flashes. On -current fdisk die with signal 8 (Floating > : point exception) when this part of the script runs: > : > : $dev = "/dev/r${drive}"; > : system "/bin/dd if=/dev/zero of=$dev count=128 > /dev/null 2>&1"; > : system "/sbin/fdisk -BI $drive"; > : > : $dev is normally da0, which is the compact flash plugged into a Sandisk > : usb CF reader. > > The reason that I do a dd first is to obliterate any MBR that's > there. The intent is to force fdisk to fetch the actual disk geometry > from the disk so that the fdisk lable that is placed on there will > work as a boot disk. Before I added the dd in 4.x, I found that many > CF came with MBRs that didn't match their actual geometry, so when I > tried to boot them, things failed. > > Does removing the dd eliminate the problem? If so, that's likely a > bug in GEOMification of fdisk. Hmmm. I just noticed that the disks probe with zero values for the heads, sectors/track and cylinders. I have tried two different USB CF readers and both do it. On 4.x it probes with the correct values on the same machine and the same devices. So why do they probe wrong? ######### umass0: SanDisk ImageMate CF-SD, rev 1.10/0.12, addr 2 da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-0 device da0: 1.000MB/s transfers da0: 61MB (125440 512 byte sectors: 0H 0S/T 0C) umass0: at uhub0 port 1 (addr 2) disconnected (da0:umass-sim0:0:0:0): lost device (da0:umass-sim0:0:0:0): removing device entry umass0: detached umass0: SanDisk Corporation ImageMate CompactFlash USB, rev 1.10/0.09, addr 2 umass0: Get Max Lun not supported (STALLED) da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-2 device da0: 1.000MB/s transfers da0: 61MB (125441 512 byte sectors: 0H 0S/T 0C) ########### John -- John Hay -- John.Hay@icomtek.csir.co.za / jhay@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message