clear metadata using dd?

Fernan Aguero fernan.aguero at gmail.com
Tue Jan 9 02:08:43 UTC 2007


On 1/8/07, Pawel Jakub Dawidek <pjd at freebsd.org> wrote:
> On Mon, Jan 08, 2007 at 03:17:51PM -0800, R. B. Riddick wrote:
> > --- Fernan Aguero <fernan.aguero at gmail.com> wrote:
> > > I imagine I have to use something like
> > > dd if=/dev/zero of=/dev/ad4s3? bs=512 count=1
> > >
> > > but adding either skip=? or seek=? to taste.
> > >
> > > 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
> > >
> > What about "dd if=/dev/zero of=/dev/ad4s3 oseek=188742707"?
> >
> > What does "gmirror status" say?
> > I would remove the gmirror-s with "gmirror remove <device> <disk/slice>" (its
> > easier than dd)...
>
> If there is a gmirror configured on adXs3, I'd suggest doing:

No, there's no mirror in adXs3 now ... there *was* a mirror on that
slice before ... but ...
I didn't zero the whole disk before reorganizing the slices and
partitions, I resized s2
and s3, thus erasing the metadata on the old s2 slice (gstripe), but
of course, this
didn't affect the last sector of the last slice ... which is still there :)

>         # gmirror stop <name of the mirror on adXs3>
>         # gmirror clear adXs3

I can't stop the gm0 mirror now, cause the root partition is mounted
from it now.
But although it doesn't have adXs3 listed as a consumer, I can why perhaps
the fact that gmirror is loaded and running might be preventing operations that
alter metadata (the old gmirror device was also named gm0 ... is this stored in
the metadata and checked?)

gama# gmirror status
      Name    Status  Components
mirror/gm0  COMPLETE  ad4s2
                                     ad6s2

gama# gmirror clear ad4s3
Can't clear metadata on ad4s3: Operation not permitted.
Not fully done.

IIRC, I did gmirror remove gm0 ad4s3 before turning to reformat ad4
... and according
to gmirror(8):
remove	 Remove the given component(s) from the mirror and clear meta-data on it.

Now, what if I boot from ad6s2a (remove geom_gmirror_load="YES" from
loader.conf,
and change my fstab accordingly so that there's nothing 'active' or
'loaded') and try to
clear ad4s3 again now?

Fernan

-- 
Fernan Aguero


More information about the freebsd-geom mailing list