How to Permanently Remove Bad Sectors from an External Hard Drive
In this article
You cannot repair a physically damaged sector, but you can permanently remove bad sectors from your external hard drive by forcing the drive to mark them as unusable and replace them from its spare pool. The reliable method is a full write-zero format (also called a low-level format or secure erase) followed by a surface scan to confirm the drive's health. Before you start, back up every file you care about: this process erases the entire drive, and a drive with many bad sectors may fail completely during the operation.
What You'll Need
- A Windows PC (the steps below use Windows tools; macOS and Linux equivalents are noted where they differ).
- A working external hard drive enclosure or SATA-to-USB adapter if you plan to test the bare drive.
- Free disk utility software that can write zeros and read the full surface, such as the manufacturer's own diagnostic tool (SeaTools, WD Dashboard, Samsung Magician) or a general tool like HDDScan or CrystalDiskInfo for health checks.
- A second drive with enough space to hold your backup.
- Stable power: use a powered USB hub or the drive's own power adapter. Never run a surface scan on a laptop that might sleep or lose power.
Step-by-Step
- Back up your data first. Copy every file you need to another drive. A full zero-write will destroy all data on the external drive, and a failing drive can drop offline mid-write, taking the remaining files with it. Verify the backup opens before continuing.
- Check the drive's SMART health. Install CrystalDiskInfo (or use the manufacturer's tool) and read the health status and the Reallocated Sectors Count and Pending Sector Count attributes. If the status says Caution or Bad, note the raw values: you will compare them after the repair. A drive with a rapidly growing reallocated count is dying and should be replaced, not repaired.
- Connect the drive directly to the PC. Use a rear USB port on a desktop or a powered hub. Avoid unpowered hubs, USB extension cables and front-panel ports, which can cause the drive to disconnect during a long write.
- Find the drive's disk number. Open Disk Management (right-click Start and choose Disk Management, or press Windows+X and pick it). Identify the external drive by its capacity and label. Note its Disk number, for example Disk 2. Labels differ slightly between Windows versions, so confirm by size, not just by letter.
- Open Command Prompt as administrator. Search for cmd, right-click Command Prompt and choose Run as administrator.
- Write zeros across the whole surface. The safest built-in method is Diskpart's clean all command, which writes zeros to every sector. In the elevated Command Prompt, type
diskpart, thenlist disk, thenselect disk N(replace N with your external drive's number from step 4), thenclean all. This takes hours on large drives and gives no progress bar, so leave the PC awake. Double-check the disk number before pressing Enter: clean all erases the selected disk completely. - Alternative: use the manufacturer's tool. If you prefer a graphical interface, most drive makers offer a write-zero or full-erase option in their diagnostic utility. Select the external drive, choose the full or low-level erase, and let it finish without interruption.
- Re-initialize and format the drive. After the zero-write, open Disk Management, right-click the drive and choose Initialize Disk if prompted, then create a new simple volume and format it as NTFS (or exFAT if you need cross-platform use). A quick format is fine here because the surface was already written.
- Run a full surface scan. Use the manufacturer's tool or a utility like HDDScan and run a full read scan (sometimes called a surface test or error scan). This reads every sector and forces the drive to detect and remap any remaining weak sectors. It can take several hours.
- Compare SMART values. Reopen CrystalDiskInfo and check the Reallocated Sectors Count again. If the number rose during the scan, the drive found and remapped more defects, which is normal for a worn drive but a warning sign if it keeps climbing. If the pending count dropped to zero and the health status is Good, the bad sectors have been dealt with as far as the drive firmware allows.
- Test with real data. Copy a few gigabytes of files onto the drive, eject it safely, reconnect it and read the files back. Repeat once. If files copy and read without errors, the drive is usable again, though you should keep backups and monitor it.
Common Mistakes
- Skipping the backup. The zero-write is irreversible. There is no undo.
- Selecting the wrong disk in Diskpart. Always confirm by capacity and disk number before running clean all. Unplug other external drives to avoid confusion.
- Using a quick format only. A quick format does not touch most sectors, so it will not force remapping. You need a full zero-write or full format.
- Interrupting the scan. Stopping a surface scan partway leaves the drive in an unknown state and can make things worse.
- Believing bad sectors are truly gone. The drive hides them by remapping, but the physical defects remain. A drive with many reallocated sectors is on borrowed time.
- Running the process over a flaky USB connection. A disconnect mid-write can corrupt the drive's partition table; you would then need to re-initialize it.
Tips
- Run the process overnight and disable sleep in Windows power settings so the PC does not suspend mid-scan.
- Keep the drive cool. External enclosures with poor ventilation can cause write errors that look like bad sectors.
- If the drive is still under warranty, check the manufacturer's policy before writing zeros: some tools log the operation, and a drive that fails during the test may be easier to claim.
- For macOS, Disk Utility's Erase with the Security Options set to overwrite with zeros achieves the same result; on Linux,
dd if=/dev/zero of=/dev/sdX bs=1M status=progresswrites zeros, but confirm the device name withlsblkfirst. - After repair, keep the drive for non-critical data only and maintain a second backup.
Troubleshooting
- The drive disappears during the zero-write. Stop, reconnect it to a different port, and check the cable and enclosure. If it disconnects again, the drive or its USB bridge is failing.
- Diskpart says the disk is write-protected. Check the enclosure's write-protect switch if it has one, try another cable, and confirm the drive is not mounted read-only by another program.
- The scan finishes with errors still reported. Run a second full scan. If errors persist or the reallocated count keeps rising, the drive has exhausted its spare sectors and should be replaced.
- Windows will not initialize the drive after cleaning. Open Disk Management, right-click the disk and choose Initialize Disk, then create a new volume. If initialization fails, the drive's firmware or platters are likely damaged.
- The drive clicks or beeps. Stop immediately. That is a mechanical failure, not a logical bad sector issue, and no software can fix it. Power it down and consider professional data recovery if the data matters.
Frequently Asked Questions
Can bad sectors ever be truly repaired?
No. A bad sector is physical damage to the magnetic surface or a weakness in the drive's internals. Software can only mark the sector as unusable and redirect reads and writes to a spare sector, which is what a zero-write and scan achieve.
Will a full format remove bad sectors?
A full format writes to every sector and can trigger remapping, but a dedicated zero-write (clean all or the manufacturer's erase tool) is more thorough and is the recommended first step.
How long does the process take?
Expect several hours for a multi-terabyte drive: a zero-write and a full read scan each take roughly the drive's capacity divided by its sustained speed, so a 4 TB drive can take most of a day in total.
Is it safe to keep using a drive after remapping bad sectors?
For non-critical files, yes, with backups. If the reallocated sector count is high or rising, replace the drive; remapping hides problems but does not restore reliability.
Does this work on SSDs?
SSDs do not have bad sectors in the same sense and handle defects internally. A secure erase can reset an SSD, but do not run mechanical surface scans on one; use the manufacturer's SSD utility instead.
Can I recover data from a drive with bad sectors?
Sometimes, by cloning the drive with imaging software that skips unreadable areas, but stop using the drive and seek professional help if the data is important.