Inserting a USB flash drive, external hard drive, or micro SD card into a Windows 11 or Windows 10 PC often prompts the dialogue: You need to format the disk in drive E: before you can use it. However, clicking ‘Format disk’ and starting the format wizard frequently halts with an error: Windows was unable to complete the format. The drive status changes to RAW in Disk Management, file transfers fail, and File Explorer reports the disk as inaccessible.
Fixing this format failure requires bypassing File Explorer restrictions by using the low-level Windows command-line utility Diskpart to clean partition tables, clear write-protection attributes, and format via raw volume controllers.
Why Does Windows Fail to Complete the Format?
Windows File Explorer formats storage volumes through high-level shell APIs that fail when encountering disk anomalies:
- Read-Only Write Protection Attribute: The flash memory controller has engaged hardware write protection to protect degrading NAND flash, or the read-only flag is set in the partition boot record.
- Corrupted Partition Tables (RAW Format): Interrupted write cycles left the drive’s Master Boot Record (MBR) or GUID Partition Table (GPT) unreadable by the Windows graphical format wizard.
- Physical Bad Sectors in Boot Coordinates: The physical flash blocks designated for volume boot records (LBA 0) cannot be written to.
- Active Process Lock: Antivirus real-time scanners, File Explorer indexing threads, or background applications holding exclusive volume handles.
- Insufficient USB Hub Power: Inadequate electrical current causing the flash storage controller to disconnect during write-intensive zeroing operations.
Step 1: Format Using Diskpart Clean Command
Diskpart bypasses high-level shell locks by wiping the drive’s partition geometry directly:
- Press
Windows Key + Xand select Terminal (Admin) or Command Prompt (Admin). - Launch the disk partitioning tool:
diskpart - List all physical drives connected to your computer:
list disk - Carefully identify your USB drive or SD card by its capacity (e.g. Disk 2 with 29 GB).
- Select your target disk:
(Caution: Verify the disk number matches your USB drive; selecting the wrong disk will erase your internal operating system drive.)select disk 2 - Clear any hardware read-only flags:
attributes disk clear readonly - Completely wipe all partition tables and volume markers:
Confirm the output reads: DiskPart succeeded in cleaning the disk.clean - Create a brand-new primary partition:
create partition primary - Format the volume with a clean filesystem:
(For USB drives smaller than 32 GB or cross-platform use on Mac/Linux, executeformat fs=ntfs quickformat fs=exfat quickinstead.) - Assign a drive letter:
assign - Type
exitto close Diskpart. Open File Explorer to verify the drive is fully functional.
Step 2: Clear Write Protection via Windows Registry
If Diskpart clean returns an error stating The media is write protected, disable global storage write blocks:
- Press
Windows Key + R, typeregedit, and press Enter. - Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies - If the
StorageDevicePolicieskey exists, look for a DWORD named WriteProtect in the right pane. - Double-click WriteProtect and change its value data from
1to0. - Click OK, restart your PC, and re-run the format procedure.
Step 3: Check Physical Write-Protect Switches on SD Cards
SD cards and micro SD card adapters feature a physical mechanical switch:
- Remove the SD card from your card reader.
- Inspect the left edge of the SD card casing.
- Look for the small sliding plastic tab marked LOCK.
- Ensure the switch is slid upward toward the brass contact pins (the unlocked position). If the slider is loose, tape it in the unlocked position.
Step 4: Run Check Disk (CHKDSK) on the Drive
If the volume contains bad sectors preventing format finalisation:
- Open Command Prompt as Administrator.
- Execute:
(Replacechkdsk E: /f /rE:with your drive letter.) - Allow the scan to repair filesystem links and remap physical bad blocks.
Step 5: Identify End-of-Life NAND Controller Lock
When flash storage drives reach their maximum program/erase (P/E) cycle limits or experience catastrophic memory chip failure, flash controllers lock permanently into read-only mode to prevent data corruption. If Diskpart clean fails with I/O device errors, the NAND flash has reached its end of life and the hardware drive must be replaced.