Clearing a stubborn storage device

Possible methods to clear a disk

WARNING:

To avoid someone copy pasting thus wiping their primary disk - replace $DEViCE with the actual device - don't append any partitions - just the device path. To get device paths

lsblk -no PATH

Execute as root - adding a failsafe layer to the listed commands - any one command should suffice.

  1. OPTION

    Removes all traces of partition information including super blocks etc.

    # sgdisk --zapall $DEVICE
  2. OPTION

    Write zeroes to the first 10M - effectively removing partition information

    # dd if=/dev/zero of=$DEVICE bs=1M count=10
  3. OPTION

    Creates a new GPT partition table with a single unformatted partition of Linux filesystem type

    # printf 'o\ny\nn\n\n\n\n\nw\ny\n' | gdisk $DEVICE
  4. OPTION

    SSD memory cell cleaing