How to convert partition from MBR to GPT scheme on Windows

There are times, when you as an IT admin have something called a senior-moment and on the brand new server when creating a data store for file server (or virtual machine) you format data partition as MBR (Master Boot Record).
It doesn’t really make any difference unless you want to have:

  • more than 4 primary partition
  • expand partition over 2048GB or 2TB which in my is more important

Ok I know you can add more vmdks of smaller size. You might even combine them in one single dynamic disk but what if you already have data on that storage, lets say 1,9TB and doesn’t have free storage to move data, reformat and move it back?

You need to convert MBR partition to GPT (GUID Partition Table) which introduces some new features, like:

  • Address range expanded from 232 to 264 sectors which enables partition sizes larger than 2TB (assuming 512 sectors)
  • More than 4 partitions per disk. MBR was limited to 4, GPT defaults to 128, but can be increased.
  • Fully supported by UEFI BIOS system. Actually you need to have UEFI BIOS to be able to boot from GPT disk.
  • More at wiki

There are many apps you can use to convert MBR to GPT, but most of them are paid/licensed version since they are meant to be run on server versions of Windows.

There is, however a small command lline utility designed especially for that purpose, it is called GPTGen.

To convert using this utility you have to know the physical number of your harddrive (or vmdk if its virtual)

  1. Open up command prompt as Administrator
  2. Type diskpart and press Enter
  3. Type list disk and press Enter
  4. DiskPart List disk
  5. Note the disk number you want to convert
  6. Navigate to where you have extracted GPTGen
  7. Run command gptgen.exe -w \\.\physicaldriveX  where X is Disk number from Diskpart and press Enter
  8. Now it’s good idea to reboot, then after reboot run check disk on converted disk just in case.

That’s all.

Now you can extend partition to 264 sectors. Assuming you have a legacy disk/scheme with 512bytes sectors, that gives maximum size is 9.4 ZB (9.4 × 1021 bytes) or 8 ZiB (9,444,732,965,739,290,427,392 bytes, coming from 18,446,744,073,709,551,616 (264) sectors × 512 (29) bytes per sector) but in real world Windows cuts this to 256TB per partition which in my opinion is more than enough.

With GPT disk scheme you must have UEFI compatible BIOS or install special MBR-to-GPT boot loader in order to be able boot Windows from GPT disk, but this is another story…

By |2016-12-22T21:35:10+00:00September 18th, 2015|Windows Server|19 Comments

About the Author:

I am passionate about Systems Administration. I like to face new challenges and test new environments.Windows and Linux Debian boxes (both physical and virtual) are my favourites. I like solving problems related to Windows Server roles and services as well as Linux but some distributions in particular. I'm not considering myself as Linux master but surely, I always do my best to fit the needs. On the other hand I consider myself as a Windows Server Professional and in terms of WS and Windows Desktops I always follow best practices, good advices and opinions from other admins.

19 Comments

  1. mike September 7, 2016 at 01:18 - Reply

    When I navigate to list disk to note the disk # I want to convert, I’M IN DOS. When Inavigate to where I extracted gptgen, I’M IN WINDOWS?!? How can I go back to windows and run a DOS prompt at the same time?!? There are instructions missing right here. Little, but very important!!!!!!!

    • Miłosz Engel September 28, 2016 at 13:51 - Reply

      Nothing is missing here:) You can extract gptgen to whatever directory you want, then open elevated command prompt(msdos) and navigate to that directory using cd and cd.. 🙂

  2. Hari December 21, 2016 at 12:53 - Reply

    Hello I done a mistake…. please help me… I done my windows formatting..after that when I try to install windows again it is showing it’s not got..if I convert in to got my all data will lose.. please help…how to convert it into gpt without data lose

    • Miłosz Engel December 22, 2016 at 21:31 - Reply

      Sorry for late response, but if you deleted partition table you should try to start computer from a cd, use third party software like partition recovery/get data back and copy out data from that drive. Then reformat and restore data. That’s how I would do it. I tried restoring partition tables many times and most of the time I end up with repartition and reformat eventually. Do not overwrite partition table with backup it’s backup (hdd should hold at least one backup of if) because it’s more likely outdated and will confuse recovery software and may lead to data loss. Sorry for not some easy solution but after deleting partition there is no easy way to restore it.

  3. Rob February 17, 2017 at 10:55 - Reply

    Hi, I did this on two 2012 Servers, both worked well and I was able to increase each drive to 3TB but somewhere along the line one server swapped drive letters (after increasing I believe). May not be related to gptgen but worth a mention.
    Thanks very much for the post though, very useful.

    • Miłosz Engel February 19, 2017 at 22:58 - Reply

      Hi Rob, thank you for your input! Glad it worked for you. What most likely happend is when you convert partition table to GPT Windows drives are unmounted and then mounted again in new partition scheme. During this partition letters will most likely assign according to partition order on disk. That’s what probably you experienced. Since I assume you know how to change it back you managed to fix it. Again, thanks for pointing this out. I didn’t encounter this but this in fact is possible.

  4. Lakshmi June 22, 2017 at 17:34 - Reply

    Hi,
    How to navigate to gptgen from Diskpart? if i run diskpart, it enters diskpart’s console and cd no longer works there..
    Any help would be appreciated!

    • Miłosz Engel June 29, 2017 at 22:17 - Reply

      Hey, you need disk number from diskpart, then exit it and execute gptgen 🙂
      I added one more step – exit diskpart 🙂

  5. Tom July 25, 2017 at 01:36 - Reply

    Thanks, I tried on Dev Server 2008R2 and it worked. Cloning my production server and will try on that soon!

    • Miłosz Engel July 25, 2017 at 19:06 - Reply

      Glad it worked for you. Make backup and take extra caution when dealing with PROD servers:)

  6. Alejandro August 12, 2017 at 08:01 - Reply

    With this program, I was able to convert a 2 TB disk full of data in seconds. Thanks for your article, you rock.

    • Miłosz Engel August 20, 2017 at 21:24 - Reply

      Thanks for your comment. I’m happy that it worked for you!

  7. Kirk October 30, 2017 at 16:58 - Reply

    Hello,

    Does this only work on disks with no partitions and no data? Or could this work on a system volume?

    Scenario: My 2TB hard drive started going on me and I imaged it over to a 4TB, rather than re-installing everything. I’m now looking for a way to convert the MBR disk over to GPT to use the full 4TB.

    • Miłosz Engel November 19, 2017 at 20:04 - Reply

      hi, no this works with partition with data on it! The whole point of converting is to avoid losing data. No need to convert if you can re-format:)

  8. Sysadmin Today #35: Story Time February 19, 2018 at 00:41 - Reply

    […] How to convert partition from MBR to GPT scheme on Windows https://miloszengel.com/how-to-convert-partition-from-mbr-to-gpt-scheme-on-windows/ […]

  9. Manas Koni May 30, 2018 at 03:36 - Reply

    That’s perfect, very useful information,worked like a charm on Windows 2016, thank you very much!

  10. Martijn October 26, 2018 at 15:41 - Reply

    Hi Milosz,

    Works great!!! Saved me a lot of time. Thanks for the great instruction.

    Martijn

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.