I'm trying to completely remove linux from my machine to make way for Windows, but to do that I need to change my disk type to GPT instead of MBR. I have a bootable usb with Ubuntu on it that I can use, but I don't know what steps to take in order to make the changes necessary. Any and all help will be appreciated!

  • This seems only marginally connected to U&L. How does this question relate to Unix/Linux? – Faheem Mitha Jul 10 '17 at 4:28
  • See also superuser.com/questions/1250895/… – mwfearnley Aug 20 '18 at 12:23
  • @FaheemMitha If the first sentence is changed to “I'm trying to change my disk type to GPT instead of MBR.” Then it should be clear this question is actually quite more general than initially implied. It is about changing from MBR to GPT on Linux. – equaeghe Apr 20 at 11:27

First you need to find out which is your disk of interest. Boot your Ubuntu USB and run lsblk. Look for the line that has SIZE matching what you expect for your disk. The first column will say something like sdb (ignore the partitions e.g. sdb2).

Next use the gdisk command to create a GPT on the disk you found in the previous step. Run the following command to create it (where sdb is the identifier you found in the previous step).

sudo gdisk /dev/sdb

In this interpreter press o to create a new GPT. then press y to confirm this. Finally press w to write the changes you just made.

Now the disk will be wiped with a new GPT. You can boot your windows medium and go ahead with your install.


Boot linux and use dd.

dd if=/dev/zero of=/dev/hda bs=512 count=1  

That will wipe the MBR, which is all you need. When you install Windows it will see a blank boot sector and create a GPT.

  • This also works if you don't have gdisk installed. cfdisk does not seem to offer the switch capability, but once you wipe the MBR, it does give the choice to create a GPT table. – equaeghe Apr 20 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.