Sunday, September 19, 2010

How to Properly Delete a Drive

Shred is a Unix command that can be used to securely delete files and devices so that they can be recovered only with great difficulty with specialized hardware, if at all1. It is a part of GNU Core Utilities.

Erasing a file usually only erases the file system entry and keeps the content of the file intact. This frequently allows the file to be recovered using commonly available software. Even if the file is overwritten, residual magnetic fields may allow data recovery using specialist hardware equipment.

To prevent this, shred overwrites the file multiple times using patterns chosen to maximize destruction of the residual data. The articles data erasure and data remanence have additional information.
Source: Wikipedia

To use shred in a terminal type:
sudo shred -vfz -n 3 /path to drive

This command is dangerous as it makes your files unrecoverable. Make sure you know what you are doing.

The -vfz part:
v, --verbose show progress
f, --forces change permissions to allow writing if necessary
z, adds a final overwrite with zeros to hide shredding

The -n 3 part:
Overwrite the disk 3 times, the default is 3
You can change the number depending on how thorough you want to delete your data. The more overwrites the longer the process. If you're really paranoid 10 will shred it for sure plus a couple more times.

The /path to drive is the most important. Make sure you have the correct path to your drive.

To list all drives currently connected to your PC in a terminal type:
sudo fdisk -l

No comments:

Post a Comment