Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jun 2007 09:37:40 -0500
From:      "Rick C. Petty" <rick-freebsd@kiwi-computer.com>
To:        Nico -telmich- Schottelius <nico-freebsd-geom@schottelius.org>
Cc:        freebsd-geom@freebsd.org
Subject:   Re: Size of metadate?
Message-ID:  <20070627143740.GB44589@keira.kiwi-computer.com>
In-Reply-To: <20070626220914.GA11511@schottelius.org>
References:  <20070626220914.GA11511@schottelius.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 27, 2007 at 12:09:14AM +0200, Nico -telmich- Schottelius wrote:
> 
> Now my question is, how can I clear the metadata block via dd?
> I think dd skip=(size_of_hd_in_512_bytes_blocks-gmirror-size)
> if=/dev/zero of=/dev/amrd0 count=?? should do the job, but I am not
> aware how many bytes to clear.

I had a similar problem when using gmirror+gpt and transitioning to using
gvinum instead.  Turns out if you don't clear the metadata using dd, the
kernel panics (in an infinite loop of device name failures) after adding
the device to gvinum.  To be on the safe side, I did:

dd if=/dev/zero of=/dev/adXX bs=1m count=1
dd if=/dev/zero of=/dev/adXX bs=1m count=1 seek=YY

Where XX is the disk in question and YY is the disk's size in MB minus 1.
Since some GEOM classes write their metadata at the front and others write
their metadata at the end, I now do both steps to ensure the metadata is
cleared.

In your particular case, I don't see how gmirror would taste the disk if
the number of blocks changes.  I thought it did a seek to end of device
minus 512, read the block, and if it doesn't fit the magic the device is
skipped.  Perhaps another disk in the mirror is still expecting to find
this resized disk, in which case you need to use "gmirror forget".

-- Rick C. Petty



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