45

This disk is OCZ VERTEX 128GB SSD. It is formatted as GPT from OSX. The disk layout is,

/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *128.0 GB   disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                 Apple_RAID                         63.8 GB    disk1s2
   3:                 Apple_Boot Boot OS X               134.2 MB   disk1s3
   4:       Microsoft Basic Data ssdwin                  63.9 GB    disk1s4

I'm trying to install windows7 in the "ssdwin" partition but when i EFI Boot windows 7 64bit USB installer, it says,

Windows cannot be installed to this disk. The selected disk has a mbr partition table, On EFI system window can only be installed to GPT disks.

But my disk is GPT disk. any idea how i can recover from this ?

Shiplu Mokaddim
  • 846
  • 3
  • 12
  • 25
Sarim
  • 583
  • 2
  • 6
  • 8

1 Answers1

75

Did you happen to use Apple's Disk Utility to create a FAT filesystem in that to-be-Windows partition? If so, you converted the disk from a legal GPT disk into a hybrid MBR disk, which OS X sees as GPT and Windows sees as MBR. The solution in this case is to clear the hybrid MBR data. A number of utilities can do this. I'll describe how to do it with my own GPT fdisk (gdisk) utility:

  1. Download GPT fdisk from its Sourceforge page and install it. (Versions are available for Linux, OS X, and Windows. I'll assume you'll do this from OS X.) Alternatively, you could run it from a Linux emergency disc like Parted Magic.
  2. Launch gdisk on your disk by typing sudo gdisk /dev/disk1 in a Terminal window. (Change the device identifier if it's not as you presented earlier or if you use another OS for the job.)
  3. Type p to view the partition table to verify you're working on the correct disk. If not, type q to quit without saving your changes and try again with another device.
  4. Type x to enter the experts' menu.
  5. Type n to create a fresh protective MBR. Note that gdisk won't confirm a change; it'll just show you a new experts' prompt.
  6. Type w to save your changes. You'll be asked to confirm this action. Do so.

With any luck this will fix the problem. If it doesn't, though, you can use gdisk's v option (on any menu) to have gdisk look for partition table problems. It can fix some minor problems automatically, but other times you'll need to make explicit changes. See the GPT fdisk documentation on GPT repairs for details.


El Capitan Addendum:

Apple's OS X 10.11 ("El Capitan") includes a new feature, known as "rootless" or "System Integrity Protection," which makes it difficult or impossible to run certain types of utilities, including GPT fdisk. To be sure, this new feature is intended to improve security by making it harder for malware to take control of the computer or for users to accidentally damage their own systems; but it also causes problems if you really need to use GPT fdisk or other third-party tools. If Apple's own tools permit removing a hybrid MBR, I don't know how it's done with them, so AFAIK this task really does require bypassing this new security feature.

There are several ways to work around this problem, such as:

  • Use a non-OS X OS, such as an Ubuntu installer booted into its "try before installing" mode.
  • Hold down Command+R as you boot your Mac to launch the Recovery environment, in which this feature is disabled. In theory, you should be able to run gdisk in this environment, although you might need to adjust the PATH environment variable. (I've not tried this approach, so there may be hurdles I've not considered.)
  • Boot to the Recovery environment, open a Terminal window, type csrutil disable, and reboot into your regular environment. This action disables the rootless system. You can re-enable it by performing these steps but pass enable rather than disable to csrutil.

For more on the subject of the rootless environment, see this page.

Rod Smith
  • 21,455
  • 3
  • 43
  • 55
  • thank smith. This exactly the problem. i was experimenting with gdisk yesterday and after converting to protective mbr problem was solved. thanks for your details explanation and steps. and thanks again for creating nice utility gdisk :) – Sarim Nov 21 '12 at 03:56
  • 1
    Rod, thank you so much for putting this up. I was having major issues with the same thing on a newly formatted 2013 Macbook Pro Retina. Couldn't get Win8 to install out of the box via the legit bootcamp Assistant method (I did not fiddle around with the disk utility). I still had the issue and following your tutorial to the T worked like a charm. Thanks again! You saved me a gzillion hours trying to get this to work. – saurabhj Sep 08 '13 at 03:34
  • Thanks for this, after Ubuntu 14.04 grub messed up my Mac Pro with Mac OSX Yosemite Beta 2+Windows 8 Boot Camp, your gdisk steps made OSX and Windows bootable again. – Erwin Coumans Aug 26 '14 at 03:25
  • If I understood correctly, these steps will delete existing partitions and destroy data (or maybe just Win partition?). Is it possible to perform this operation, but save the data on both Win and MacOS partitions? – Dejan Mar 11 '15 at 16:43
  • 4
    These steps destroy the [hybrid MBR data,](http://www.rodsbooks.com/gdisk/hybrid.html) but the hybrid MBR merely duplicates (in MBR form) one to three GPT partition entries. The GPT entries remain intact and accessible, so you should not lose access to any of your files. Of course, all this assumes that the partition tables are valid (or as "valid" as any hybrid MBR can be). If your partition tables are damaged and your hybrid MBR specifies partitions that are don't have GPT counterparts, then you'll lose those partitions. This would be a highly illegal and dangerous setup at the outset. – Rod Smith Mar 12 '15 at 00:23
  • 1
    Thanks so much @RodSmith! I tried it just now on an OSX 10.10.1 Yosemite on Macbook Pro 2012 for Windows 8.1 and it worked flawlessly. Your instructions are very helpful and the utility is just great. I'll be happy to buy you coffee sometime, let me know :) – MyPreciousss Mar 28 '15 at 02:30
  • 1
    Not only did GPT fdisk confirm a hybrid MBR, but using these instructions also fixed my "You need to format the disk..." prompt in Windows 7 for an external disk that could be read just fine in OS X and Ubuntu. Thanks! – Andreas Apr 18 '15 at 02:11
  • GPT fdisk doesn't work on El Capitan at the moment – AperioOculus Oct 07 '15 at 01:55
  • AperioOculus, I hope to release a new GPT fdisk this weekend and update the OS X build; however, I have yet to even try it myself, so I can't promise a fix. In the meantime, you can use GPT fdisk (`gdisk`, etc.) using another OS, or even a Linux emergency disk. Recent versions of Ubuntu have a "try before installing" mode and ship with `gdisk` installed, IIRC. – Rod Smith Oct 07 '15 at 13:43
  • @AperioOculus Did you use the version available on the SourceForge page? I just recently used it in El Capitan without issue. – Evan Plaice Oct 09 '15 at 00:26
  • 2
    This was a lifesaver. In my case, BootCamp was responsible for creating the Hybrid MBR condition that was causing so many problems. After the fix I managed to do a native EFI triple-boot install on my system. – Evan Plaice Oct 09 '15 at 00:31
  • @EvanPlaice I don't recall if it was from the SourceForge page or not. What I finally ended up doing was performing a clean install of El Capitan and then a clean install of Windows 8 Enterprise which I am currently upgrading to Windows 10 Enterprise. Although, I would have preferred to use GPT fdisk and performed a clean install of Windows 10. – AperioOculus Oct 09 '15 at 01:04
  • @RodSmith I tried using gparted to rewrite the bootcamp partition in the ntfs format but WIndows still gave the same error and refused to format and install on the partition. Do you know why this is? – AperioOculus Oct 09 '15 at 01:07
  • @AperioOculus The GPT Fdisk website describes the full detail. To summarize, with a GPT the MBR sector should look to older systems like it contains only one partition of an unknown type. Some tools (read Bootcamp) take advantage of this by adding traditional MBR partitions following this. The problem is, the data immediately following is used to validate the GPT with a copy that exists at the end of the disk. When Windows tries to install it can't verify it's a GPT and assumes it's a MBR based disk instead. – Evan Plaice Oct 09 '15 at 02:16
  • (cont) Unfortunately, the offending data is contained in the first sector of the disk. So, even deleting the offending partition completely won't fix it. The only way to resolve the issue is to do a clean wipe or to run the GPT Fdisk utility. I went through the same thing. My advice is, stay away from Bootcamp until it fully supports EFI installs. If you want a dual-boot system before then, you'll need to load a custom bootloader like reFind. – Evan Plaice Oct 09 '15 at 02:21
  • 1
    I've learned more about the `gdisk` problems with El Capitan -- see my addendum to my original answer. – Rod Smith Oct 09 '15 at 17:39
  • 1
    About SIP in El Capitan, the solution of running gdisk in recovery mode: I've run gdisk in recovery mode before, and it works. You need to call it with full path, ex: `/Volumes/Your-Mac-Drive/usr/local/sbin/gdisk`. (or adjust PATH, but bit of overkill for one command) – Sarim Dec 03 '15 at 17:03
  • 1
    Big thank you ! finally got to install windows 10 on my early 2011 mac book pro running el captain – Gomino Jan 17 '16 at 20:19
  • 1
    But just to let you know guys, on the preUEFI model like my mac book pro early 2011, the EFI doesn't expose the audio controller, so the audio is not working on windows. – Gomino Jan 18 '16 at 01:24
  • The last I heard, all Intel-based Macs use EFI 1.x. (UEFI is EFI 2.x.) There are model-to-model differences in hardware and in firmware, which can affect drivers and hardware access in particular OSes. – Rod Smith Jan 18 '16 at 03:45
  • @gomino do you have any solution to the audio issue? – Sushant Mar 26 '16 at 16:15
  • @RodSmith it's answers like this that make SOF Great. You are a gentleman and a scholar! – Jacksonkr Apr 02 '16 at 17:09
  • @Sushant sorry, I haven't found a solution to this problem, but I live with this issue. However If I really need the audio in windows, I can connect a bluetooth sound system, it works! – Gomino Apr 06 '16 at 17:41
  • Again, this is a lifesaving post! Just wanted to mention, that for me Boot Camp Assistant didn't worked at all, so I ended up partitioning my disk in `Gparted` and then performed this `gdisk` magic. Now Windows installs! – Neurotransmitter Jun 15 '16 at 22:10
  • @RodSmith, thank you very much! You saved all my headaches during these days! Finally I have installed Windows 10 along with OS X and Debian GNU/Linux in my MacBook Air. My question is: the next time is recommended to create 4 Mac OS Extended (Journaled) partitions? Thank you for having solved my problem! – Manuel Ignacio López Quintero Dec 30 '16 at 20:18
  • 1
    thanks, it works for me when win10 can not boot for hybrid mbr – netawater Apr 07 '18 at 01:19