Skip to content

Instantly share code, notes, and snippets.

@maulvi
Created December 11, 2017 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maulvi/9a16d54d586fd84a5bc070ccfe506cc0 to your computer and use it in GitHub Desktop.
Save maulvi/9a16d54d586fd84a5bc070ccfe506cc0 to your computer and use it in GitHub Desktop.
CONVERT GPT TO MBR
Through the Rod Smith’s guidance and a few dirty tricks, I was successfully able to convert my GPT partition – without data loss or deleting any partitions – and then boot Windows 7 in legacy/MBR mode. In order to do this you’ll need your Windows installation media at hand as well as a copy of the Fedora 16 Live media. If you don’t have a copy of Fedora 16 Live handy, you can download the Live media ISO (64-bit) from a local mirror here
Keep in mind that at this point I only had 3 partitions and a bunch of unpartitioned space on the disk, so conversion was a rather straightforward process (all GPT partitions mapped directly to primary partitions). Although it is theoretically possible to convert GPT partitions with >4 partitions by defining which ones are to be logical partitions after conversion, I have not tested this.
Boot your Fedora 16 Live media and wait for your session to start. If you’re having troubles booting, press Tab at the boot loader screen and try booting with the nomodeset parameter added.
Depending on your graphics card, you’ll either be presented with the new Gnome 3 Shell or with the traditional interface. Start a terminal session by putting your mouse in the top right corner of the screen and typing “terminal” in the search (Gnome Shell) or by selecting Applications > System Tools > Terminal (traditional interface)
Install gdisk:
su -
yum -y install gdisk
This may take a few moments.
Make a backup of your current GPT scheme:
gdisk -b sda-preconvert.gpt /dev/sda
Now we will attempt to convert your GPT disk layout to MS-DOS/MBR. Start gdisk:
gdisk /dev/sda
You should be prompted with:
Command (? for help):
Press r to start recovery/transformation.
Press g to convert GPT to MBR.
Press p to preview the converted MBR partition table.
Make any modification necessary to the partition layout. See Rod Smith’s Converting to or from GPT
External Links icon
page for more details on this.
When you’re happy with the MS-DOS/MBR layout, press w to write changes to the disk.
Shutdown Fedora 16 and boot from the Windows 7 installation media
Enter your language & keyboard layout and then select the option to repair your computer in the bottom left corner.
From the available options, select Startup Repair. Windows will ask for a reboot.
Follow the previous three steps again to boot the Windows 7 installation and run startup repair
Once again, boot the Windows 7 installation media but this time opt to open a command prompt instead of choosing startup repair. Type:
bootrec /scanos
bootrec /rebuildbcd
bootrec /fixmbr
bootrec /fixboot
Close the command prompt and run Startup Repair one last time.
That’s it! You should now have a bootable installation of Windows 7 on a MBR partition layout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment