# remove metadata from disks



## Sylhouette (Feb 4, 2009)

Hello

I am experimenting with zfs, gmirror, gstripe  and the like.
I want to simulate disk swaps and failures and so on.

But sometimes the system reads the old metadata stored on the disk like gm0 from a gmirror.

How can i delete this metadata for old zfs disk and gmirror gstripe disk

I have a second machine where i put in the removed disk and want to clean it.
I want to destroy the metadata to simulate a new disk.

thanks
Johan


----------



## vermaden (Feb 4, 2009)

You can use that:

[cmd=]# dd < /dev/zero > /dev/${YOUR_DISK} bs=16777216[/cmd]


----------



## pablo (Feb 5, 2009)

It's not good idea to move hdd from host to host, here and there. Let's boot from bootCD


----------



## Djn (Feb 6, 2009)

I've always prefered to use dd as _dd if=/dev/zero of=/dev/ad0_ - but that's probably because I don't like the dual-redirects style. Matter of taste, and all that. 

More practically, I suspect the metadata is stored early on the disk, so you should get away with using _bs=1M count=1_ as the options to dd.
(I know ZFS stores the zpool-identifying data in the first MB - not sure about e.g. gmirror.)


----------

