**How to Clean, Partition, and Format a Drive Using DiskPart in Command Prompt (Step-by-Step Guide)**
Open Command Prompt as Administrator: Click Start, type "cmd", right-click "Command Prompt" and select Run as administrator.
Open DiskPart:
Type
- diskpart
and press Enter.
List Disks:
Type
- list disk
and press Enter to see all connected drives. Identify the correct disk number based on size (e.g., Disk 1, Disk 2).
Select Disk:
Type
- select disk # (replace # with your disk number, e.g., select disk 2)
and press Enter.
Warning: Choosing the wrong disk may result in data loss on your system drive.
Clean the Disk:
Type
- clean
and press Enter. This removes all partition tables and hidden sectors.
Note: Using clean all will securely overwrite all data with zeros, taking much longer.
Create Partition:
Type
- create partition primary
and press Enter to make the disk usable.
Format the Partition:
Type
- format fs=ntfs quick (for Windows)
or
- format fs=fat32 quick
and press Enter.
Assign Drive Letter:
Type
- assign
to allow Windows to recognize and show the drive in File Explorer.
Exit:
Type
- exit
to close DiskPart,
and
- exit
again to close Command Prompt.
Essential Tips and Commands
Verifying Selection: Always verify the disk number and size to ensure you do not wipe the wrong drive.
Write-Protected Drives: If the disk is write-protected, use attributes disk clear readonly after selecting the disk to unlock it.
File System Choice: Use ntfs for large drives (over 32GB) or fat32 for compatibility with older devices/consoles.
Failed Clean: If a clean command fails, it might be due to a used volume;
you may need to use
list volume
and
- select volume #
followed by
- delete volume
before cleaning the disk.


Comments
Post a Comment
dont like me?