I am sure all of you would love to brag about how cool your dual/double booting computer is. Whether its Mac and Windows, Windows and Linux, Mac and Linux or just two versions of the same operating system, its always cool to be able to have direct access to each one of those OS’s on one computer. What most people don’t know is that you can basically have a single computer that is partitioned to have as many operating systems as you like on it, however for practicality’s sake you would only want to install the number of OS’s you actually want or use of course
The following is a tutorial based on hacking the Macbook Pro for three operating systems: Mac 10.5.* , Windows 7 RC7100 , Backtrack 4 (Which are my favorite OS’s
). The Macbook Pro is one of the first of its kind to use an Intel based CPU chip, allowing OS’s like Windows and Linux to be compatible dynamically if partitioned correctly. Just a heads up, this tutorial will take anywhere between 4 – 8 hours, depending on your speeds, so be sure to free some time up as once the process has started, the only going back is starting from the beginning.
Quick reasoning of how the following tutorial works: Basically, each operating system has to have their own file system, and these file systems are found in specific installed places when installing each operating system (Not only that but they are a requirement for the operating system to work properly). You then have something that is written on your computer to show the operating system where to find these file systems called the MBR or Master Boot Record. Now here’s where it gets tricky, each operating system has their own way of ‘seeing’ other partitions on your same drive. So if you ask it to look for something behind something else, it wont be able to find what you asked it for since it doesn’t understand to look at the specific place you told it to, unless you tell it otherwise. If you want to triple boot and it to WORK you need to set the system up with Windows as the last partition, but sustain the MBR of it being installed before Linux, since boot-camp will not register Linux as the main operating system before the MBR is loaded on boot up.
How to Triple Boot with a Macbook Pro
What you will need:
- Operating system install CD’s for each operating system you will be using. In my case its, Backtrack 4, Mac 10.5.6, and Windows 7.
- rEFIt
- a bootloader program that runs from the Mac native EFI file system.
- 4 to 8 hours of time
Preparation:
First I will assume you have the Mac operating system installed on your computer since your using a Macbook pro. Also you will be partitioning your computer into three operating systems and will need to split the partitions evenly unless you want to change the numbers around yourself to get more space on any one operating system you can. But I am basing this around splitting your hard drive into three parts evenly.
Before we start, a word of warning: you MUST plan all your partitions in advance (ie. how much space each OS has and how many of them you have) because if you dont, you WILL NOT be able to change them after the process has been completed unless you do a complete reinstall from scratch.
The Tutorial:
Intro note: Here it is folks! In 10 easy (but dreadfully long) steps! Also remember, this is specifically for Macbook Pro’s that want to triple boot Mac OS 10.5+, Windows 7, and Backtrack 4 Linux.
1.
First thing you’ll want to do if you haven’t done so already would be to install rEFIt from their main web page on sourceforge: http://refit.sourceforge.net/ After its done installing you mount the image and install the application. After its done installing you might want to change its default timeout of 20 seconds and set it up to be the default boot menu. Do so by bringing up a terminal in your Mac environment and typing:
/efi/refit/enable-always.sh
Then navigate to this directory in your HD: /efi/refit/ After that then you can open “refit.conf” up in a text editor. Change ‘timeout 20′ to ‘timeout 0′ then save and close.
2.
You will need to set up the partitions by going into the Mac terminal and typing:
sudo diskutil list
That should give you the basic partition table after you type your password, be sure to make note of how much space it has total (whether its MB, GB, or if your that lucky: TB, I don’t care. Just make note of it. Also make note of the identifier column of your Apple_HFS drive. It should be something like ‘disk0s3′,’disk0s2′, or something along those lines. You will be using that identifier in the next command:
sudo diskutil resizeVolume <–Apple_HFS Identifier you made note of–> <–size you want your mac partition to be–> “UFS” <–name of linux distro–> <–size you want linux to be–> “MS-DOS FAT32″ Windows <–size you want windows to be–>
Example:
sudo diskutil resizeVolume disk0s2 71G “UFS” Backtrack 113G “MS-DOS FAT32″ Windows 113G
Note: The first number is the total size of the mac partition, the second number is the size of the Linux partition and the third number is the size of the windows partition. Each one has to add up to a number lower than the TOTAL size of your HD. In my case it was 71+113+113=297. Which is lower than 300GB, my total HD size. You will need to calculate how much you want to allocate to each OS depending on the size of your hard drive.
3.
Now we start the installation process! Hooray!
Put in your Windows 7 RC CD and reboot. If you have done all the steps correctly then it should load you to a screen from rEFIt and it should allow you select the Windows 7 CD to boot from and install. Follow the instructions until is asks if you want to upgrade or do custom installation. For the purpose of triple booting we need to select custom. Then it will show you a list of partitions to install too. Click “drive options (advanced)”. Then with the correct (Disk 0 Partition 4) selected, click Format and Ok. Once its done formatting click Next. Then go grab a drink or get yourself some lunch and sit back, because you’ll be waiting for a while now. However it will reboot a few times and when it does, be sure to select the Windows HD from the rEFIt menu not the Windows CD.
Once its done installing, it should lead you to a setup screen for your first boot up. Manually setup whatever you want your customizations of your name, comp name, etc to be. Then on boot up eject the CD and put in the Linux distro CD of your choice. Obviously for me it was Backtrack… However no matter what Linux distro you chose to install you will you need to backup the MBR (Master Boot Record) of the computer while in the Linux install and before you install the GRUB bootloader into your computer. If you don’t copy it correctly you will mess everything up and need to start from the beginning.
4.
Once you load into the Backtrack environment it should start up and load a bunch of things on the screen then ask you type something. You will need to type:
startx
bringing up the main backtrack desktop KDE environment. We will now need to format the third partition for Linux before we install. To do this, open up a Shell Konsole and type: (Text shown in bold is your command entry)
fdisk /dev/sda
then simply type the command:
Command (m for help): p
this will bring up something like:
Device Boot Start End Blocks Id System
/dev/sda1 1 26 204819+ ee GPT
/dev/sda2 26 9278 74317824 af Unknown
/dev/sda3 9294 24029 118357016 a8 Darwin UFS
/dev/sda4 * 24046 38914 119427072 7 HPFS/NTFS
That is what my basic partition table looks like BEFORE the Linux partition format. The following commands will allow you to install Linux on your system, use them in the exact order given: (Text shown in bold is your command entry)
Command (m for help): d
Partition number (1-4): 3
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Selected partition 3
First cylinder (<whatever> – <whatever>, default <whatever>): Press Enter
Then press Enter again
5.
After that when you type the command ‘p’ in the Konsole without quotes you should see something like:
Device Boot Start End Blocks Id System
/dev/sda1 1 26 204819+ ee GPT
/dev/sda2 26 9278 74317824 af Unknown
/dev/sda3 9294 24029 118357016 a8 Linux
/dev/sda4 * 24046 38914 119427072 7 HPFS/NTFS
Notice that your /dev/sda3 is now Linux formatted. Lastly we will need to write this partition table to the drive then restart the computer into Linux again. Do the following while still in the fdisk Konsole window:
Command (m for help): w
After its done writing to the partition table you should be able to type:
reboot
to reboot the system into rEFIt, however when it asks for you to remove the install CD, DO NOT REMOVE IT! After the reboot is done select the ‘Legacy OS’ CD from rEFIt which is Linux CD and boot back into the Linux environment using the same method as before (typing startx). Finally we will need to turn the Linux partitioned drive into a ext3 filesystem. How do we do that you ask? Oh well just type this into the Konsole and wait a few seconds:
mke2fs /dev/sda3
Yes it was that easy!!!!
We can go on to installing it onto the third (/dev/sda3) partition now that its all set up!
6.
From the desktop of the Live CD, open up a new Konsole window and then type:
ubiquity
bringing up the ubuntu system installer that is also used for Backtrack. Once its up it will give you an error (most likely), just click continue. Select your Country/timezone/state of residence, and your keyboard layout. Once thats done you should get a menu asking to divide the disk space up for “Ubuntu” (which it thinks is ubuntu.. but we are smarter than this stupid computer, we are sneaking a backtrack install into this drive, not an Ubuntu one
)
Make sure to click the button that says
Guided – resize SCSI3 (0,0,0), partition #3 (sda) and use freed space
The move the slider so that Ubuntu takes as much if not all of the space on partition. Now before you click forward, go read the next step thoroughly as this part is crucial to do.
7.
It will then ask you if your sure that you want to set this partition size, as it will take a long time and you cant go back on it. This point of the install is crucial because you need to backup the Windows MBR to a temp folder then copy it back over BEFORE Linux installs its GRUB bootloader. Do the following BEFORE clicking next:
Press:
Alt + F2 (Macbook Pro requires the fn key to be held as well)
In the Run Command Box type:
dd if=/dev/sda of=/tmp/sda.mbr bs=512 count=1
Click run
Press:
Alt + F2 again (dont forget about the fn key)
This time in the Run Command Box type:
dd if=/tmp/sda.mbr of=/dev/sda
This time dont click run.. Just leave that command ready to be clicked on later on. The reason for this is purely the fact that we need to run it while the Backtrack Linux install is installing and BEFORE it gets to GRUB bootloader. So now that you have the Run Command box up you can click next on the Installer box. Wait a few moments and it should finalize the partitions then ask you to fill in some info. Fill in your basic username you want, password you want, and computer name. Check the ‘Log me in automatically’ box if you want. When you click next again it should ask you if you want to transfer any documents or settings. Since we just finished installing the Windows OS, there really isnt any documents to copy over even if you wanted too. Just click forward again.
8.
The last page of the installer box should be a review section just to make sure you went over everything correctly. You came this far.. So after reviewing click the ‘Advanced…’ button and then click the arrow for places to install the bootloader. Find the spot where your active Linux partition is going to be.. In our case its /dev/sda3. So go ahead and click that, then click Install. But be sure to strap on your seatbelts first. Once the install gets to around 70% you should be in the green to click the RUN button on the “Run Command” box we opened up at the end of step 6.
9.
When the install is done it will ask to reboot, just click restart now. When you are in the rEFIt menu, you will need to update the need MBR to the three OSes for them to properly load. Use the arrow keys in the rEFIt menu to get to the ‘Partitioning Tool’ icon and press enter. When it asks, “May I update the MBR as printed above?”, just hit y on your keyboard and say you have had enough of these annoying computer things
10.
Then let it take its course and when its done you should be at the rEFIt menu with three bootable OSes on your Macbook Pro! Congrats!
Conclusion:
A good idea would be to install “inputremapper” on your windows side as it adds many functionality features that are critical on the macbook pro. Like right clicking for example….
- – - – - – -
Finally, in theory you could put as many OSes on a single drive as you want, as long as you perserve the MBR of Windows and make sure its the last partition on your disk drive. Hope you learned from my tutorial. Feel free to leave me a question or comment.
I tend not to brag, but in the interest of bragging for bragging sake.. I only use one OS. Security Enhanced Linux – as endorsed by the NSA (theres an old saying “whats good for the goose..”).