Destroy GPT partition scheme absolutely, how?

Ngie Cooper yaneurabeya at gmail.com
Mon Sep 26 15:36:27 UTC 2016


> On Sep 26, 2016, at 22:48, Ernie Luzar <luzar722 at gmail.com> wrote:

...

> This little script has been posted before. Maybe it will be what your looking for. Called gpart.nuke
> 
> #! /bin/sh
> echo "What disk do you want"
> echo "to wipe? For example - da1 :"
> read disk
> echo "OK, in 10 seconds I will destroy all data on $disk!"
> echo "Press CTRL+C to abort!"
> sleep 10
> diskinfo ${disk} | while read disk sectorsize size sectors other
> do
> # Delete MBR and partition table.
> dd if=/dev/zero of=/dev/${disk} bs=${sectorsize} count=1
> # Delete GEOM metadata.
> dd if=/dev/zero of=/dev/${disk} bs=${sectorsize} oseek=`expr $sectors - 2` count=2
> done

Why not just use "gpart destroy -F provider"?

Cheers,
-Ngie


More information about the freebsd-current mailing list