If you wish to completely wipe the disk, leaving nothing behind, this is the process that I generally follow:
Boot into a live session using the Ubuntu installation USB
Open the terminal and directly write random data to the entire disk. Assuming you have just one SATA disk, the command would look something like:
dd if=/dev/urandom of=/dev/sda bs=1M
Note: This destroys all partitions and all data. There is no undo. Use with care.
(Optional) Install the next OS of choice.
Some people suggest using /dev/zero
rather than /dev/urandom
, however, some SSDs will not write blocks of zeroes in predictable ways depending on the firmware installed. If you are using a spinning disk, /dev/zero
is more than sufficient unless you need to wipe a disk that can escape reconstruction by nation state-level intelligence agencies.