How to Erase Data or Hard Drives Safely and Irretrievably

When we are going to erase the data from our hard disk (for example, we send it to the Windows trash, and we empty it afterwards), the file will have disappeared from its original folder. However, in reality the file has not been deleted, but is still on the hard drive; your space has simply been marked as “free” and is waiting for another file to overwrite your data and take its place. The same happens when we format the hard disk. Its surface is marked as “free”, but in reality the data is still there.

While this file is still here, it is possible to recover it using data recovery programs , very easy-to-use software that, probably, on more than one occasion has saved us from some displeasure. Even if the data has been overwritten by other files, using forensic techniques it is possible to reverse these changes and recover the original data again.

Erase Data or Hard Drives Safely and Irretrievably

Beware of SSDs

Everything we are going to see below is designed to delete data on conventional hard drives, HDD. If we have an SSD, of course these commands and programs will also work and fulfill their function. However, they work very aggressively, doing a lot of writing to drives. And this can damage our SSDs or reduce their useful life considerably.

Most modern SSDs have a system called TRIM. Thanks to it, the data that is erased is usually permanently erased, and it is not necessary to resort to overwriting techniques to ensure its disappearance.

Safely erase a hard drive from Linux

Most Linux distributions come by default with a series of tools that will allow us to safely delete any type of information that we may have on hard drives. Most of what these tools do is erase the data and overwrite the information with other random information. And so several times.

We can use any Linux distro to use the following tools, although it is best to use a distro that is loaded directly into RAM. An Ubuntu Live, and even a recovery distro like SystemRescueCd will allow us to perform this task without problems.

dd

The dd command is one of the most complete Linux commands for copying data. We can use this command to replace all the data on a hard disk with random information so that the data is overwritten and cannot be recovered. To do this, what we must do is run the following command, selecting the drive (hard drive or partition) that we want to clean instead of / dev / sda.

dd if=/dev/urandom of=/dev/sda bs=4096

We can execute this same command 4 times so that the data has been overwritten 4 times with totally random information, and thus they will have completely disappeared.

shred

This is a tool, included in Linux distros, specially designed to safely delete data by overwriting your space with random information. To do this, what we must do is run the program, followed by the number of times we want to overwrite the data, and the drive we want to clean, to safely destroy all the data on that drive.

shred -n 5 -vz /dev/sda

The -vz parameters allow us to see the overwriting process in the console, and when finished, make one last pass to overwrite all the data with “0”, leaving the drive completely clean. We can also add the parameter “–random-source = / dev / urandom” to use the urandom function of the Linux distros instead of their own algorithms.

wipe

Another tool similar to the previous one that, as its name indicates, allows us to clean our hard disk, destroy its information and prevent data from being recovered again.

wipe -kqD /dev/sda

scrub

And finally, let’s talk about scrub. This tool has also been developed to allow us to overwrite all the information on any hard drive or storage device. This tool repeats patterns so that reverse engineering techniques make it much more complicated when trying to retrieve information. This program uses several different algorithms so that the data is practically impossible to recover.

scrub -p dod /dev/sda

Using programs to irretrievably erase data

We may not want to use the Linux console for whatever reason (usually scary). For this reason, we are also going to talk about other programs that help us to delete specific files from the hard disk safely, in addition to safely deleting any hard disk.

DBAN

DBAN - Borrando disco duro DBAN is a free program designed to completely erase any hard drive and, in addition, overwrite all the information on it by random data. This program runs in Live mode, as an independent operating system from RAM, and allows us to choose the unit we want to clean and a series of parameters (such as algorithms or number of passes) to make cleaning as accurate and complete as possible. .

We can download DBAN from the following link .

HDD Low Level Format

HDD Low Level Format

Another program to erase data safely is HDD Low Level Format . What this program does is to completely empty any disk or drive that we select and, later, it allows us to initialize it, marking all the sectors of the hard disk to “0”.

We can download this program from the following link .

Eraser

Eraser Eraser is a program for Windows whose purpose, as the name indicates, is to allow us to delete the files we want. Instead of erasing hard drives or entire partitions, this software is integrated into the Windows context menu so that we can erase any individual file, safely and irretrievably, simply by right-clicking on it.

We can download this program from the following link .

Permadelete

Permadelete - eliminar datos

Another alternative, for those who prefer open source software, is Permadelete. This program has a very simple interface to use to be able to delete any Windows file or folder so that there is not the slightest trace of the file when it is finished, and it is also impossible to retrieve the smallest information about it.

We can download this secure data deletion software from its website .

Fire and destruction

Surely there are times when we have stored on our hard disk information that is too important to fall into the wrong hands. The above methods can help us to delete this data and make it impossible to recover. But there is always the doubt and the smallest possibility that, in the end, this information can be recovered.

If all of the above does not give us enough confidence and we do not want to risk it. The best we can do is to completely destroy the hard drive. And here we can already give free rein to our imagination.

The most common, in the case of normal hard drives and SSDs , is to start destroying them with a drill. We must make several holes throughout the surface of the unit, especially in the plate of traditional hard drives, so that it is as destroyed as possible. Next with a hammer, we must make sure that the plates (in the case of a conventional hard drive) or the memory chips in the case of an SSD, are as ground and destroyed as possible to avoid any recovery attempt.

Fire can also help us destroy any remaining debris, further reducing the chance of anything being recovered. And finally, we must dispose of the remains in different containers, further preventing them from obtaining the parts that provide this recovery.

This is the most paranoid method of erasing the data. But it never hurts to take note.