PDA

View Full Version : remove metadata from disks


Sylhouette
February 4th, 2009, 17:05
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
February 4th, 2009, 18:10
You can use that:

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

pablo
February 5th, 2009, 19:12
It's not good idea to move hdd from host to host, here and there. Let's boot from bootCD ;)

Djn
February 6th, 2009, 02:53
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.)