From owner-freebsd-geom@FreeBSD.ORG Thu May 27 22:25:09 2010 Return-Path: Delivered-To: geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D1C0106566C for ; Thu, 27 May 2010 22:25:09 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0DD028FC13 for ; Thu, 27 May 2010 22:25:08 +0000 (UTC) Received: by vws12 with SMTP id 12so607501vws.13 for ; Thu, 27 May 2010 15:25:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=U44vtaKIRo7UvT3oUXQaWmsyNIsY5gZJZAuOo0SRgMA=; b=xjSwcN9hOBWWTlLztnd54QwvG2wlpMvggIg5g1v1pLZDbGlrs0IBNdFT0NV8WkhaGd ehBT57nvIVz16zS0n8Z9iJJuOYiFz1xYT0Of2odLcNczbwKOt+o+85uboxx4b/nsxjA4 CAURBPOVSVJhw5N7smbHKyN/D3MQXHeLFSslM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=XSQ07+hbHAC5ANfuPeeBuWS0p0qCaxXOQz+ZpNkWKjkeiDh+xUeV0sXJf87lNxWTSs sHVIkzip6VenbSITCWUHAeiB9ITqjntttahZRf2JZgFawgwxWnLW9cJEAQ2cTRCgP7VV sJoZ7ryGOHdFNlWogyZf536X8AwCBbyUgTjgE= MIME-Version: 1.0 Received: by 10.229.80.72 with SMTP id s8mr2464133qck.150.1274999107851; Thu, 27 May 2010 15:25:07 -0700 (PDT) Received: by 10.229.190.83 with HTTP; Thu, 27 May 2010 15:25:07 -0700 (PDT) In-Reply-To: <20100527220241.GA82995@kay.kiwi-computer.com> References: <20100527220241.GA82995@kay.kiwi-computer.com> Date: Thu, 27 May 2010 15:25:07 -0700 Message-ID: From: Garrett Cooper To: rick-freebsd2009@kiwi-computer.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: geom@freebsd.org Subject: Re: Getting useful diagnostics from geom(8) and friends X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2010 22:25:09 -0000 On Thu, May 27, 2010 at 3:02 PM, Rick C. Petty wrote: > On Thu, May 27, 2010 at 02:48:48PM -0700, Garrett Cooper wrote: >> Hi again geom folks, >> =A0 =A0 =A0I tried executing the following commands in a script to creat= e a >> clean MBR partition and it's not clear to me where I'm messing up with >> the process in the first step: >> >> % gpart add -b 34 -s 128 -t freebsd ad4 # exits with a non-zero code >> gpart: 22 geom 'ad4' >> >> % gpart create -s MBR ad4 >> gpart: 22 scheme 'MBR' > > Don't you want to run "gpart create" before "gpart add"? > >> % gpart bootcode -p /boot/boot0 -i 1 ad4 >> gpart: No such geom: ad4. > > I noticed weird errors like that before; I've since always use the full d= ev > path, i.e. "/dev/ad4". =A0I believe it was with bootcode that I first saw= the > problem. > > I'm not sure what you're doing wrong. =A0Do the following steps work? > > % gpart create -s MBR /dev/ad4 > % gpart bootcode -b /boot/boot0 /dev/ad4 > % gpart add -b 34 -s 128 -t freebsd /dev/ad4 > % gpart bootcode -p /boot/gptboot -i 1 /dev/ad0 I didn't run #4 (don't want gptboot on the appliance), but all of the steps failed. fdisk doesn't like these Western Digital drives for some whacky reason when I specify fdisk -BIq /dev/ad4, etc... and only after I go in and do the following does it properly reslice the disk: %fdisk -u /dev/ad4 ******* Working on device /dev/ad4 ******* parameters extracted from in-core disklabel are: cylinders=3D484406 heads=3D16 sectors/track=3D63 (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=3D484406 heads=3D16 sectors/track=3D63 (1008 blks/cyl) Do you want to change our idea of what BIOS thinks ? [n] fdisk: invalid fdisk partition table found 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 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 63, size 488281185 (238418 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 53/ head 15/ sector 63 Do you want to change it? [n] y Supply a decimal value for "sysid (165=3DFreeBSD)" [165] Supply a decimal value for "start" [63] Supply a decimal value for "size" [488281185] Explicitly specify beg/end address ? [n] y Supply a decimal value for "beginning cylinder" [0] Supply a decimal value for "beginning head" [1] Supply a decimal value for "beginning sector" [1] Supply a decimal value for "ending cylinder" [53] Supply a decimal value for "ending head" [15] Supply a decimal value for "ending sector" [63] sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 63, size 488281185 (238418 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 53/ head 15/ sector 63 Are we happy with this entry? [n] y The data for partition 2 is: Do you want to change it? [n] The data for partition 3 is: Do you want to change it? [n] The data for partition 4 is: Do you want to change it? [n] Partition 1 is marked active Do you want to change the active partition? [n] We haven't changed the partition table yet. This is your last chance. parameters extracted from in-core disklabel are: cylinders=3D484406 heads=3D16 sectors/track=3D63 (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=3D484406 heads=3D16 sectors/track=3D63 (1008 blks/cyl) Information from DOS bootblock is: 1: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 63, size 488281185 (238418 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 53/ head 15/ sector 63 2: 3: 4: Should we write new partition table? [n] y fdisk: Geom not found: "ad4" %ls /dev/ad4* /dev/ad4 /dev/ad4s1 I vaguely remember there possibly being issues with disk geometry in 7.x, but my memory's a bit hazy... Thanks, -Garrett