windows:diskpart_cleanusb
Diskpart clean USB drive
Sometimes I use USB to install non-windows stuff and then I may write image directly to USB with Etcher tool etc. These images may contain multiple partitions and returning USB back to single volume fat drive can be tricky. Windows has inbuilt tool called diskpart which usually can be used to clean USB disk and recover it back to single partition mode.
Open Command Prompt/Powershell as admin, run command diskpart (do not insert USB yet), then in diskpart:
- DISKPART> automount disable (Disables automount of disks)
- Insert USB disk
- Find and select correct disk, failure in this step may end you deleting your harddrive. Disk size is way to identify correct disk
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
——– ————- ——- ——- — —
Disk 0 Online 931 GB 2048 KB *
Disk 1 Online 7452 GB 1024 KB *
Disk 2 Online 1907 GB 0 B *
Disk 3 Online 14 GB 2861 MB
DISKPART> select disk 3
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
——– ————- ——- ——- — —
Disk 0 Online 931 GB 2048 KB *
Disk 1 Online 7452 GB 1024 KB *
Disk 2 Online 1907 GB 0 B *
* Disk 3 Online 14 GB 2861 MB
- Then wipe the selected disk
DISKPART> clean - I think sometimes clean does not clean partition table fully, causing errors later on. Try to get around this changing partition table
DISKPART> convert gpt
DiskPart successfully converted the selected disk to GPT format. - Create partition
DISKPART> create part pri
DiskPart succeeded in creating the specified partition. - Format partition
DISKPART> format fs=fat32 quick
100 percent completed - Close diskpart, remove drive and plug it in again
windows/diskpart_cleanusb.txt · Last modified: 2021/08/11 19:01 by admintomi