0

i did a 'new install' of ubuntu on an old windows laptop. I probably will sell/donate this machine and want to 'rewrite' all the free disk space because i think when ubuntu created new 'partion tables?' , my old data is still there physically on disk

is there a simple linux app or command that can maybe rewrite all the free space with garbage data, it doesnt have to be NSA grade security :) ?

1 Answers1

0

If you wish to completely wipe the disk, leaving nothing behind, this is the process that I generally follow:

  1. Boot into a live session using the Ubuntu installation USB

  2. 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.

  3. (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.

matigo
  • 24,752
  • 7
  • 50
  • 79