I've been using Linux more and more and decided I could justify having Linux on my internal drive (alongside OS X) while leaving Windows on the external one. Naturally this meant rebuilding, and rethinking my strategy.
In the process I've found a few more thoughts, theories and observations.
As I understand it....
Items in the Mac boot menu (holding alt) are
a) Partitions on GPT-partitioned drives of partition type EF00 (EFI system). These are FAT32 or HFS+ formatted.
b) Partitions on MBR-partitioned and hybrid GPT+MBR drives that are marked 'active' (bootable)
Booting from a) is in EFI mode. Booting from b) sets BIOS emulation mode.
Windows on a Mac, despite supporting standard UEFI, doesn't appear to support Apple EFI, so only works in BIOS emulation mode.
Windows 8 has two modes:
When booted from EFI, it must be installed to a GPT partitioned disk.
When booted from BIOS emulation, it must be installed to an MBR partitioned disk.
When you set up Windows on a Mac, it has to be in BIOS mode, so it has to see BOTH the internal and external drives as valid MBR drives.
The internal drive is GPT partitioned (as required by OS X), and the way to get around this is called a "Hybrid GPT/MBR" drive. This means the drive is partitioned to the newer GPT system, but also has an MBR for backward compatiblity. If you want to access a GPT defined partition via MBR, the MBR has to have the exact same start and end sectors and a compatible filesystem type. Basically, it's like two indexes to the same book.
Naturally, this is dangerous, and Linux tools will warn you as such. If the MBR gets out of sync and an OS sees what it thinks is "free space" and uses it, or sees what it thinks is unformatted and wipes it, it can wipe out your data.
By default, your internal drive on a Mac gets a GPT table and a hybrid MBR with just one partition, type EE, covering the full drive. This is just so that MBR based operating systems don't see your drive as empty and write data to it, instead they see it as type unknown and ignore it. It's more commonly known as a "protective MBR".
The Refit/Refind package removes the protective MBR and instead maps the MBR to the same layout as the GPT as best it can. Make sense? (Clear as mud, I know).
When it does so, it translates type EF00 (EFI) partitions on the GPT to Active partitions on the MBR. Interestingly, remember when I talked about going into gparted and marking the 300MB+ "bootcamp" partition with the "Boot" attribute? What this ACTUALLY does is change the partition type in the GPT from 0700 (Windows data) to EF00 (EFI). Both are still Fat32 format! And GPT doesn't really have a concept of an 'active/boot' flag, rather, that's what EFI partitions are for. It's just the partition type changes.
=== WHEW ===
The kicker was when I threw an internal Linux partition into the equation, BUT I forgot that you can only have 4 Primary partitions on an MBR disk, and so when you do the sync from refit (or gptsync which you can get from refit in Linux) it only translates the first 4 partitions.
Here was my GPT layout:
1: EFI partition for OS X, type EF00
2: OS X System, type AF00
3: OS X Recovery, type AB00
4: Linux, type 8300
5: Linux EFI Boot, type EF00
6: BOOTCAMP (Windows boot), size 400MB, type EF00
gptsync bombed out because it doesn't recognise type 8300 (which seems silly, must be a bug) so I had to temporarily change the Linux partition to type 8301 in any case (Linux Reserved). But then even when it did work, it only translated the first 4 partitions. Oops! The MBR can't see partition 6!
Here is the correct GPT layout:
1: EFI partition for OS X, type EF00
2: OS X System, type AF00
3: OS X Recovery, type AB00
4: BOOTCAMP (Windows boot), size 400MB, type EF00
5: Linux EFI Boot, type EF00
6: Linux, type 8300
Now BOOTCAMP is on partition 4, type EF00, so it's translated to FAT32/Active on the MBR, and Windows installs. I now finally (after figuring out how to get Arch Linux to boot directly from an EFI boot partition instead of going via BIOS emulation, so it appears in the Mac's ALT menu) have a triple boot going. Windows external, OS X and Linux internal.
Refit was only really necessary for gptsync, which is available in Arch Linux's AUR, so I'm also managing without Refit - everything is bootable from the ALT key menu.
I think I'm *starting* to understand how it works