Safe and secure Linux disc shredding

Today, when cloud servers are so popular always remember to wipe out your server data when you are deleting your VPS node or returning a dedicated server.

If you are running Debian it’s easy to install a secure-delete utility with the following utilities:

srm – securely delete an existing file
smem – securely delete traces of a file from ram
sfill – wipe all the space marked as empty on your hard drive
sswap – wipe all the data from you swap space.

To install secure-delete tools, run the following command with ROOT privileges:

apt-get install secure-delete

To safely shred the Linux server file system do the following (this will ensure none can restore any data from the hard drive):

  • Backup all the data you need
  • Copy all your backed up data to a remote/different system (or backup system, online safe secure storage etc)
  • Delete the files/directories, clean up the server
  • Now execute “sfill /tmp/&” where /tmp/ is the folder name. It may take hours to run through multiple fill-delete cycles.

However, to be 100% sure that no data can be ever restored you will need to delete the partition(s), create a new partition and format this partition with your new filesystem of your choice. Then install Linux OS, secure-delete tool and run it in “paranoid” mode for hours, perhaps days depending on how large is the partition and how fast is the filesystem.

This is it.


Leave a Reply