Skip to content

Instantly share code, notes, and snippets.

@dragon788
Created December 6, 2017 23:30
Show Gist options
  • Save dragon788/b5c98661e2d5191c55412a98a87eda32 to your computer and use it in GitHub Desktop.
Save dragon788/b5c98661e2d5191c55412a98a87eda32 to your computer and use it in GitHub Desktop.
Securely wiping NVMe SSD drives using Linux (Ubuntu/Debian shown but others are supported)

In order to securely wipe an NVME drive you can use the nvme-cli package that provides the nvme command nvme only exists in the root path so you have to use sudo nvme.

For Debian you need to add jessie-backports (on jessie) and it may be in the newer version default repos. For Ubuntu it should be available in the default repos from Xenial onwards, there may be a PPA if you need it on earlier versions.

You can find your devices with sudo nvme list and securely format with sudo nvme /dev/nvme0n1 --ses=1. You can also explicitly add a namespace but I haven't seen or setup a drive with multiple yet.

Soon I'd like to make an extremely tiny netbootable image with Alpine or Debian to boot with https://netboot.xyz as pulling down the Debian LiveCD and adding the extra repository just to run a couple commands was overkill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment