Size of metadate?

Rick C. Petty rick-freebsd at kiwi-computer.com
Wed Jun 27 15:04:21 UTC 2007


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


More information about the freebsd-geom mailing list