MacOS – Bootcamp Failing with Error: “The startup disk cannot be partitioned or restored to a single partition.”

bootcampdisk-utilitymacospartition

I have a 21.5" Mid-2010 iMac i3 in which I am trying to install Windows 8 on. When I went into bootcamp, I received the ever so common error of:
Bootcamp Error
When I went to the newly designed disk utility, it told me I had one partition. Of course, I knew this couldn't be true, so i went into terminal and typed diskutil list and got:

OLD COMMAND OUTPUT, SEE EDIT 2 BELOW

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            498.6 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s6
   4:                 Apple_Boot Recovery HD             650.0 MB   disk0s5

Now, I did install an extra Yosemite partition, then deleted it using standard disk utility erase. I'm guessing thats why I have two recovery partitions. Now, I'm pretty sure this is the cause of the Bootcamp issue, but I want to know:

  1. Which partition to delete
  2. How to delete it in a (preferably safe) way that would make my hard disk "clean" of everything but my main Macintosh HD partition

Thanks

EDIT:
I want to delete the extra recovery partition from my second installation of Yosemite.

Running sudo gpt-r show /dev/disk0 gave me:

OLD COMMAND OUTPUT, SEE EDIT 2 BELOW

          start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34          6         
         40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     409640  973824416      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  974234056    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  975503592    1269536      4  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  976773128          7         
  976773135         32         Sec GPT table
  976773167          1         Sec GPT header

EDIT 2:
Reran the two commands:

    iMac-i3:~ me$ diskutil list /dev/disk0
    /dev/disk0 (internal, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *500.1 GB   disk0
       1:                        EFI EFI                     209.7 MB   disk0s1
       2:                  Apple_HFS Macintosh HD            498.6 GB   disk0s2
       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
       4:                 Apple_Boot Recovery HD             650.0 MB   disk0s4

    iMac-i3:~ me$ sudo gpt -r show /dev/disk0
    Password:
      start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34          6         
         40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     409640  973824416      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  974234056    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  975503592    1269536      4  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  976773128          7         
  976773135         32         Sec GPT table
  976773167          1         Sec GPT header

Best Answer

Which partition to delete?

  1. Restart your computer and hold down the alt/option key.
  2. Select the recovery partition you wish to keep. For example, with El Captain OS X 10.11 installed, the recovery partition should be labeled "Recovery-10.11".
  3. Once booted to this partition, select the Terminal application for the menu bar.
  4. In the opened Terminal application window, enter the mount command. The partition you selected will show up in the list. The other recovery partition will be absent.

The absent partition is the one to delete.

How to delete it in a (preferably safe) way that would make my hard disk "clean" of everything but my main Macintosh HD partition?

By "clean", I assume you mean you want to remove the extra Recovery HD partition.

If you want to remove disk0s3 then you should first copy the contents of disk0s4 to disk0s3. This can be down using the command given below.

sudo dd if=/dev/disk0s4 of=/dev/disk0s3 bs=16384

You will need to remove the 4th partition. Follow the steps below.

  1. Start your computer from Internet Recovery. Press and hold the Command-Option+R keys immediately after you turn on your Mac and hear the startup sound. Your model is capable of using Internet Recovery, but your firmware may need to be updated. See Computers that can be upgraded to use OS X Internet Recovery.

    Note: An alternative would be to startup using the Snow Leopard (OS X 10.6) or earlier DVD.

  2. From the menu bar, open the Terminal application.

  3. Enter the following commands in the Terminal application window.

    diskutil unmountDisk /dev/disk0
    gpt remove -i 4 /dev/disk0