Simple way to clear arbitrary drive metadata?
Warren Block
wblock at wonkity.com
Fri Sep 28 22:22:03 UTC 2012
Last night, I found that the remnants of a GPT backup table on an MBR
drive prevented it from booting. When reusing drives from old mirrors,
old mirror metadata can be a problem also. And there may be old
hardware RAID metadata at the end of the drive.
It would be great if dd understood negative seek values. This would get
most of that old metadata:
dd if=/dev/zero of=/dev/ada8 seek=-34
...but dd does not understand negative seek values. (Been on my list
for a while to look at that.)
Which leaves things like
diskinfo ada8 | cut -f4
(subtract 34)
dd if=/dev/zero of=/dev/ada8 seek=(calculated value)
That can be done in one command line with bc and backticks, but it's not
clear or elegant. gpart can clear secondary GPT tables, but I'm pretty
sure it won't wipe out that space unless it actually is a GPT table.
Likewise with glabel and gmirror, they're safe because they only touch
data they understand.
Is there something simpler and more blunt?
More information about the freebsd-geom
mailing list