Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 May 2010 17:46:27 -0500
From:      "Rick C. Petty" <rick-freebsd2009@kiwi-computer.com>
To:        Garrett Cooper <yanefbsd@gmail.com>
Cc:        geom@freebsd.org
Subject:   Re: Getting useful diagnostics from geom(8) and friends
Message-ID:  <20100527224627.GD82995@kay.kiwi-computer.com>
In-Reply-To: <AANLkTikfGX20EzmhbrctGFdKGAKDxc19XIsRTNJDwErK@mail.gmail.com>
References:  <AANLkTimg6CKc0RTNpd-0oI5MegjVPd0eiS5pQCj-chvV@mail.gmail.com> <20100527220241.GA82995@kay.kiwi-computer.com> <20100527220821.GB82995@kay.kiwi-computer.com> <AANLkTikfGX20EzmhbrctGFdKGAKDxc19XIsRTNJDwErK@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 27, 2010 at 03:27:59PM -0700, Garrett Cooper wrote:
> On Thu, May 27, 2010 at 3:08 PM, Rick C. Petty
> <rick-freebsd2009@kiwi-computer.com> wrote:
> > On Thu, May 27, 2010 at 05:02:41PM -0500, Rick C. Petty wrote:
> >
> > In any case, show us the output of "gpart show /dev/ad4" if there are
> > any problems.
> 
>     Here's the entire operation; I realize there's a rounding error in
> the size calculation with capacity...
> Thanks,
> -Garrett
> 
> ./clear_and_rewrite_partitions ad4
> + atacontrol cap ad4
> + awk /^lba supported/ { print $3 }
> + capacity=268435455
> + dd if=/dev/zero of=/dev/ad4 bs=20m count=1
> 1+0 records in
> 1+0 records out
> 20971520 bytes transferred in 0.610148 secs (34371204 bytes/sec)
> + expr 0 + 268435455 / 1024 - 1
> + dd if=/dev/zero of=/dev/ad4 bs=1m oseek=262142
> dd: /dev/ad4: Input/output error
> 1+0 records in
> 0+0 records out
> 0 bytes transferred in 0.021521 secs (0 bytes/sec)

This last step is unnecessary, and there's something wrong with your math.
268435455 sectors is ~128 GiB, since each sector is 512 bytes.  So seeking
to 256 GiB won't work.  Also you probably want lba48 not lba, or you'll
always be limited to 268435455 which is rarely (never?) the actual disk
size.

> + ls /dev/ad4s*
> ls: /dev/ad4s*: No such file or directory
> + gpart create -s MBR ad4
> gpart: 22 scheme 'MBR'
> + gpart bootcode -b /boot/mbr -p /boot/boot0 -i 5 ad4
> gpart: No such geom: ad4.

I'm not sure you want to use both -b and -p options at the same time..
does that even work?

Regardless, try my aforementioned suggestion of specifying the complete
device path when running "gpart bootcode".

Also, what is partition #5 here?

> + gpart add -b 34 -s 128 -t freebsd ad4
> gpart: 22 geom 'ad4'
> + gpart show ad4
> gpart: No such geom: ad4.
> + ls /dev/ad4s*
> ls: /dev/ad4s*: No such file or directory

Are you sure geom_part_mbr and geom_part_bsd are kldload'd?

-- Rick C. Petty



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100527224627.GD82995>