SuperJMN
SuperJMN

Reputation: 14002

Convert from GPT to MBR and vice versa

I would like to use PowerShell to convert a disk from GPT to MBR and vice versa.

To convert to MBR, I've tried with:

Clear-Disk -Number 3 -Confirm:$false -RemoveData -RemoveOEM
Initialize-Disk -Number 3 -PartitionStyle MBR

But it doesn't work if the disk has already been initialized.

enter image description here

Upvotes: 1

Views: 2906

Answers (1)

Steven
Steven

Reputation: 7087

Clear-Disk will remove the partition style and un-initialize the disk completely. I tested the above scenario several times flipping between GPT and MBR. I couldn't reproduce the error. Only time I could recreate the problem was when the disk really was initialized.

I did do a quick test using Set-Disk -Number 3 -PartitionStyle GPT and back to MBR, this seemed to work so long as there were no partitions. I was able to remove all partitions with: Get-Partition -DiskNumber 3 | Remove-Partition -confirm:$false.

Given your the error is unexplained as of yet, I can't say this approach will work.

Upvotes: 1

Related Questions