clear metadata using dd?

Fernan Aguero fernan.aguero at gmail.com
Tue Jan 9 01:43:42 UTC 2007


On 1/8/07, R. B. Riddick <arne_woerner at yahoo.com> 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"?

gama# dd if=/dev/zero of=/dev/ad4s3 oseek=188742707
dd: /dev/ad4s3: Operation not permitted
gama# whoami
root

> What does "gmirror status" say?

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


As I said, I had (past time) a mirror on ad4s3/ad6s3, but I decided to
resize s2 and s3,
so I removed ad6s3 from the mirror, reformatted ad6 (dd bs=512
count=79 only) and
moved all data in ad4s3 to it, but this time I put the active 'a'
partition in the s2 slice.

After doing this I rebooted mounting the root fs from ad6s2a and then
I removed ad4s3 from
the mirror and did the same reformatting with ad4.

> I would remove the gmirror-s with "gmirror remove <device> <disk/slice>" (its
> easier than dd)...

IIRC this is what I did.

-- 
Fernan Aguero


More information about the freebsd-geom mailing list