Date: Thu, 27 May 2010 15:25:07 -0700 From: Garrett Cooper <yanefbsd@gmail.com> To: rick-freebsd2009@kiwi-computer.com Cc: geom@freebsd.org Subject: Re: Getting useful diagnostics from geom(8) and friends Message-ID: <AANLkTinRhDF2XmyvvbqlhtP2gwsnOiOxv-mKTCAx4feb@mail.gmail.com> In-Reply-To: <20100527220241.GA82995@kay.kiwi-computer.com> References: <AANLkTimg6CKc0RTNpd-0oI5MegjVPd0eiS5pQCj-chvV@mail.gmail.com> <20100527220241.GA82995@kay.kiwi-computer.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 27, 2010 at 3:02 PM, Rick C. Petty <rick-freebsd2009@kiwi-computer.com> 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: <UNUSED> Do you want to change it? [n] The data for partition 3 is: <UNUSED> Do you want to change it? [n] The data for partition 4 is: <UNUSED> 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: <UNUSED> 3: <UNUSED> 4: <UNUSED> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinRhDF2XmyvvbqlhtP2gwsnOiOxv-mKTCAx4feb>