If your Mac's a Late 2011 or later model you should be able to use Internet Recovery - Apple support page here. You could always install OS X on an external USB/Firewire/Thunderbolt drive which would then give you option of retrieving whatever you need from your internal drive before thoroughly wiping it clean. Personally I like Fedora Linux for this purpose, boot up from USB and go into the Disks utility where you will quickly be able to delete all existing partitions including the hidden EFI section, guaranteeing a clean slate before setting it all up again.
If it's an earlier model then you'll need to find someone with the installer for 10.7/8/9/10 and make a USB installer from it, or find a late retail copy of Snow Leopard (the last copies had 10.6.3 which will start up any Intel Mac before 2011).
UPDATE:
There are three partitioning schemes used by both Windows and OS X. The first is MBR, which has been around since the 1980’s. The second is GPT, which is fairly new. The third is a hybrid scheme which combines the first two. OS X’s Disk Utility application allows you to select either MBR or GPT. If MBR is selected, then you get the traditional MBR scheme. On the other hand, if you select GPT, you will get either the GPT or the hybrid MBR/GPT scheme. Normally, the GPT scheme is used, but if one or more partitions have a MS-DOS (FAT) or ExFAT format then the MBR/GPT scheme is employed. If an external drive is hybrid, Windows will see the drive as MBR. If Windows is used to change the partitioning on such as drive, the results are unpredictable. This is why Apple recommends only using MBR to partition an external drive to be used by both OS X and Windows.
I believe your external drive was partitioned as an hybrid drive. The output you posted from the gpt command shows both GPT and MBR partitions.
To review, here is the output you posted from the command sudo fdisk /dev/disk1
. It is the content of the MBR table.
Disk: /dev/disk1 geometry: 45600/255/63 [732566645 sectors]
Sector size: 4096 bytes
Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: EE 1023 254 63 - 1023 254 63 [ 1 - 76805] <Unknown ID>
2: AF 1023 254 63 - 1023 254 63 [ 76806 - 461468854] HFS+
3: 07 1023 254 63 - 1023 254 63 [ 534820616 - 73242187] HPFS/QNX/AUX
4: 0C 1023 254 63 - 1023 254 63 [ 608062976 - 124503552] Win95 FAT32L
We want to remove partition 3 (Yosemite) from the table. When done, the output should appear as shown below.
Disk: /dev/disk1 geometry: 45600/255/63 [732566645 sectors]
Sector size: 4096 bytes
Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: EE 1023 254 63 - 1023 254 63 [ 1 - 76805] <Unknown ID>
2: AF 1023 254 63 - 1023 254 63 [ 76806 - 461468854] HFS+
3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
4: 0C 1023 254 63 - 1023 254 63 [ 608062976 - 124503552] Win95 FAT32L
Start by entering the following command in a Terminal window. The command is interactive. When completed, the Yosemite partition will be removed from the MBR tables. Windows will show the space as unallocated. Other than having a Safari window open to this page, make sure all other windows are closed.
sudo fdisk -e /dev/disk1
Below is the input to the above command. Note: Your password may be required. I did not include this in the input below.
edit 3
0
write
y
exit
I thought it might be helpful to include an example. This is what I saw as I entered the above input. Remember, what you will see can differ slightly. Certainly, the integers will be different.
Steelhead:~ davidanderson$ sudo fdisk -e /dev/disk1
fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory
Enter 'help' for information
fdisk: 1> edit 3
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
3: 07 1023 254 63 - 1023 254 63 [ 253328280 - 250708632] HPFS/QNX/AUX
Partition id ('0' to disable) [0 - FF]: [7] (? for help) 0
Partition 3 is disabled.
fdisk:*1> write
Device could not be accessed exclusively.
A reboot will be needed for changes to take effect. OK? [n] y
Writing MBR at offset 0.
fdisk: 1> exit
The next set of commands remove the Yosemite partition from the GPT tables, then add the partition back in with the correct UUID. These commands do not alter the content of the partition. Enter the following at the Terminal window.
diskutil unmountDisk /dev/disk1
sudo gpt remove -i 3 /dev/disk1
diskutil unmountDisk /dev/disk1
sudo gpt add -i 3 -b 534820616 -s 73242187 -t hfs /dev/disk1
And you are done.
Let me know how things work out.
You will need to edit your question to post the results. Don't worry about the format, I can clean that up for you. From the Terminal application enter the following commands. Some may require your login password. This is normal.
diskutil list
diskutil cs list
sudo gpt -r -vvv show -l /dev/disk0
sudo gpt -r -vvv show -l /dev/disk1
sudo fdisk /dev/disk0
sudo fdisk /dev/disk1
Best Answer
Reboot into Single User Mode (hold cmd-S on boot)
Run
/sbin/fsck -fy
fsck
is File System Consistency checK.-f
forces the process, and-y
assumes yes.This will basically run Disk Utility's Repair Disk, but outside of the OS so that is has full read/write to the disk.
Once complete,
reboot