Subscribe to our RSS news feed
AAPL 275.62 (0.56)

Change the booting style of Windows Vista or 7 x86_64 versions from BIOS-MBR mode to UEFI-GPT mode without formatting or reinstalling
*
  • Group: Members
  • Posts: 22
  • Joined: 14-May 08
  • From: Chennai, Tamilnadu, India
  • Member No.: 230,396
Change the booting style of Windows Vista or 7 x86_64 versions from BIOS-MBR mode to UEFI-GPT mode without formatting or reinstalling


Note 1: Windows needs a UEFI 2.x x86_64 (64-bit) firmware, it will not work in EFI 1.1 firmware and it will not work in 32-bit EFI firmware (not even 32-bit UEFI 2.x firmware).




Note 2: Windows XP (32-bit and 64-bit) and Windows Vista/7 (32-bit versions) do not support UEFI boot mode. 32-bit Windows Vista/7 will not boot in UEFI-GPT boot mode even if you have 32-bit UEFI firmware. They support only BIOS-MBR boot mode. Therefore this procedure is not for those who have 32-bit Windows (XP, Vista, 7) and 64-bit Windows XP.

32-bit Windows Vista/7 and 64-bit Windows XP can use GPT disks as Data disks only. They cannot boot from a GPT disk. Only 64-bit Vista/7 can boot from GPT disk, provided they boot using UEFI firmware (not BIOS firmware). 32-bit Windows XP does not have support to use GPT disks even as Data disks (32-bit Win XP has absolutely no GPT support).





Note 3: UEFI Boot support was added in Vista x64 SP1. Therefore you will need a Vista x64 Setup DVD which includes SP1 by default (that is, Microsoft provided Vista disc that has SP1 built-in). If you have a pre-SP1 disc of Vista x64 and later you slipstream SP1 into it using softwares like vlite etc., you CANNOT USE THAT DISC in this procedure. This is only with respect to Vista x64 discs. This is not a problem with Windows 7 x64 discs.



Note 4: Windows compulsorily requires an EFI SYSTEM PARTITION to be present on the disk - the Windows boot files including the BCD are present in EFI SYSTEM PARTITION in case of booting Windows x64 in UEFI-GPT mode.



Note 5: Follow this method at your own risk. I have tried this method once, but just once, in a Dell India Studio 1555 laptop. I do not own a Mac to try this procedure in it. I use tianocore.sourceforge.net EDK DUET (UEFI 2.0 x86_64) firmware which runs from a 1 GB USB pen drive (much like running an Ubuntu Live USB or Mac Live USB etc.)



Note 6: GNU Parted and other libparted based Partitioning programs set any FAT(12,16,32) and NTFS partitions in a GPT disk as “Microsoft Reserved Partition” type (msftres flag in GParted), while according to Microsoft they have to be “Basic Data Partition” type. Microsoft Windows and Mac OS X will not attempt to mount any “Microsoft Reserved” partition whether they contain a recognizable file system or not. To change these partitions to “Basic Data” type follow the instructions in this link -

http://www.insanelymac.com/forum/lofiversi...hp/t113754.html

This bug has been corrected in GNU Parted version 2.1 .






Requirements:-

1) Any Bootable Linux OS - Even a bare minimum Linux Live OS is enough - Needed to run GPT fdisk and for some file copying operations - Parted Magic http://partedmagic.com/ or SystemRescueCD http://www.sysresccd.org recommended.

2) GPT fdisk for Linux (by Rod Smith) - Needed for converting the Hard disk from MBR to GPT.

http://rodsbooks.com/gdisk/ - Has very good and important info about GPT disklabels.
http://sourceforge.net/projects/gptfdisk/ - GPT fdisk Sourceforge,net Project page.

Both Parted Magic or SystemRescueCD include GPT fdisk. This software is also being added to Ubuntu Live CDs. Otherwise download the latest version of GPT fdisk from http://sourceforge.net/projects/gptfdisk/files/

Related Info - Converting MBR and BSD disk labels to GPT
http://rodsbooks.com/gdisk/mbr2gpt.html


GPT fdisk supports Windows from version 0.6.2 . Therefore one can use the Windows version to do the MBR to GPT conversion process. But as the Windows version is new, there may be bugs in it (for example non-512 byte sectors are not supported in the gdisk Windows version as of 0.6.2). I still recommend users to use the Linux version of gdisk as it is quite stable and also as the subsequent partitioning work that needs to be done, needs softwares like GParted, which are either rare to find as freeware or do not support GPT and other things like that in Windows. It is always safer to perform these steps offline (from Windows). I have not personally tried the new Windows version of gdisk. You have been warned.

Alternatively there is also a Windows based MBR to GPT converter called GPTGEN. I have not used this software. I don't know if there are any bugs in it and how effectively it converts MBR Partition Table to GPT. I was unable to compile GPTGEN both in Linux (Fedora 12 x64 - GCC 4.4) and in Windows 7 x64 (Visual C++ 2008 Professional), although you can use the Windows "exe" file provided in GPTGEN Sourceforge.net page http://sourceforge.net/projects/gptgen/files/.

If you are new to GPT partitioning, I suggest that you use GPT fdisk over GPTGEN to convert your disk from MBR to GPT.


3) 200 MB of unpartitioned space or a separate 200 MB FAT32 partition or >200 MB free space in any partition in the HDD.

4) UEFI 2.x x86_64 (64-bit) firmware either in the motherboard itself or through a USB pen drive (chain loading from BIOS - like tianocore.org EDK or EDK2 DUET) - NOT x86 (32-bit) and NOT EFI 1.1 - both are not supported.

5) Windows Vista SP1 (or more updated) x64 disc or Windows 7 x64 disc - with the recovery options enabled (very important - needed to recreate BCD) - You can even borrow your friends' DVD.



Procedure :-

1) Take a backup of the following folder entirely (including the hidden files) "C:\Windows\Boot" from your Windows x64 installation or from the "install.wim" file in the "sources" folder of the Windows x64 Setup disc (Use 7-zip to extract the wim file).




2) Check whether your UEFI firmware supports AHCI SATA mode and check for what SATA mode the currently installed Windows (in BIOS boot mode) boots. This can be checked in BIOS, i.e. for what SATA mode in BIOS the currently installed Windows boots into, successfully, without displaying a Blue Screen (BSOD).

(Caution: Do not change anything in the BIOS till the steps 1, 2 and 3 are complete, otherwise your Windows installation will become unbootable).

(i) If the UEFI supports AHCI and the SATA mode in BIOS is set as AHCI - proceed to step 5.
(ii) If the UEFI supports only IDE mode (not AHCI) and the SATA mode in BIOS is set as AHCI - proceed to step 3.
(iii) If the UEFI supports AHCI but the SATA mode in BIOS is to IDE mode - proceed to step 3.
(iv) If the UEFI supports only IDE mode and the SATA mode in BIOS is set to IDE - proceed to step 5.




3) Now we need to instruct Windows to load the correct SATA drivers which the UEFI firmware supports. That is, if the UEFI supports AHCI then Windows should load only the Microsoft AHCI driver (msahci.sys) or if the UEFI supports only IDE then Windows should load only the Microsoft IDE driver (pciide.sys).

Also both the drivers should not be loaded simultaneously by Windows as one driver will conflict with the other. Therefore we need to enable the appropriate driver and disable the other one. This is done by modifying few options in the Windows Registry (using regedit) which is as described below -



Assuming condition 2-ii is true (that is UEFI-IDE and BIOS-AHCI)

(i) Boot into Windows and login into any of the administrator accounts.
(ii) Open Start menu and type "regedit" (without quotes).

(iii) Go into HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\msahci
(iv) In the name column, right click on "Start", click modify and enter any number between 3 and 6 (actually any number other than 0,1,2 - but still to be on safe side).

(v) Similarly go into HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\pciide
(vi) In the name column, right click on "Start", click modify and enter number 0 (zero) (only zero, not any other number).




If condition 2-iii is true steps 3-i and 3-ii are same and the rest of the steps are -

(iii) Go into HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\pciide
(iv) In the name column, right click on "Start", click modify and enter any number between 3 and 6 (actually any number other than 0,1,2 - but still to be on safe side).

(v) Similarly go into HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\msahci
(vi) In the name column, right click on "Start", click modify and enter number 0 (zero) (only zero, not any other number).




4) Now go into the BIOS and change the SATA mode to whatever mode your UEFI firmware supports. That is for 2-i and 2-iv no change, for 2-ii change it to IDE mode and for 2-iii change it to AHCI mode.




5) Find out the device filename of the hard disk which contains the windows installation. If this is the internal hard disk then it is usually /dev/sda , otherwise check GParted for your disk.




6) Open a terminal and type the following commands (all commands are case sensitive):-

(i) sudo -s
(ii) gdisk /dev/sda (or /dev/sdb etc.)
(iii) gdisk will complain about converting your MBR disk to GPT. At gdisk prompt type "w" (without quotes) and give yes for confirmation.




7) Now your HDD is converted to GPT partitioning style as required by Windows UEFI Boot mode.




8) Now launch GParted and create a 200 MB FAT32 partition anywhere in the disk. Resize another partition if no free space is left.




9) Select the 200 MB FAT32 partition, right click and select "Manage flags". Select the Boot flag (Boot flag in GParted or GNU Parted sets the partition type to EFI SYSTEM).




10) Mount the 200 MB FAT32 EFI System Partition in the Live Linux and create the following folder structure in the partition

<EFI_SYSTEM_PARTITION>/EFI/Microsoft/Boot/

Note: If you have Windows 7 x64, you can also try the bcdboot command from the “Recovery Console” in “Repair your Computer” option in Windows 7 x64 Setup disc. This command supposedly does operations described in steps 11, 12 and 16 of this procedure. But for this you should launch the Windows Setup disc using the UEFI boot “El-Torito” boot option.

The bcdboot command, according to Microsoft, will create the necessary folder structure in the EFI System Partition, copy the necessary files into it and create the required BCD file. That is, this command sets up the whole EFI System Partition for you. I have not tried this command before, so I am describing the manual way to do it.

The bcdboot command is available only in Windows 7 x64 Setup disc, not in Windows Vista x64 disc. If you are trying this procedure for Vista x64, follow the manual steps.



11) Now copy the contents of the EFI subfolder of the "Boot" folder of which you took a backup, into <EFI_SYSTEM_PARTITION>/EFI/Microsoft/Boot/ .




12) Insert the Windows x64 Setup disc and restart the system.




13) Go into the BIOS and enable UEFI boot mode.




14) Under UEFI boot mode, boot into the DVD and after selecting the language etc., click on Repair your computer.




15) The Windows disc will search for available installed Windows OSes and will then give an error that the system startup options were corrupted and are now repaired. Restart the system and remove the DVD.

This step creates a UEFI-GPT mode compatible BCD file - <EFI_SYSTEM_PARTITION>/EFI/Microsoft/Boot/BCD .




16) In UEFI shell launch <EFI_SYSTEM_PARTITION>/EFI/Microsoft/Boot/bootmgfw.efi file or use “Boot from File” option to launch this file, and add a boot option UEFI NVRAM boot option to this file.

The bootmgfw.efi file is the Windows Boot Manager x86_64 EFI binary which reads the <EFI_SYSTEM_PARTITION>/EFI/Microsoft/Boot/BCD file (the BCD file is the menu file similar to grub.cfg, menu.lst etc.). The BCD file is a registry hive file and therefore one cannot use any text editor to modify it and even using regedit to modify BCD is not recommended. You should use bcdedit command or softwares like EasyBCD to modify the BCD file.

For more info on BCD, do a web search on Boot Configuration Data.




17) Now Windows will boot using UEFI-GPT boot mode. Initially booting will be slow as Windows will try to obtain EFI NVRAM entries and all kinds of strange info about the new UEFI boot mode but later booting will be faster.


I have tried to address all possible problems that might crop up while using this guide. Even then, if you encounter any error while following this procedure, please reply along with the complete technical details as to which step in the procedure, which software used etc. You can also pm me incase you have a problem.
PM Profile Card
Go to the top of the page
+ Quote Post

Posts in this topic
- Keshav   Change the booting style of Windows Vista or 7 x86_64 versions from BIOS-MBR mode to UEFI-GPT mode without formatting or reinstalling   Sep 14 2009, 09:59 AM
- - Keshav   Here is the link for compiled tianocore.sourceforg...   Oct 16 2009, 06:08 AM
- - 陈小龙   I just formatted a 128 MB USB Flash Drive with the...   Nov 8 2009, 04:07 PM
- - 陈小龙   The reason I used GPT was because I wanted more th...   Nov 9 2009, 09:55 PM
- - 陈小龙   Thank you. I'll try it and post my results.   Nov 11 2009, 11:23 PM
- - 陈小龙   That didn't work as I wanted. The installer gi...   Nov 12 2009, 12:03 AM
|- - Keshav   The DUET firmware does not support AHCI SATA mode....   Nov 13 2009, 01:26 PM
|- - heliox   QUOTE (Keshav @ Nov 13 2009, 03:26 PM) Th...   May 4 2010, 11:29 AM
- - Rod Smith   If Windows complained about installing to GPT even...   Nov 12 2009, 03:42 PM
- - 陈小龙   Whoops, forgot to push W. The installation is runn...   Nov 12 2009, 08:41 PM
- - 陈小龙   Thanks for the info, Keshav! I'll try usin...   Nov 13 2009, 09:10 PM
|- - Keshav   QUOTE (陈小龙 @ Nov 14 2009, 02:40 AM)...   Nov 14 2009, 10:48 AM
- - 陈小龙   It worked perfectly. I'm actually typing this ...   Nov 14 2009, 01:27 PM
- - 陈小龙   Just some extra info: EFI DUET can be installed t...   Nov 21 2009, 01:57 PM
|- - Keshav   QUOTE (陈小龙 @ Nov 21 2009, 07:27 PM)...   Nov 22 2009, 05:35 AM
- - 陈小龙   I have no idea what the hd32 folder is for. All I ...   Nov 22 2009, 07:13 PM
- - 陈小龙   Also, the partition cannot be formatted with fat32...   Dec 8 2009, 11:29 PM
|- - poophead   QUOTE (陈小龙 @ Dec 8 2009, 03:29 PM) ...   Dec 9 2009, 02:30 PM
|- - Rod Smith   QUOTE (poophead @ Dec 9 2009, 09:30 AM) I...   Dec 9 2009, 07:46 PM
- - 陈小龙   Poophead (I don't mean to call you that ), in...   Dec 9 2009, 08:31 PM
|- - Rod Smith   QUOTE (陈小龙 @ Dec 9 2009, 03:31 PM) ...   Dec 10 2009, 06:15 PM
- - rajkosto   i can see the uefi menu (DUET: PRODUCT NAME HERE),...   Dec 13 2009, 10:59 PM
|- - Rod Smith   QUOTE (rajkosto @ Dec 13 2009, 05:59 PM) ...   Dec 15 2009, 10:56 PM
- - Keshav   Hi heliox, I corrected the mistake you pointed out...   May 4 2010, 03:05 PM
- - heliox   Thanks for your fast reply I didn't try to boo...   May 5 2010, 12:53 PM
|- - Keshav   QUOTE (heliox @ May 5 2010, 06:23 PM) Tha...   May 8 2010, 12:20 PM
- - heliox   More on my troubleshooting: Of course I've alr...   May 10 2010, 12:09 PM

Reply to this topic Start new topic

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 6th September 2010 - 03:56 AM