clear metadata using dd?

Fernan Aguero fernan.aguero at gmail.com
Tue Jan 9 19:16:46 UTC 2007


On 1/9/07, Pawel Jakub Dawidek <pjd at freebsd.org> wrote:
> On Tue, Jan 09, 2007 at 10:24:04AM -0300, Fernan Aguero wrote:
> > On 1/9/07, Pawel Jakub Dawidek <pjd at freebsd.org> wrote:
> > >On Mon, Jan 08, 2007 at 11:13:15PM -0300, Fernan Aguero wrote:
> > >> On 1/8/07, Gary Palmer <gpalmer at freebsd.org> wrote:
> > >> >On Mon, Jan 08, 2007 at 07:45:06PM -0300, Fernan Aguero wrote:
> > >>
> > >> [snipped]
> > >>
> > >> >> gama# gstripe label -v gs0 /dev/ad4s3 /dev/ad6s3
> > >> >> Can't store metadata on /dev/ad4s3: Operation not permitted.
> > >> >>
> > >> >> This might be because ad4s3 had been part of a gmirror device before I
> > >> >> reorganized my disks and moved the mirror to the s2 slice.
> > >>
> > >> [snipped]
> > >>
> > >> >Any reason that "gstripe clear" or "gmirror clear" doesn't work?  Thats what
> > >> >they're meant to do, as far as I know.
> > >>
> > >> because ad4s3 is no longer part of gm0?
> > >
> > >You get "Operation not permitted." because someone already keep ad4s3
> > >open for writing. Could you send output of 'sysctl -b kern.geom.confxml'
> > >so we can find out who?
> >
> > http://omega.iib.unsam.edu.ar/kern.geom.confxml
> [...]
>
> In this output size of ad4 is 160041885696 bytes.
>
> In your first post, slices are configured this way:
>
> gama# fdisk -s /dev/ad4
> /dev/ad4: 310101 cyl 16 hd 63 sec
> Part        Start        Size Type Flags
>    1:          63    16771041 0xa5 0x00
>    2:    16771923   146795229 0xa5 0x80
>    3:   146795292   188742708 0xa5 0x00
>
> If ad4s3 starts at 146795292 sectors and is 188742708 sectors big, which
> bascially means, that ad4s3 end at offset:
>
>         (146795292+188742708)*512 = 171795456000 bytes
>
> 160041885696 < 171795456000, which means your slices are misconfigured.
> Correct that and it should work.

OK, so perhaps the problem is that I used 160Gb in my calculations
for the media size, expecting that fdisk will 'round down' the size of
the last slice to match available space.

I recalculated all the start/length values for my slices and changed
the fdisk.config I used with fdisk -f and now everything is fine.

Thanks!

<thinking to myself>
but why was I ever allowed to go farther from the end of the media size?
why didn't fdisk say anything?
why didn't geom -- now I know that every single storage provider
is managed by geom :) -- say anything?

Wouldn't it be good if one could tell fdisk to create a slice to start at a
given sector and use '*' as the length (much as bsdlabel allows) so that the
slice would occupy all remaining space?, like in
p 3 165 146800795 *
</thinking to myself>

Again,

thanks!

fernan

-- 
Fernan Aguero


More information about the freebsd-geom mailing list