How to triple boot MAC OS X Lion, Windows 7, and Linux

Prerequisites: 

Machine capable of running OS X, bootable flash drive with an OSX installer, linux install cd, windows install cd, half a brain.

How to triple boot MAC OS X Lion, Windows 7, and Linux
-cisc0ninja's notes:

-----Disclaimer-------------------------------------------------------------------------------
I've got lion installed via the flash drive install method; basically following online tutorials. Some of the information here may seem the same, or similar to information elsewhere but there are a few slight difference/modifications. I give full credit to all of the sites/authors listed at the bottom, and am not claiming to be a subject matter expert. Nor am I claiming to have written or done anything other than use google, read tutorials/forums, and post my results and what I did here. If this helps you, great, if not you may need to do what I did and keep searching the web. If you're an author/site that is pissed off at me or feels I've stolen something, feel free to email me directly or take what I've written here and add it to your tutorial, or reproduce this on your site, I don't care. As I've said before, I merely use soldierx.com's tutorial section to post notes for myself on topics I've looked in to and use it as more of a centralized database for notes and references.

Enough ranting, on to the goods...

-----General view---------------------------------------------------------------------------

I installed OSX first, then Windows, then Linux. The key thing to remember is that whatever OS's bootloader you want to use, SHOULD be the first OS installed. This is not necessarily true for Linux, Linux can handle booting basically anything with the right grub options. But if you want to use the OSX bootloader, OSX should be first, if you want the Windows bootloader, then Windows should be the first partition. More or less it just simplifies it this way, but if you're plan is to run Linux then grub really doesn't care as long as it's configured properly. In Linux you need to run gptsync /dev/sda to fix the boot loader issue, otherwise Windows won't boot. Using your flashdrive you boot the installer with the -s option to get a root shell and use fdisk to make OSX partition the active one. Using your flash drive, boot the OSX partition. Once inside re-run the multibeast installer file and reboot. You can disconnect your flash drive and easily see that by pressing a key before OSX is loaded, you are allowed to choose the OS/partition you would like to boot!
Success!

-----File Table/Partitioning---------------------------------------------------------------

In the beginning partitioning, before OSX was installed I used Gparted live cd to format both drives and write an MSDOS partition table aka file table to the disk. I then restarted the system and booted the OSX installer off the USB drive. During the OSX install I used the disk utility to create an OSX partition that was hfs+ (mac journaled fs) for OSX to install to, and created msdos/fat partitions for the Win & Linux partitions. So 3 partitions in total were created. After OSX is installed and you start the Windows installation; you need to format the partition as ntfs in order to write to it otherwise it says "this is a gpt partition table" and won't install. Even though it's technically not a gpt partition table because we formated the entire drive earlier as an MSDOS partition table. I believe that since Windows sees that the first few partitions are not something Windows knows how to read, and the fact that OSX creates an EFI partition as the first partition on the drive; this basically causes the Windows installer to flip out and won't let you write to the disk aka install Windows with out formatting the partition you want to install Windows to as NTFS. The Windows installer also doesn't like it if there are more than 3, maybe 4 partitions that it can read from a single drive. This is due to the whole MSDOS file table limitation, where as GPT (which is the default on a MAC) allows you to have more primary partitions. It is my understanding that this is what people refer to when they say "making a hybrid mbr/gpt drive". This is technically incorrect terminology because the equivalancy goes like this:

Windows : MAC

Location where boot loader is stored
MBR : EFI
File Table
MSDOS : GPT
Partition Table
NTFS : HFS+

So it would be more accurate to say either "a hybrid MSDOS/GPT" or "a hybrid EFI/MSDOS". My understanding of what EFI is or how it works may be flawed, but I'm stating this because we first wrote an MSDOS file table to the drive, then OSX installs what is labeled as an EFI partiton as the first partition and marks this partition as bootable. Therefore, I'm assuming this is "EFI on an MSDOS" setup. Even Linux sees the drive as an MSDOS file table and is readable with fdisk. From my experience, I was not able to get fdisk to read from a GPT file table, and was forced to use the GParted GUI application when I attempted this. There is also the possibility that when we installed OSX it changed the disk's file table to GPT and then created the MSDOS partitions on top of that. The reason I'm saying this is a possibility is because Windows Disk management says the OSX partitions are "GPT Protective Partitions", but what does Windows know...>< meh..

What happens a lot of the time with tutorials and forums is people get confused on the terminology and end up researching the wrong things, I hope this helps to simplify!

After installing OSX, I used multi beast with the options of "easy beast" and "system utilities" checked. While rebooting, I used arch=i386 and cpus=1 to boot off of the hard drive.

-----OSX Drivers Section (skip if you want to start installing other OS's)------

I installed what I think is the latest drivers for my sound and ethernet and they are both working.
VoodooHDA-2.7.2.pkg
RealtekRTL81xx-0_0_90.pkg

I was able to get TSCSync working as well, it is used so that you don't have to give the options arch=i386 and cpus=1 every time you boot. I still need to find an SD card to test out the SDHC driver. For my laptop, "Asus G60VX" there were many others who have worked towards installing OSX and someone who owned an Asus G51VX actually created a zip file with some of the drivers which are called KEXT files in OSX. I took the \Downloads\g51vxworking\Extra\Extensions folder and copied Extensions to \Extra\Extensions on the install drive. After this, camera functionality started working.

I was experiencing some of the same things as other users. In regards to crackling in sound, what it seemed like to me, was that it was turning the speakers in to microphones. The mic and the speakers were picking up sound/interference so I just turned the mic down and disabled it as well as increased noise reduction on the speaker settings under the VoodooHDA driver under the Utilities section, which seems to have improved things.

As for the computer going to sleep I have disabled sleep for now. I have sleep enabler.kext from the g51_working folder in the Extensions area of the file system as stated above, but every time the computer went to sleep I was unable to bring it out of the sleep state and ended up rebooting.

-----Windows Install------------------------------------------------------------------

Start installing Windows off the CD like you normally would and make sure you click on anything that might say "Advanced". This should bring you to a menu for setting up the partitioning. Windows will give you an error upon selecting the partition you want to install Windows on and you should click the button "format as NTFS". Afterwards you should be able to install Windows to this partition. IF YOU CAN NOT......
A) You didn't format the drive and create an MSDOS file table like the begining says to do.
B) You have more than 3 partitions, possibly more than 4! (Windows is finicky about this.)
C) You've messed up somewhere along the lines and have to start all over!

Assuming Windows is installing now, go through the rest of the process like normal. Boot back in to Windows to download and install Windows updates and drivers. I'm saying to install the OS updates now, because you may experience some difficulty installing them later. I believe I have fixed this issue, but Windows is finicky and there may be an update that messes things up although at this time, this is not the case.

-----Linux Install---------------------------------------------------------------------------

Reboot the system and boot from a Linux cd, dvd, usb, whatever. When you come to the area of partitioning, choose "manually partition". Select the previous partition you set aside for your Linux installation. Feel free to now delete this and divide it up into as many partitions as you see fit or leave it as one; your preference. My partitioning looks something similar to this:

200mb - where efi is located, this was created automatically by OSX installer/multibeast
116.42gb - hfs+ - where osx is installed
129mb - i believe this was automatically created by windows, it says unallocated but there may be windows system files here, idk
232.83gb - ntfs - where windows is installed
18.63 - ext4 - / which is root partition for linux
97.57 - unallocated - this is where the rest of my linux partitions reside, gptsync made it so that windows sees them as an unallocated partition but
/etc/fstab has them correct and so does /dev

Having multiple partitions rather than just one for your Linux install is generally a good idea, and one that not many people do now days. It is mostly used so that if one partition is corrupt, or if something is going wrong you can generally unmount that one partition, fix it, remount it, and go on about your day without having to re-do/format-re-install from scratch.
The rest of my Linux partitions look as follows:
4gb - swap
60gb - ext4 - /home
20gb - ext4 - /usr
15gb - ext4 - /var
5gb - ext4 - /tmp (this is really too big and it's a little less than 5 gigs but i dont care)
If you follow the securing debian guide you should know that you need to mount the /tmp partition as non executable, but if you've ever had to install anything you know that /tmp gets used for placing temporary data there while it's being installed. So, install all of your software and then change the mount option in /etc/fstab so that it is non executable afterwards. Rat and others will tell you that having read and execute permissions on a file is just asking to be taken advantage of, while I'm not certain if this also applies to a partition, I'm assuming it does, so you should too!

Due to issues I've had with grub2, I no longer generally use a /boot partition. /boot gets installed under / but whether I install grub to the MBR of the drive, or to the / partition only matters regarding what boot loader you want to be your main one on startup. As of now I'm saying install grub to your / partition since I havn't tested writing it to the MBR as of yet so I can't say if there is anything else necessary to get it working like that.

When the installation finishes you should be able to boot in to Linux. You may need to boot your USB drive and select Linux from the bootloader there. Essentially the USB drive should be able to detect which operating systems are installed on your hard disk and you can use the USB drive's bootloader in order to boot in to each OS as we're needing to fix some issues.

First issue is that you need to boot in to Linux so that you can repair the Windows partition, since Windows is probably not wanting to boot you need to run:
apt-get install gptsync
then run: gptsync /dev/sda
Or whatever your main drive is called (not a specific, partition the whole drive). It will ask you if you want it to write the data, just say yes. After this is done you should be able restart and boot the Windows partition after selecting it from your USB drive's bootloader.

-----Getting back OSX and the bootloader...-----------------------------------------

So we're able to boot in to all 3 OS's but only by utilizing the usb drive's bootloader to detect them! Here's how you fix that...
The windows partition is marked as the active partition, you have to change that. I booted the installer in to command line mode/single user mode with -s which dropped me at a root shell, but you should be able to do this from gparted, Linux, or any number of ways and this step may not be necessary.
From a *nix command prompt type the following:
fdisk -e /dev/rdisk0
p
f 1
w
This should set the OSX partition as the active one. If you are still having issues booting the you may need to boot in to OSX via your USB drive and then run the multibeast installer again. I think this should actually set the partition as active so you may be able to skip the above step but it doesn't hurt to try everything and see what you can get working.

At the end of the day you be able to press your "any key" when the OSX bootloader pops up and be able to choose whichever partition/OS you want to boot from. When you choose Linux however, it boots grub and then give you the option once again to choose a partition to boot from lol. You can probably alter this so that you are using just one bootloader but it's nice to see both of them working in my opinion. This will also allow you to make note of what grub.conf has regarding the necessary options for booting the other OS's; which is good notes to have on hand.

-----Links, References, and Respect-----------------------------------------------------

Shout out's to all of the many who have traveled this path before me, and especially those who have been willing to document their trials and information. I'm just listing some of the main sites more than their links because I used 3-4 links on each of the main sites.

For those looking to build the bootable flash drive:
http://howtohackintosh.wordpress.com/guides/snowleopardusbflashdriveinst...

For those looking specifically for the asus g series laptops: (if some of the info looks the same it's because i recently posted on there under another username)
http://www.insanelymac.com/forum/index.php?showtopic=195922&st=100

For those that actually forked out the money for mac and want to dual/triple boot see rEFIt:
http://wiki.onmac.net/index.php/Triple_Boot_via_BootCamp#Booting_your_ma...