Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Clear a Drive With DiskPart in Windows

Understand the difference between clean and clean all, verify the physical disk before running either command, and choose the right method for disposal.

Table of Contents

DiskPart’s clean removes partition information from the selected physical disk. clean all writes zeros across sectors that Windows can address. Both apply to the whole disk, so selecting a disk that contains several drive letters can affect all of those volumes.

Identify the disk before running an erase command

Back up every volume you want to keep and open a few files from the backup. Disconnect nonessential external drives. Use Disk Management to check which physical disk contains your target volume. If you only need to format one partition, use that volume’s Format command instead.

  1. Open Command Prompt as administrator and run diskpart.

    How to Erase Windows 10 Drive with DiskPart Picture 1

  2. Run list disk and identify the target by size. Disk numbers can change when drives are reconnected.

    How to Erase Windows 10 Drive with DiskPart Picture 2

  3. Enter select disk N with the correct number, then detail disk. Compare the reported model and volumes with the target. If the result is ambiguous, exit without erasing anything.

    How to Erase Windows 10 Drive with DiskPart Picture 3

Choose the action that fits

  • clean: Removes partition information quickly so you can repartition the disk. The underlying file data may still be recoverable.

    How to Erase Windows 10 Drive with DiskPart Picture 4

  • clean all: Overwrites the disk’s addressable sectors and can take a long time. Confirm the physical disk again before issuing the command. On an SSD or drive with remapped sectors, this is not proof that all physical locations were sanitized.

    How to Erase Windows 10 Drive with DiskPart Picture 5

See Microsoft’s DiskPart clean reference. A disk meant for reuse can be initialized and given a new partition in Disk Management after the operation. If Windows still cannot use it, see how to diagnose a drive that won’t format.

When disposing of a drive with sensitive data

Use a sanitization method appropriate to the device and the data. A supported manufacturer sanitize or secure-erase feature may be appropriate for an SSD. Follow your organization’s process for managed devices. If you are troubleshooting a failing drive and need its files, prioritize recovery before writing to it.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.