How do you permanently delete files so they Cannot be recovered?

Quick Answers

There are a few methods you can use to permanently delete files so they cannot be recovered:

  • Use a secure delete tool like Eraser to overwrite the files multiple times
  • Use BitBleach to shred files by overwriting with random data
  • Format the drive and then fill it completely with other files
  • Physically destroy the drive

Overview of Permanently Deleting Files

When you normally delete a file, the operating system simply marks the space used by that file as being available for future write operations. The data itself is still there on the drive until it gets overwritten. This means deleted files can often be recovered using data recovery software.

If you want to make sure a file is permanently deleted and unable to be recovered, you need to take additional steps to overwrite or physically destroy the disk sectors where that data resides. This article will explore different techniques you can use to achieve permanent file deletion.

File Deletion vs Drive Formatting

Before looking at secure deletion methods, it’s important to understand the difference between deleting individual files and formatting an entire drive.

When you format a drive, the filesystem information is erased but none of the actual data is overwritten. Formatting simply allows new files to be written over the old ones. So formatting alone is not sufficient for preventing recovery of deleted files.

You need to use disk wiping or physical destruction techniques in conjunction with drive formatting to fully erase old data.

Secure Deletion Tools

There are a number of dedicated file shredder programs available that will overwrite deleted files multiple times to prevent recovery:

Eraser

Eraser is a popular free and open source secure deletion tool for Windows. It allows you to selectively overwrite files, folders, and drives with multiple passes of random data.

Eraser utilizes a number of recognized data sanitization standards like the US Department of Defense 5220.22-M standard for securely erasing files beyond recovery.

BitBleach

BitBleach is another free and open source file shredder program. It overwrites files with pseudorandom data generated from cryptographic hash functions.

You can configure the number of overwrite passes and type of pseudorandom algorithm used. By default, it utilizes the SHA-512 cryptographic hash function.

Sdelete

Sdelete is a command-line file deletion tool included with Microsoft Sysinternals. It supports multiple overwrite passes with options for different data patterns to use.

Being a command-line utility allows it to be easily automated and incorporated into batch scripts.

File Shredder

File Shredder is a simple drag-and-drop file wiping utility for Mac OS. It overwrites files up to 35 times by default to prevent recovery.

The free version is limited to shredding 5 files per run. The paid Pro version ($14.99) allows unlimited file shredding.

Erasing Free Disk Space

In additional to thoroughly wiping individual files, you may want to perform a disk wipe on the free space of a drive. This helps ensure leftover data from previously deleted files is not still accessible.

On Windows, Eraser’s drive wipe functionality can be used to overwrite unused space on a drive multiple times.

On Mac, paid tools like WhiteCanyon WipeDrive ($39.99) are available to securely erase free disk space.

Encryption and Deletion

Another option is to encrypt your sensitive files when they are created. Then when you want to delete them, all you need to do is securely delete the encryption key.

Without access to the key, the encrypted data will be inaccessible even if recovered. This avoids the need to overwrite the file contents.

VeraCrypt is a popular free encryption tool that works on Windows, Mac and Linux. It can encrypt full drives as well as create encrypted containers or volumes for storing specific files and folders.

Physically Destroying Drives

For maximum data security, physically destroying the storage device is the most surefire way to prevent data recovery.

Options include:

  • Using a drive crusher to bend, snap and mangle platters
  • Drilling holes through platters to shatter them
  • Degaussing to scramble magnetic domains
  • Disintegrating using pulverizing, incinerating or dissolving in acid

Specialized companies like Blancco offer data erasure services where they will physically destroy drives and provide a certificate of destruction.

However, physical destruction is generally overkill for consumer use cases. Software wiping or encryption of sensitive files is usually sufficient.

Secure Deletion on SSDs

The standard techniques for overwriting files work well on traditional rotational hard disk drives (HDDs). However, solid state drives (SSDs) store data differently and require some special handling.

Unlike HDDs which overwrite data in place, SSDs write data to new cells to avoid wear on the drive. This means overwritten data may continue to exist in unused cells.

The TRIM command informs an SSD which cells are no longer needed and can be erased. Using TRIM helps ensure permanent file deletion on SSDs.

TRIM Support

Most modern operating systems issue TRIM commands automatically during idle drive periods. But you can also manually run TRIM with tools like Idle3 on Linux and the Optimize Drive function in Windows.

Make sure you run TRIM after using a file wiping tool to completely erase deleted file sectors.

ATA Secure Erase

Another option for SSDs is using the drive’s built-in ATA Secure Erase function. This erases all data by resetting all cells to their factory state.

Tools like Parted Magic and HDD Erase allow you to easily perform an ATA Secure Erase on SSDs.

Full Disk Encryption

Enabling full disk encryption on your SSD ensures all deleted data is scrambled and unrecoverable. Deleting the encryption key effectively deletes all files since the encrypted data is meaningless without it.

Popular full disk encryption options include BitLocker on Windows, FileVault on Mac and LUKS on Linux.

Permanently Deleting Files on Removable Media

Special care needs to be taken when securely deleting files on removable media like USB drives, SD cards and external hard drives.

Because these devices may be lost or stolen, encryption should always be used to protect sensitive data stored on removable media.

Full device encryption tools like BitLocker To Go and VeraCrypt are recommended for encrypting removable disks.

Additionally, performance may be much slower when overwriting the entire usable space of a large removable disk. Securely deleting individual files is preferred.

Deleting Files on Solid State Drives

As discussed previously, solid state drives (SSDs) require specific techniques like ATA Secure Erase and TRIM commands to fully erase data.

Here are some tips for permanently deleting files stored on internal or external SSD storage:

  • Use a file shredder like Eraser that issues TRIM commands
  • Manually run TRIM afterward to clean up freed sectors
  • Use Parted Magic to easily perform ATA Secure Erase
  • Enable full disk encryption like BitLocker for complete data erasure

Following these best practices when deleting files from SSDs prevents deleted data from being recovered.

How Long Does Secure Deletion Take?

The amount of time required to permanently shred files depends on several factors:

  • Number and size of files being overwritten
  • Type of storage device (HDD vs SSD)
  • Number of overwrite passes specified
  • Write performance of the drive

As a benchmark, it can take over 2 hours to perform a single-pass DoD overwrite on a 1 terabyte hard drive. Overwriting with multiple passes multiplies this time.

Solid state drives can take even longer due to slower sustained write speeds. But TRIM commands are near instantaneous.

Encrypting a drive takes much less time than overwriting, since only encryption keys need to be deleted. Expect full disk encryption times under an hour for most consumer SSDs and hard drives.

How to Permanently Delete Files in Windows

Here is a summary of different methods for permanent file deletion on Windows computers:

  • Use Eraser to wipe files and drives
  • Utilize SDelete from the command-line
  • Enable BitLocker drive encryption
  • Right-click and permanently delete files from the Recycle Bin
  • Use cipher /w to securely wipe free space
  • Perform full format rather than quick format when erasing drives

Following these best practices for file deletion in Windows ensures sensitive data cannot be recovered.

Eraser

Eraser is one of the best tools available for permanently deleting files on Windows. It can target individual files, folders and drives for multi-pass random data overwriting.

It integrates with the Windows Explorer context menu for easy access to file shredding. Command line usage is also available for scripting secure file deletion operations.

SDelete

SDelete is included in the free Microsoft Sysinternals utilities. As a command line tool, it provides a simple way to securely erase files from automated batch scripts.

For example, to perform a single pass overwrite on MyFile.txt:

sdelete -p 1 MyFile.txt

BitLocker

Enabling full disk encryption with BitLocker ensures all deleted files become completely irrecoverable. It provides a quick way to permanently erase all deleted data on a drive.

Just be sure to have backups of your encryption key. Losing the key means the data will be inaccessible even if recovered.

Recycle Bin

Right-clicking files in the Recycle Bin and selecting “Permanently Delete” will perform a DoD 3-pass overwrite so they can no longer be recovered.

This provides a quick way to securely erase deleted files without needing third-party tools.

Free Space Wiping

Using the cipher command with the /w switch wipes free space on a drive by overwriting it with zeros. This helps delete any leftover data from previously deleted files.

For example, to wipe the C: drive:

cipher /w:C:

Full Format

Performing a full format rather than quick format when erasing a drive helps ensure all sectors are wiped. This removes any deleted files leftover from before the format.

How to Permanently Delete Files on Mac

Here are reliable methods for permanently deleting files on Mac OS:

  • Use a secure deletion tool like File Shredder
  • Enable FileVault full disk encryption
  • Erase free space on the drive using disk utility
  • Physically destroy the drive if disposing of it

File Shredder

File Shredder is an easy to use Mac app for permanently deleting files. Just drag and drop files on it, and it will overwrite up to 35 times by default.

The paid Pro version unlocks unlimited shredding of files and folders.

FileVault

Turning on FileVault full disk encryption instantly makes all deleted files unrecoverable. Destroy the recovery key to permanently erase all encrypted data.

Disk Utility

The Erase Free Space function in Disk Utility performs a 3-pass overwrite on unused drive space to delete any leftover deleted files.

Physical Destruction

For maximum assurance when disposing of an old Mac hard drive, you can physically destroy it. Just make sure you backup data first.

Drilling holes through the platters or smashing with a hammer will demolish the drive beyond repair and prevent data recovery.

Linux File Shredding Commands

Here are some Linux commands that can be used for securely erasing files:

  • shred -overwrite file contents with random data patterns
  • wipe – repeatedly overwrite files, directories or devices
  • srm – securely delete files by overwriting repeatedly (Secure Remove)
  • sfill – securely overwrite free disk space with random data
  • badblocks – test for bad blocks and securely erase data

Using shred

The shred command overwrites a file multiple times to prevent recovery. For example:

shred -uvz -n 10 file.txt

This overwrites file.txt 10 times with random data and deletes it.

Using wipe

The wipe command can recursively delete files from a directory or erase an entire device. For example:

wipe -rf /path/to/files

This securely wipes all files in the given path, overwriting data multiple times.

Using srm

srm stands for “secure rm” and overwrites files before deleting. For example:

srm secret-file.txt

This overwrites secret-file.txt 35 times then removes it.

Using sfill

sfill can be used to overwrite empty disk space on Linux. This helps delete any leftover data from previously deleted files. For example:

sfill -l /dev/sda1

Fills unused space on /dev/sda1 with random data.

Conclusion

There are many techniques available for permanently deleting files beyond recovery. The key options include:

  • Overwrite files multiple times using a secure deletion tool
  • Encrypt sensitive files when they are created
  • Enable full disk encryption on your drive
  • Physically destroy the disk if disposing of it

For consumer use cases, encryption and software file shredding provide a good balance of security and convenience for permanently erasing files. Properly implemented, they ensure your deleted data can never be recovered.