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)
- Open up command prompt as Administrator
- Type diskpart and press Enter
- Type list disk and press Enter
- Note the disk number you want to convert
- Navigate to where you have extracted GPTGen
- Run command gptgen.exe -w \\.\physicaldriveX where X is Disk number from Diskpart and press Enter
- 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…
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!!!!!!!
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.. :)
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
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.
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.
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.
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!
Hey, you need disk number from diskpart, then exit it and execute gptgen :)
I added one more step – exit diskpart :)
Thank you for this! I was trying to figure out what I was doing wrong and this was the missing step!!
I also spent some time on it before I got this sorted, thanks for the comment!
Thanks, I tried on Dev Server 2008R2 and it worked. Cloning my production server and will try on that soon!
Glad it worked for you. Make backup and take extra caution when dealing with PROD servers:)
With this program, I was able to convert a 2 TB disk full of data in seconds. Thanks for your article, you rock.
Thanks for your comment. I’m happy that it worked for you!
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.
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:)
[…] 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/ […]
That’s perfect, very useful information,worked like a charm on Windows 2016, thank you very much!
Super! Good to hear that it is still valid even for 2016:)
Hi Milosz,
Works great!!! Saved me a lot of time. Thanks for the great instruction.
Martijn
Hey! good to hear that:) thanks for the comment!
Thanks still working on Server 2019!
Hey, thanks for letting us know!
On Step 8 you said “Now it’s good idea to reboot, then after reboot run check disk on converted disk just in case.”
I’m needing to do this on a production server running 2008 R2, it’s backed up, etc. but I’m curious if the reboot is mandatory after converting from MBR to GPT on a data disk (non-system disk where OS resides).
You said it’s a good idea, but if I can do this at a later time that would be better, so I can do this during normal business hours.
I appreciate it, great article…thanks!
it is not mandatory but I prefer to reboot the server while I’m still in server room to be able to diagnose the problem when something goes wrong. Also, if filesystem will stop responding due to some error you will have to reboot it anyway. Like I said – not mandatory – just advised :)