Securely discard all blocks on a device, removing all data

blkdiscard

  • Discards device sectors on storage devices. Useful for SSDs.
    More information: <https://manned.org/blkdiscard>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

blkdiscard --secure /dev/{{device}}

click the source code to copy install blkdiscard on any operating system with command-not-found.com