Hah I was just going to post what HarryE posted. ... only one day later. But since you want the non-gpt labels, it would be more like:
And btw your script looks nice, but you could also try:
This works fine for me, but if you put zfs on a slice, and changed the end sector of the slice BEFORE running labelclear, then I guess some junk could be left behind. (and I don't think this gets the glabel stuff, but glabel has the "destroy" command too)
And on Linux, you use:
Sadly, wipefs isn't always included on rescue CDs. But it does a great job for all known filesystems. I doubt it would work on zfs. And it doesn't zero everything like your script, but it also might reach things outside the bounds of your script too.
# zpool import -d /dev/label/ yourpool
And btw your script looks nice, but you could also try:
# zpool labelclear /dev/da0
This works fine for me, but if you put zfs on a slice, and changed the end sector of the slice BEFORE running labelclear, then I guess some junk could be left behind. (and I don't think this gets the glabel stuff, but glabel has the "destroy" command too)
And on Linux, you use:
# wipefs -a /dev/sdX#
# mdadm --zero-superblock /dev/sdX#
Sadly, wipefs isn't always included on rescue CDs. But it does a great job for all known filesystems. I doubt it would work on zfs. And it doesn't zero everything like your script, but it also might reach things outside the bounds of your script too.