Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Format Drive Using Command Prompt and Diskpart

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Formatting a drive with Command Prompt and Diskpart gives you full control over the file system, partition layout, and quick vs. full format options—without needing third-party software. It works on internal hard drives, external USB drives, and SD cards. Before you start, back up any data you want to keep: formatting erases everything on the selected drive. You'll also need to run Command Prompt as an administrator, and you must know which disk number corresponds to the drive you want to format—getting this wrong can wipe the wrong disk.

What You'll Need

  • A Windows PC (Windows 10 or 11)
  • The drive you want to format (internal, external, or USB)
  • Administrator access to the computer
  • A backup of any data on that drive

Step-by-Step

  1. Open Command Prompt as Administrator. Press the Windows key, type cmd, right-click on “Command Prompt” and select “Run as administrator.” Click “Yes” if prompted by User Account Control.
  2. Launch Diskpart. In the Command Prompt window, type diskpart and press Enter. You’ll see a new prompt that says DISKPART>.
  3. List all disks. Type list disk and press Enter. This shows a table of all physical drives connected to your PC. Note the disk number (e.g., Disk 1) of the drive you intend to format. Be absolutely certain—the wrong number will erase the wrong drive.
  4. Select the target disk. Type select disk X (replace X with the actual disk number) and press Enter. Diskpart will confirm: “Disk X is now the selected disk.”
  5. Verify you have the right disk. Type detail disk and press Enter. This shows the disk’s volume list and its total size. Cross-check the size and any volume labels with your intended drive. If anything looks off, stop and re-check.
  6. Clean the disk (optional but recommended). Type clean and press Enter. This removes all partitions and file system structures from the disk, making it completely unallocated. This step is irreversible—all data is gone.
  7. Create a new partition. Type create partition primary and press Enter. This creates a single primary partition that uses all available space.
  8. Select the new partition. Type select partition 1 and press Enter.
  9. Format the partition. Type format fs=ntfs quick and press Enter. Replace ntfs with exfat or fat32 if you need a different file system. The quick parameter performs a fast format; omit it for a full format (which checks for bad sectors and takes longer).
  10. Assign a drive letter. Type assign and press Enter. Windows will automatically assign the next available drive letter. If you want a specific letter, type assign letter=E (replace E with your choice).
  11. Exit Diskpart. Type exit and press Enter. Then close the Command Prompt window.
  12. Verify the drive. Open File Explorer and confirm the drive appears with the correct letter and file system. You can also right-click it and select “Properties” to see the file system type.

Common Mistakes

  • Selecting the wrong disk number. This is the most dangerous mistake—it can wipe your system drive. Always use list disk and detail disk to confirm size and existing volumes before selecting.
  • Forgetting to run as administrator. Diskpart will fail with “Access denied” or “Insufficient privileges” if you don’t run Command Prompt as admin.
  • Skipping the clean command. If you format an existing partition without cleaning, you may end up with leftover hidden partitions or boot records that cause issues.
  • Using the wrong file system. NTFS is best for Windows-only drives. exFAT is better for cross-platform use with macOS and game consoles. FAT32 has a 4GB per-file limit and is only for very old devices.
  • Typing format before creating a partition. You must have a selected partition before formatting; otherwise Diskpart will return an error.

Tips

  • Always back up first. Even if you’re doing a “quick” format, data is not recoverable without special tools. Copy files to another drive or cloud storage.
  • Use detail disk to avoid mistakes. It shows the disk size and the volumes on it. If you see a volume with the label “System Reserved” or “C:”, you’ve selected the wrong disk.
  • Quick format vs. full format. A quick format only removes the file system index; data is still physically on the disk but overwritten as new data is written. A full format scans for bad sectors and takes much longer—useful for old or failing drives.
  • For a bootable USB drive, use NTFS or FAT32. Many modern UEFI systems require FAT32 for UEFI boot, but if you’re making a Windows installation drive, use the official Media Creation Tool instead of manual formatting.
  • If you plan to use the drive with a smart TV or camera, check the device’s manual. Some devices only read FAT32 or exFAT, not NTFS.

Troubleshooting

“Access denied” or “Insufficient privileges.” Close Command Prompt and reopen it as administrator. Right-click and select “Run as administrator.”

“The disk is in use.” This happens if the drive has open files or is the system drive. Close any programs using the drive, or if it’s the system drive, you cannot format it from within Windows—you’ll need to boot from a Windows installation USB and format from there.

“The specified disk is not convertible.” This usually appears when you try to use convert commands. If you’re just formatting, ignore it—it’s not relevant to the steps above.

“There is no volume selected.” You likely forgot to select the partition after creating it. Run select partition 1 before formatting.

Formatting is stuck at 0%. Wait a few minutes—full formats on large drives can take a long time. If it’s stuck for over 30 minutes with no progress, close Diskpart, restart the PC, and try again. If the drive is failing, consider replacing it.

Drive letter not showing up. After assigning, open Disk Management (right-click Start > Disk Management). If the drive is there but has no letter, right-click the partition and choose “Change Drive Letter and Paths.”

Frequently Asked Questions

Will formatting via Diskpart permanently erase all data?

Yes, formatting removes the file system and makes data unrecoverable by normal means. A quick format doesn’t overwrite the raw data, but it’s still not accessible without specialized recovery software. For sensitive data, use a full format or a secure erase tool.

Can I format my C: drive using Diskpart?

No, not while Windows is running. The system drive is locked. You can format it by booting from a Windows installation USB and using Command Prompt from the repair options, but that will erase your operating system.

What file system should I use for a USB drive?

For Windows-only use, NTFS. For compatibility with Mac, game consoles, and smart TVs, exFAT is best. FAT32 only if the device requires it, but remember the 4GB file size limit.

Does a quick format damage the drive?

No, a quick format is safe and doesn’t physically harm the drive. It simply removes the file system index. The drive remains usable.

Can I undo a Diskpart format?

No, there is no built-in undo. Once you run clean or format, the previous data is gone. The only way to recover data is with third-party recovery software, which may not work if new data has been written.

Why does Diskpart say “DiskPart has encountered an error: Access is denied”?

You’re not running Command Prompt as administrator. Close and reopen it with “Run as administrator.” If the drive is a system or boot drive, you’ll also get this error—use a bootable USB instead.