Erase Free Space on HDDs and SSDs: Best Methods Explained

Quick Ways to Erase Free Space on Windows, macOS, and Linux

Windows

  1. Built-in: Use Cipher (secure-delete free space)
    • Open Command Prompt as Administrator and run:

      Code

      cipher /w:C

      (Replace C with the target drive letter.)

  2. Third-party GUI: CCleaner’s Drive Wiper — choose “Free Space Only” and wipe with a selected number of passes.
  3. File-based method: Create a large dummy file filled with zeros using PowerShell, then delete it:

    Code

    fsutil file createnew C:\wipefile.bin 10737418240

    (Creates a 10 GB file; delete after creation.)

  4. Note: For SSDs, avoid multi-pass wipes; rely on built-in secure erase or manufacturer tools and enable TRIM.

macOS

  1. Built-in (older macOS): Disk Utility offered “Erase Free Space” in past versions; newer macOS removed it.
  2. Command-line: Fill free space with a temporary file then delete:

    Code

    mkfile -n 10g ~/wipefile rm /wipefile

    (Adjust size as needed.)

  3. Third-party: Tools like Permanent Eraser or BleachBit can overwrite free space.
  4. SSDs: Prefer the SSD’s secure erase or rely on APFS + TRIM; overwriting isn’t recommended for modern SSDs.

Linux

  1. Command-line zero-fill: Use dd to create a file that fills free space, then remove it:

    Code

    dd if=/dev/zero of=/wipefile bs=1M status=progress || true rm ~/wipefile
  2. Use shred to overwrite specific free-space filesystems:
    • For ext4: use wipe or secure-delete’s sfill:

      Code

      sudo apt install secure-delete sudo sfill -v /
  3. For encrypted partitions, free-space wiping is less critical if full-disk encryption is used.
  4. SSDs: Use ATA Secure Erase (hdparm) or the drive vendor’s utilities; avoid excessive overwrites.

Quick Recommendations

  • SSDs: Use drive-specific secure erase or firmware tools; rely on TRIM and avoid multi-pass overwrites.
  • HDDs: Overwriting free space once is generally sufficient for casual privacy; multi-pass is rarely necessary.
  • Always unmount or ensure filesystems are consistent before heavy operations; keep backups.

If you want, I can provide exact commands tailored to your OS version and whether you have an SSD or HDD.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *