Secure erase an NVMe drive

sudo apt install nvme-cli
sudo nvme format /dev/device -s 1

This method will only work with NVMe drives.
See this post for SSDs.
See this post for HDDs.

Download Ubuntu (or any supported distro) and create a bootable USB with Rufus.

Boot to the USB drive and click Try Ubuntu.

Open a terminal window and run sudo apt install nvme-cli to install nvme-cli.
You’ll need an internet connection to download nvme-cli

sudo apt install nvme-cli

Use lsblk to find the device you want to erase.
Your drive may have a “disk” and multiple “part” types. In most cases you will want the “disk” type above the “part” types.


Run sudo nvme format /dev/<device> -s 1

sudo nvme format /dev/<device> -s 1

sudo: runs command as root
nvme format: nvme-cli format command
-s 1: Uses Secure Erase setting 1 (User Data Erase)
See the nvme-cli or nvme-cli format namespace man pages for more details.