How to Wipe an External Hard Drive Securely
In this article
Yes—you can wipe an external hard drive by formatting it and, if you need strong privacy, overwriting the free space so the data cannot be recovered.
What You’ll Need
- A computer running Windows, macOS, or a Linux distribution.
- The external hard drive you want to erase (connected via USB, Thunderbolt, or eSATA).
- Administrative privileges on the computer.
- Optional: a third‑party wiping utility such as CCleaner, Eraser, or BleachBit for more passes.
Step‑By‑Step
- Back up anything you still need. Once the wipe begins, all data will be irretrievable. Copy required files to another drive or cloud storage.
- Identify the drive letter or device name.
- Windows: Open Disk Management (right‑click Start ► Disk Management) and note the volume label and drive letter (e.g., E:).
- macOS: Open Disk Utility (Applications ► Utilities ► Disk Utility) and note the device name, such as
/dev/disk2. - Linux: Open a terminal and run
lsblkorfdisk -lto locate the external drive (e.g.,/dev/sdb).
- Choose the wiping method.
- Quick format – removes the file system table only; data remains recoverable with forensic tools.
- Full format with zero‑fill – writes zeros across the entire disk, making most consumer‑grade recovery impossible.
- Multi‑pass overwrite – follows DoD 5220.22‑M or similar standards, writing random data several times for higher security.
- Windows: Use Diskpart for a zero‑fill.
- Press Win+X and select Windows Terminal (Admin) or open Command Prompt as administrator.
- Type
diskpartand press Enter. - Enter
list disk– note the number of the external drive. - Type
select disk X(replace X with the correct number). - Run
clean all. This command writes zeros to every sector. Expect several hours for large drives. - When the operation finishes, type
exittwice to close Diskpart. - Open Disk Management, create a new partition, and format it with NTFS, exFAT, or your preferred file system.
- macOS: Use Disk Utility or the
diskutilcommand.- Open Disk Utility, select the external drive in the sidebar (not just the volume), and click Erase.
- Choose a format (APFS, Mac OS Extended, exFAT) and click Security Options… if available. Move the slider to the desired number of passes (1‑Pass = single zero‑fill, 3‑Pass = random data, 7‑Pass = DoD standard).
- Click Erase to start. The UI will display progress and completion.
- Alternatively, open Terminal and run:
diskutil list # locate /dev/diskN sudo diskutil secureErase 0 /dev/diskN # 0 = single-pass zero fill sudo diskutil secureErase 1 /dev/diskN # 1 = single-pass random sudo diskutil secureErase 2 /dev/diskN # 2 = 7‑pass DoD
Replace/dev/diskNwith your drive identifier.
- Linux: Use
ddorshredfor overwriting.- Open a terminal with root privileges (e.g.,
sudo -i). - Confirm the device name (e.g.,
/dev/sdb) usinglsblk. - Zero‑fill with
dd:sudo dd if=/dev/zero of=/dev/sdb bs=4M status=progress
This writes zeros across the whole drive. Replace/dev/sdbaccordingly. - For a multi‑pass random overwrite, use
shred:sudo shred -v -n 3 -z /dev/sdb
-n 3= three random passes,-zadds a final zero pass. - After the overwrite finishes, create a new partition table with
gdiskorparted, then format the new partition withmkfs.ext4,mkfs.ntfs, etc.
- Open a terminal with root privileges (e.g.,
- Verify the wipe. Re‑mount the drive and run a quick file‑system check (Windows:
chkdsk, macOS:diskutil verifyVolume, Linux:fsck) to ensure the new file system is healthy. Optionally, use a recovery tool such as Recuva (Windows) or TestDisk (macOS/Linux) to confirm no old files are detectable.
Common Mistakes
- Wiping the wrong drive. Accidentally selecting the internal system disk instead of the external one will erase your OS. Always double‑check the disk number or device name before issuing destructive commands.
- Using “Quick Format” when you need privacy. Quick format only rebuilds the file‑system table; data remains on the platters and can be recovered with free tools.
- Interrupting the overwrite process. Power loss or forced shutdown mid‑write can leave sectors partially overwritten, creating a mixed‑state that may still contain recoverable fragments.
- Skipping verification. Assuming the wipe succeeded without checking can hide errors like bad sectors that stopped the write early.
- Choosing an incompatible file system. Formatting a drive for a device that does not support the selected file system (e.g., NTFS on a TV that only reads exFAT) will make the drive appear empty but unusable.
Tips
- For SSD‑based external drives, prefer the built‑in Secure Erase command (e.g.,
hdparm --secure‑eraseon Linux) instead of sector‑by‑sector overwrites, which can wear the flash cells. - When using Windows Diskpart, the
clean allcommand automatically creates a new partition table after completion, saving an extra step. - Set the security‑options slider to the highest level only if you truly need DoD‑level protection; each extra pass multiplies the time required.
- If you plan to donate or sell the drive, a single‑pass zero fill is generally sufficient for most buyers, while a multi‑pass wipe adds a layer of confidence.
- Keep the drive connected to a reliable power source; large USB‑C hubs sometimes under‑power high‑capacity drives, causing write errors.
Troubleshooting
- The drive is not listed in Disk Management / Disk Utility / lsblk. Try a different USB cable or port, ensure the drive powers on, and check Device Manager (Windows) or
dmesg(Linux) for hardware errors. - Diskpart reports “Access denied” or “The disk is in use”. Close any Explorer windows, disable BitLocker, and run
diskpartas administrator. If the drive is a system‑reserved partition, you may need to boot from a Windows PE USB to erase it. - macOS security options are greyed out. The drive may be formatted with APFS or a case‑sensitive format that does not support the built‑in secure erase. Re‑format the drive to Mac OS Extended (Journaled) first, then use the security slider.
- Linux
ddhangs or shows “No space left on device”. Verify you are writing to the raw device (/dev/sdb), not a partition (/dev/sdb1). Also confirm the drive is not mounted; unmount withumount /dev/sdb1before overwriting. - After wiping, the drive shows as “Unallocated” and cannot be formatted. The drive may have developed bad sectors. Run a diagnostic tool from the manufacturer’s website (e.g., Seagate SeaTools) and consider replacing the drive if errors persist.
Frequently Asked Questions
Is a quick format enough to protect my data?
No. A quick format only removes the file‑system table; the underlying data remains on the platters and can be recovered with free recovery software.
How many passes do I really need?
For most personal privacy needs, a single pass of zeros or random data is sufficient. Multi‑pass (3‑ or 7‑pass) overwrites are useful only for highly sensitive or classified information.
Can I use the same method on a USB flash drive?
Yes, but flash memory benefits from a built‑in Secure Erase command rather than repeated overwrites, which can reduce the drive’s lifespan.
Will wiping the drive erase hidden partitions?
Yes, when you use a low‑level tool like diskpart clean all or dd on the whole device, every sector—including hidden or recovery partitions—is overwritten.
Do I need special software for a Mac‑only external drive?
No. macOS’s Disk Utility includes a “Security Options” slider that performs zero‑fill or multi‑pass overwrites without third‑party tools.
What should I do if the wipe process takes too long?
Large drives (4 TB and above) can require many hours for multi‑pass wipes. You can abort after a single zero‑fill if time is limited, then verify that the data is unrecoverable with a recovery utility.