Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Secure Erase Files on macOS: 6 Ways

· 5 min read · Home Tech

In this article
  1. Why Trash Isn't Secure
  2. Method 1: Secure Empty Trash (Removed in macOS 10.11)
  3. Method 2: FileVault Full-Disk Encryption
  4. Method 3: Overwrite with Disk Utility (HDDs Only)
  5. Method 4: Terminal Commands (srm, rm -P, diskutil secureErase)
  6. Method 5: Third-Party Secure Erase Tools
  7. How to Choose the Right Method
  8. Common Misconceptions and Pitfalls
  9. Frequently Asked Questions

To securely erase files on macOS so they cannot be recovered, you must overwrite the data or use FileVault encryption—simply moving a file to Trash or emptying it does not destroy the underlying data. This article explains the built-in and third-party methods, what each actually does, and how to choose the right one for your threat level.

Why Trash Isn't Secure

When you empty the Trash, macOS marks the file's disk space as available, but the actual 1s and 0s remain on the drive until overwritten by new data. Standard recovery tools can scan for these remnants and reconstruct files, especially if the drive is an SSD with wear-leveling or if you haven't written much new data since deletion. For a genuinely secure erase, you must overwrite the file's contents with random or fixed patterns, or encrypt the entire drive so that deleted data is inaccessible without the key.

Method 1: Secure Empty Trash (Removed in macOS 10.11)

Older macOS versions (10.10 Yosemite and earlier) included a “Secure Empty Trash” option that overwrote deleted files. Apple removed it in OS X El Capitan (10.11) and later versions because on SSDs, the technique was ineffective—SSDs use wear-leveling and can remap blocks, making overwriting unreliable. If you're on a modern Mac, this option simply doesn't exist, so you need an alternative.

Method 2: FileVault Full-Disk Encryption

FileVault encrypts the entire startup disk with AES-XTS encryption. When you delete a file, only the encrypted data remains; without the password or recovery key, the data is unreadable. This is the most practical secure-erase method for everyday use on modern Macs. To enable it: System Settings → Privacy & Security → FileVault → Turn On. Once enabled, deleting a file and emptying Trash is effectively secure because the file's ciphertext is useless without the key. However, if someone obtains your password or recovery key, they can decrypt everything, so strong password hygiene is critical.

Method 3: Overwrite with Disk Utility (HDDs Only)

For traditional spinning hard drives (HDDs), Disk Utility can securely erase the entire disk by overwriting it. This is not for individual files—it wipes the whole drive. Steps:

  1. Open Disk Utility (in /Applications/Utilities).
  2. Select the disk (not the volume) in the sidebar.
  3. Click Erase.
  4. Choose a format (e.g., APFS or Mac OS Extended).
  5. Click Security Options and choose how many passes to overwrite (e.g., 1-pass, 3-pass, 7-pass). More passes are slower but more thorough.
  6. Click Erase.

Note: On SSDs, this method is less reliable due to wear-leveling, and Apple's Disk Utility may not offer security options for SSDs. For SSDs, the only truly secure erase is to use the drive's built-in secure erase command (often via diskutil secureErase in Terminal, which sends an ATA command to the drive).

Method 4: Terminal Commands (srm, rm -P, diskutil secureErase)

macOS includes several command-line tools:

  • srm (secure remove) – overwrites and deletes files. It was deprecated in macOS 10.12 but still works on many versions. Usage: srm -rf /path/to/file.
  • rm -P – overwrites the file with three passes of random data before deleting. Usage: rm -P /path/to/file.
  • diskutil secureErase – erases an entire disk or partition with a specified level of overwriting. Example: diskutil secureErase 4 /dev/disk2 (level 4 is a 7-pass erase).

These tools work best on HDDs. On SSDs, they may not reach all physical blocks, so they are not recommended as a sole method.

Method 5: Third-Party Secure Erase Tools

Several reputable apps offer secure file deletion with more options and a graphical interface. Examples include Permanent Eraser, Secure Delete, and Eraser for Mac. These tools typically overwrite files with multiple passes (e.g., Gutmann 35-pass, DoD 5220.22-M) and can also wipe free space. When choosing a tool, verify it supports your macOS version and your drive type (HDD vs SSD). Free trials or open-source options exist, but paid versions often offer more features.

How to Choose the Right Method

Your choice depends on your threat model and hardware:

  • Everyday users on modern Macs (SSD): Enable FileVault. It's the most effective and doesn't require extra steps.
  • Deleting a few sensitive files on an HDD: Use rm -P or a third-party tool with multiple passes.
  • Selling or disposing of an old HDD: Use Disk Utility's Security Options with at least 3 passes, or diskutil secureErase.
  • Selling or disposing of an SSD: Use the drive's built-in secure erase (via diskutil secureErase or the manufacturer's utility) or physically destroy the drive. FileVault was enabled from the start is also acceptable.

Common Misconceptions and Pitfalls

  • “Emptying Trash is secure.” It's not, as explained above.
  • “Overwriting on an SSD works like on an HDD.” It doesn't due to wear-leveling and TRIM. SSDs manage blocks internally, so overwriting a file's logical location may not overwrite the physical cells.
  • “Secure erase is instant.” Overwriting a large drive can take hours, especially with multiple passes.
  • “FileVault slows down my Mac.” Modern Macs have dedicated encryption hardware, so the performance impact is minimal.
  • “I can just delete the file and use a file-shredder app.” Many apps claim to shred files but may not work correctly on SSDs. Always check compatibility.

Frequently Asked Questions

Does Secure Empty Trash still exist in macOS?

No. Apple removed it in OS X El Capitan (10.11) because it was ineffective on SSDs. If you see it in an older tutorial, it's outdated.

Is FileVault enough to securely delete files?

Yes, for most practical purposes. Once FileVault is enabled, deleted files are encrypted and cannot be recovered without the password or recovery key. This is the recommended method for modern Macs.

Can I recover files after using rm -P?

On an HDD, likely not, because the data has been overwritten. On an SSD, it's possible that some remnants remain due to wear-leveling, but recovery is extremely difficult and usually not feasible for the average person.

What is the best way to erase an SSD before selling it?

Use the drive's built-in secure erase command via diskutil secureErase or the manufacturer's utility. If that's not possible, enable FileVault, then erase the disk and reinstall macOS—this leaves the drive encrypted with a new random key, making old data unrecoverable.

How long does a secure erase take?

It depends on the drive size and the number of passes. A 1-pass overwrite of a 1TB HDD can take about 2-3 hours. A 7-pass erase can take over 10 hours. SSDs are faster but still not instant.

Does TRIM affect secure deletion on SSDs?

Yes. TRIM tells the SSD that blocks are unused, and the drive may erase them immediately, which can actually help with secure deletion. However, it also means that overwriting a file may not be necessary—the data is gone once TRIM is issued. But this is not guaranteed, so FileVault is still recommended.