You need to erase an entire HD, be because you are going to sell or give away an old computer, or because you are a journalist or an IT company that needs to protect data from ending up in wrong hands. What you can do to destroy files on that HD in a definitive, unrecoverable way?
Truly destroying data is not actually as simple as moving files to the recycle bin (using Delete), deleting files (Shift + Delete) or formatting filesystems. When you delete or format, the operating system only erases metadata, making that disk area available to write other files. But the actual bits of the files remain and can be recovered using specialized software.
The most effective way of destroying data is wiping a disk and that is done by writing new data over every single bit. For instance, you can replace all of the hard disk bits with zeroes — a process known as zero fill.
Warning: be careful to not zero fill the wrong disk, which may cause permanent data loss!
Using Linux, run the following command to zero fill a disk (I’m using /dev/sda
as example, remember to change it as you need):
1
# dd if=/dev/zero of=/dev/sda status=progress
For most cases, that should be enough. After that command, recovering files from that disk may require specialized software, specialized hardware, IT experts and it may not be cheap nor guaranteed.
Please note that it is not possible to wipe the disk that holds the operating system while it is running. If you need to wipe that particular disk, the easiest way to get around this issue is to use Live media or to remove the disk and plug it to another computer to wipe it.
If you are a security freak, you can perform a safer wiping by filling the disc with random bits instead of zeroes:
1
# dd if=/dev/urandom of=/dev/sda status=progress
Or you can wipe the disk a few times, instead of wiping it just once:
1
# for i in {1..5}; do dd if=/dev/urandom of=/dev/sda status=progress; done
The Arch Linux wiki discusses alternative ways to securely wipe an entire disk.
If you store very sensitive information on a disk, Security in a Box, a website about digital security tools and tactics, recommends that you wipe the entire disk then phisically destroy the disc itself (using a hammer, for example).
Warning: wear safety goggles and take great caution when destroying a hard drive yourself. Never burn a hard drive, put a hard drive in a microwave, or pour acid on a hard drive.
Source: Lifewire
For instance, Google shreds old hard drives to prevent leakage of customer data.