208 words
1 minute
DiskPart Problem: Cannot Select Partition
When working with USB drive, the DiskPart command cannot select the partition of the USB disk:
C:\Users\Administrator>diskpartMicrosoft DiskPart version 6.1.7601 Copyright (C) 1999-2008 Microsoft Corporation. On computer: DIXINYAN-M17XDISKPART> list diskDisk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 931 GB 3072 KB Disk 1 Online 3726 GB 0 B \* Disk 2 Online 1901 MB 0 BDISKPART> select disk 2Disk 2 is now the selected disk.Disk 2 is a USD drive, select it:
DISKPART> list partPartition ### Type Size Offset ------------- ---------------- ------- ------- \* Partition 1 Primary 1901 MB 0 BDISKPART> select part 1There is no partition selected.Somehow the partition cannot be selected and manipulated. After searching around, it seems the only solution to to recreate the partition with DiskPart:
DISKPART> cleanDiskPart succeeded in cleaning the disk.DISKPART> create part primaryDiskPart succeeded in creating the specified partition.DISKPART> list partPartition ### Type Size Offset ------------- ---------------- ------- ------- \* Partition 1 Primary 1901 MB 64 KBNow Partition 1 can be selected:
DISKPART> select part 1Partition 1 is now the selected partition.DISKPART> activeDiskPart marked the current partition as active.DISKPART> format fs=fat32 quick100 percent completedDiskPart successfully formatted the volume. DiskPart Problem: Cannot Select Partition
https://codingonwheels.com/posts/windows-diskpart-problem-cannot-select-partition/ C# 6.0 String Interpolation, FormattableString, and Code Analysis CA1305: Specify IFormatProvider
Understanding C# Features (6) Closure