Getting useful diagnostics from geom(8) and friends

Rick C. Petty rick-freebsd2009 at kiwi-computer.com
Thu May 27 22:29:23 UTC 2010


On Thu, May 27, 2010 at 02:48:48PM -0700, Garrett Cooper wrote:
> Hi again geom folks,
>      I tried executing the following commands in a script to create 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 dev
path, i.e. "/dev/ad4".  I believe it was with bootcode that I first saw the
problem.

I'm not sure what you're doing wrong.  Do 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

-- Rick C. Petty


More information about the freebsd-geom mailing list