5

I'm trying to change the flash drive's partition style to GPT using PowerShell, but the cmdlet throws "The disk has already been initialized" (even though I've cleaned the drive):

PS C:\WINDOWS\system32> Clear-Disk 5 -RemoveData -RemoveOEM

PS C:\WINDOWS\system32> Get-Disk 5

Number Friendly Name                            OperationalStatus                          Total Size Partition Style          
------ -------------                            -----------------                          ---------- ---------------          
5      UFD 2.0 Silicon-Power16G USB Device      Online                                       15.14 GB MBR     

PS C:\WINDOWS\system32> Initialize-Disk 5 -PartitionStyle GPT
Initialize-Disk : The disk has already been initialized.
At line:1 char:1
+ Initialize-Disk 5 -PartitionStyle GPT
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (StorageWMI:ROOT/Microsoft/Windows/Storage/MSFT_Disk) [Initialize-Disk], CimException
    + FullyQualifiedErrorId : StorageWMI 41001,Initialize-Disk

How can I de-initialize the disk so that I can re-initialize it?

P.S. -PartitionStyle MBR shows the same error.

Ark-kun
  • 151
  • 1
  • 6
  • It looks like the Clear-Disk cmdlet is not working as it should or the drive is not properly clearing the data as the drive should revert back to a partition style of RAW after it is run. Do you have this issue with other storage as well? – Persistent13 Feb 27 '17 at 22:45
  • I see this with two different models of USB drives as well. If I try the diskpart equivalent (select disk and then clean), the drive becomes MBR instead. Wondering if USB drives can't be raw... – aggieNick02 Dec 14 '17 at 20:39
  • 1
    I was running into the same issue. I searched and found this [Microsoft Doc](https://docs.microsoft.com/en-us/windows-server/storage/disk-management/change-an-mbr-disk-into-a-gpt-disk) that states, "You cannot use the GPT partition style on removable media." – Paul Mayle Dec 29 '18 at 17:31

2 Answers2

0

Clear-Disk does not uninitialize removable media, only disks (HDD, SSD, VHD, etc.). To change the partition style of a removable medium, you can use Set-Disk with the -PartitionStyle parameter:

Set-Disk -Number 5 -PartitionStyle MBR

To view an example on how you can use Set-Disk inside a pipeline, you can have a look at my question on SO.

stackprotector
  • 596
  • 1
  • 8
  • 27
-1

When you want to start over, start with a RESET. Then you can initialize, format, and perform other operations. Remember to put the disk in maintenance mode if it is in a cluster.