Triple boot: Install backtrack AFTER Windows is installed in OSX (no data loss)
(Preword: I checked through the forums to see if any have this info to no avail. If this is a repeat, please let me know)
This is merely a bit of info on how to prepare to and finish an install of BackTrack on a Macintosh (running 10.5.x, should work for 10.4.x too) that already runs dual boot with Windows and with no loss of data. I ran into the problem of my Windows XP not booting after I added the partition for BackTrack. You must have enough free space on your primary drive for use in delegating to the BackTrack partition. This is not a complete install guide, as there are more than plenty of those online. I just never found anything specific to my case.
I'm running 10.5.6 on a 2.5GHz Intel Core 2 Duo with 4GB of RAM. It's also a 9L31a build, which you can find by going to the Apple Menu, selecting About This Mac at the top, and then clicking the gray version information located just below "Mac OS X".
You can also determine your make with the following command in backtrack:
root@bt:~# dmidecode -s system-product-name
Usual disclaimer: Nothing is perfect and few things are consistent in the computer world. Your results may vary, so do whatever you need to so as to ensure you won't permanently lose important data. This guide WILL be rearranging the data on your hard drive.
So, if you already have Windows XP installed via Bootcamp or whatever and want to add a bootable partition for any BackTrack, you need to follow these steps:
rEFIt is a bootloader that will facilitate booting from different partitions... in essence, it gets rid of the need to hold "option/alt" or "c" while restarting and is much more flexible.
You can find this everywhere online. And if you cant.... well...........
Create a partition for Backtrack: open up Terminal in OSX
The "diskutil list" command will show your current partitioning scheme.
~al$ diskutil list
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *186.3 Gi disk0
1: EFI 200.0 Mi disk0s1
2: Apple_HFS Macintosh HD 119.4 Gi disk0s2
3: Microsoft Basic Data 70.5 Gi disk0s3
Now you have to split your Mac HD partition into two, the other one for Backtrack. Mine is "disk0s2" in this case, and it should be for yours as well assuming you have followed previous instructions. The reason you need to split the Mac HD is that Windows MUST remain as the last partition.
Now resize the volume
~al$ sudo diskutil resizeVolume disk0s2 <the size you want your Mac HD to be> "MS-DOS FAT32" Backtrack <the size you want your Backtrack partition to be>
NOTE: The two sizes must add up to the shown size of disk0s2 in the "diskutil list" command performed earlier. Otherwise, it will take priority of the size of the first disk.
where 114.4G + 5G = 119.4G = size of disk0s2
~al$ sudo diskutil resizeVolume disk0s2 114.4G "MS-DOS FAT32" Backtrack 5G
If you run into any errors, you may either have to check the sizes you listed or defragment your Mac HD before resizing. I use iDefrag for that: shifting all the data to the beginning of the block. If interested, I can tell you guys to make a MacOSX bootable USB Flashdrive or HD with use of iDefrag (you need the full version)
Install BT and configure your lilo.
What happened: after you re-partitioned your mac, Windows was assigned a new partition label. It became disk0s4 instead of remaining as disk0s3. Now Windows has NO IDEA from where to boot. If you try booting Windows now, you'll get the "Blue Screen of Death" after just a few seconds. If you try 'Safe Mode' for booting, you'll see windows searching "(3)" for all the boot files. That's the 3rd partition. The solution is quite simple actually.....
Go through any install method for BTx (x for any version) you wish until you configure your lilo.conf file. I used this forum post to aid my installation, thanks to steve_baker:
Now this is where the fun starts!
After editing it to your delights, merely add in an extra section at the end:
Then install lilo as directed, usually a command like:
other = sda4
label = Windows
table = sda
Modify the fstab and install it.
# lilo -v -b /dev/sda3
Now shutdown your computer, wait a few seconds, and reboot into Backtrack.
Configure your Mac for Triple Boot.
When the rEFIt menu comes up, select Backtrack for booting. Now all you need to do is edit your "boot.ini" of Windows.
After logging in you need to mount your windows drive for editing.
Go to your mounted windows drive
# mkdir /mnt/windows
# mount /dev/sda4 /mnt/windows
Now edit your boot.ini to boot from the right partition.
All you have to do is change all instances of "3" to "4", and then write the file. With this, you're telling Windows to boot from the 4th partition, since you shifted the partition table to include Backtrack. If you feel uncomfortable doing this, feel free to save a backup copy of the boot.ini by writing it as a different name, like "boot.ini1" before changing the numbers.
Restart, and select Windows within the rEFIt menu. All three operating systems should now boot without a problem, and all data should be untouched.
edit:: clarification of code and sentence syntax fixes