Normally we’d use dd to clean wipe a hard drive as follows after opening a terminal window for a hard disk or USB drive accessible as /dev/sdb :
$ sudo dd if=/dev/urandom of=/dev/sdb status=progress <enter>
Another command to do a secure wipe of /dev/sdb is scrub that can be used as follows:
$ sudo scrub -p dod /dev/sdb <enter>
Note that the above commands completely wipe data and if run by accident will cause data loss. Exercise due caution when using them.
3 thoughts on “How to securely wipe a hard drive or USB drive in Linux using dd or scrub”
These should work on an SSD too, right ? If you fill an SSD to capacity with random data, you’ve overwritten all the blocks (except over-provisioning and bad-blocks) regardless of any remapping or wear-leveling done by the firmware.
I have never tried these on SSDs (SATA or NVMe). You can look up if the SSD manufacturer offers anything on secure wipe or sanitize.
Hope this helps you https://linuxhint.com/securely-recycle-ssd/
Comments are closed.