Erase the free space on the SSD disk of the Ubuntu server, without the possibility of recovery

An Ubuntu server rented from a hoster on a 240GB SSD. I used it for a year. It's time to move. Deleted my data and logs.

Now the task is to "erase" all the free space on the disk, so that the deleted data can not be restored (and ideally, see the list of deleted files, too).

There are of course utilities like Shred, which overwrite a specific file. But I also need to erase all the free space on the SSD drive, where before the data was located.

There is an idea to completely fill the disk with some unnecessary files, for example, upload a movie, and duplicate it until it completely covers all the disk space.

There is an idea to write a PHP script that creates a bunch of files filled with some values until the free space runs out.

But maybe there is some suitable utility for this purpose?

About the fact that who nafik needs your data, you don't have to write)

 0
Author: Ruport, 2019-06-14

2 answers

The easiest way

dd if=/dev/zero of=/tmp/zerofile; rm /tmp/zerofile

Fills all the free space on the partition with "zeros"

If you have multiple partitions, you need to run for each

 1
Author: Антон Скородумов, 2019-06-14 07:47:00

Use the secure-delete utility. On this site has detailed information on how to clean the disk several times with it. If you want to do everything in a different way, you can use a script in Bash that will download the file and delete it:

#!/bin/bash
while true
do
 wget https://site.com/file.mp4
 rm file.mp4
done
 0
Author: , 2019-06-14 07:12:09