Changing from MBR to GPT

8,857

Solution 1

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.

Solution 2

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.

Share:
8,857

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin almost 2 years

    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!

    • Alen Milakovic
      Alen Milakovic almost 7 years
      This seems only marginally connected to U&L. How does this question relate to Unix/Linux?
    • mwfearnley
      mwfearnley almost 6 years
    • equaeghe
      equaeghe about 5 years
      @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
    equaeghe about 5 years
    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.