RAID 0 Apple Software + x86_64 kernel + GUID + Dual Boot Seven

Ok, it’s been about 4 days since I’m working on this, and it’s almost over...

Let me explain a little bit what I’m trying to build here…

I bought two 500GB Hard Drives. And I wanted to set up a RAID 0 with them. Unfortunately my motherboard doesn't have any RAID controller, and I didn’t want to buy one. So I had to choose between Windows RAID Software or MacOS RAID Software… The choice was very easy to make, Windows didn’t allow any RAID between partitions, but only between entire Hard Drives. So, I started to learn a bit about how to make a Software RAID with Snow Leopard… and this is actually quite easy to do and that’s how I created a RAID 0 for my OS X install. But The hard work was just beginning. let me explain why a little...

First of all, you can’t create any RAID between MBR & GUID partitions. So, you have to make a choice between MBR or GUID for your drives… I’ve read on insanelymac forums that MBR was a very old partitioning system, and OSX is running faster with GUID. But, GUID and Windows bootloaders don't really like each other. To add up to this, under Windows Seven there is no more boot.ini file (which used to be easy to modify to boot OS X partitions), now everything is written in a BCD file and makes things harder to access. But because I love challenges I chose GUID anyway.

So let’s suppose I want to install Windows Seven on one of my GUID drives… (it seems easy, but it’s not). Windows by default doesn't understand GUID, so it will convert your drive to MBR in order to install its bootloader. The solution to avoid this, is to install Windows Seven on your second Hard Drive, and let the installer create that bootloader on the first drive which will become a MBR drive (but we don't care about this drive).

Here are the detailed steps to make things work:

Step 1:

At this stage, you should create all the partitions you want on your 2nd_HD.

  • 1st_HD –> MBR (nothing installed on it yet)
  • 2nd_HD –> GUID (nothing installed on it yet)

Step 2:

Install Windows Seven.

  • 1st_HD –> MBR (1 partition of 100MB: Windows Seven bootloader named “System Reserved” that boots the Seven partition on the second Hard Drive!)
  • 2nd_HD –> GUID (1 partition: Windows Seven)

Step 3:

Boot Windows Seven and use EasyBCD to boot directly with the Seven partition, I think it’ll still format the 2nd HD in MBR. (You can check which MBR is affected by attempting to boot the 1st HD and then the 2nd HD. I still think it’s the second one that is affected.)

Step 4:

Boot MacOS X installer, format your first drive as GUID, and create your RAID!

  • 1st_HD –> GUID (1 partition: RAID FOR OSX)
  • 2nd_HD –> GUID (2 partitions: Windows Seven & RAID FOR OSX)

Step 5 (optional):

Try to boot back on Windows Seven using a USB Chameleon bootloader (it worked like a charm for me).

Step 6:

Restore your previous OSX system on your RAID Drive (I think if you install OS X it will erase Windows Seven's MBR).

Step 7:

Boot OS X using a USB Chameleon bootloader, for which you just have to choose one of the two (or more) “Boot OSX” partitions displayed on the bootloader menu.

Step 8:

Create a Chameleon bootloader. You have to install it right on your “Boot OSX” partitions, for this you need to follow the README file instructions that are in the Chameleon bin archive. BUT!!!!!! VERY IMPORTANT!! DO NOT INSTALL THE MBR boot0 FILE on your 2nd_HD. Only on the first one. Because in that case, it would erase what EasyBCD wrote on the MBR.

Step 10:

Check both drives by changing the boot order in your BIOS. The first HD should bring you directly on Windows Seven, the second one should load Chameleon. Check if you can boot Windows Seven with Chameleon, if you can everything is fine and you can now set the Second HD as your first HD to boot.

Please note that all these steps are the result of my understanding about how MBR and bootloaders work. I learned it these last 4 days by testing almost any possibilities to make this dual boot work for GUID partitioned drives.

Why is this all very complicated? Because Windows Seven can’t boot without MBR, so if you erase your MBR, you can say goodbye to your Windows Seven install, or you can try /FixMBR but it never ever worked for me.

Here are some interesting points I found during my investigation:

  • My 64bits kernel cannot be loaded if I set my HD to work as IDE. I have to enable AHCI for that. If not, I have to use the arch=i386 flag to boot with chameleon and boot using the 32bits version. (To have the 64bits kernel you have to use arch=x86_64 but that might be due to some missing 64bits kexts for IDE)
  • BCD is a peace of $^<-!
  • BCD cannot boot without MBR (Master Boot Record)! Yeah… WTF… XP was fine with that…
  • We can write MBR on GUID… But a Hard Drive can be formatted using the MBR partition table format or GUID (new version). So that makes the things harder to understand.
  • You can install Windows Seven & MacOS without any DVD Reader… just with Flash drives and it is quite fast but you need more than 1 USB Flash Drive…
  • Always keep with you a USB Flash Drive with Chameleon bootloader on it, just in case something goes wrong.
  • Always backup your data!!! Even if you think you’ll not make any mistakes (I lost my entire Windows Seven partition… fortunately I didn't do the same mistake with my Snow Leopard partition).
  • Don’t try to use another computer to test your findings, because it will crash (I lost my Windows Seven partition & Jolicloud partition on my eeepc. Fortunately, BT4 & Leopard were safe.)
  • Windows Seven sucks with AHCI.

Why 64bits kernel? GeekBench 5395 –> 5410 + http://netkas.org/?p=127
Why GUID? http://www.insanelymac.com/forum/index.php?showtopic=76603
Why AHCI? http://expertester.wordpress.com/2008/07/24/ahci-vs-ide-%E2%80%93-benchmark-advantage/
Why RAID0? About 140MB/sec W/R speed vs 70MB/sec on a classic partition. Snow Leopard boots really really faster and apps as well!!!!

I’m still working on it, and I’ve just fixed an important issue (the one with 64bits kernel). So, everything should work fine now, and before tomorrow I might be able to get a RAID0 Snow 64bits on a GUID HD with Seven 64bits on it.

What I have to do now: Find the right AHCI drivers to install Seven… because I thought IDE was fine for both OS... I was wrong.

(About 30 hours of investigation… I really need to sleep now)

EDIT: Everything is finally working fine ! OH YEAH!

Related terms:

Thireus
Mobile Application Security Engineering Lead & SME | 0076 7E64 293A E3EC 542B 9C72 3A11 417C B43F DB1A