From owner-freebsd-current Sat Nov 2 11:34:11 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 B1A7D37B401 for ; Sat, 2 Nov 2002 11:34:09 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDC3E43E4A for ; Sat, 2 Nov 2002 11:34:08 -0800 (PST) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id gA2JXh9d099422; Sat, 2 Nov 2002 20:33:51 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: John Hay Cc: imp@bsdimp.com (M. Warner Losh), current@freebsd.org Subject: Re: fdisk -BI ob clean disk broken In-Reply-To: Your message of "Sat, 02 Nov 2002 21:25:08 +0200." <200211021925.gA2JP8IY010112@zibbi.icomtek.csir.co.za> Date: Sat, 02 Nov 2002 20:33:43 +0100 Message-ID: <99421.1036265623@critter.freebsd.dk> From: Poul-Henning Kamp 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 In message <200211021925.gA2JP8IY010112@zibbi.icomtek.csir.co.za>, John Hay wri tes: >> : 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? I have no idea either, but the answer must be somewhere in the da driver... -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message