If a disk contains secure information, it may need to be securely erased.
This article outlines a simple disk-wipe procedure for the Linux command line. Tested on Ubuntu 16.04.
Determine the Target Drive
To find the drive, run the
lsblk command. This will output drive name and mount point:
Determine the relevant disk name from this list.
When you run the
dd command in the “Wipe the Disk” section of this article, the target disk will be completely overwritten.
You should therefore double check that you’re operating on the right drive:
The output should correspond to the target disk you’re expecting to wipe.
Wipe the Disk
This is achieved by writing random data from
/dev/urandom to the target disk.
Block size is set to 1M for the sake of increasing speed -
dd will read and write up to 1M bytes at a time.
Setting the status option to “progress” prints periodic transfer stats to stderr.
The problem with this method is that
dd just writes indefinitely - until eventually it times out. It works, but it is more time consuming than it needs to be.
Use parameters with
dd to wipe a partition/drive:
To wipe whole drive: