Archive for November, 2009

Multiple partitions with Windows 7 and OS X side-by-side install

The Webmechs Editor on Nov 15th 2009


When installing Windows and OS X side by side using Apple’s recommended Boot Camp technique, you can only use one partition for Windows.  If, like me, you need multiple partitions for Windows, you have to do it another way.  The first thing to understand is that Boot Camp Assistant is not at all necessary for installing Windows 7.

The other thing to understand are that the interaction between GPT/MBR (the new and old style partition tables) and EFI/BIOS (the new/old style firmware) makes things very tricky if you don’t understand the issues.


Several issues to know:

1) Windows 7 (and Vista too I believe) WILL install on a GPT partitioned drive and can also be booted from EFI firmware.

2) When the Windows 7 install DVD boots on a Macbook though, it actually boots in BIOS mode(!), this is because the Macbook will switch to BIOS mode when it sees that a DVD has a BIOS-based bootloader, which a Windows 7 install DVD of course will have.

3) When booted in BIOS mode, Windows 7 refuses to install on a GPT partitioned drive (this is what leads people to mistakenly think that Windows 7 does not support GPT installation)

4) However, and this is the kicker, even if you get the Macbook to boot Windows 7 (whether the installer DVD or the OS itself) in EFI mode, things will not work properly because the EFI version on Macbooks is the older version which Windows does not want to work with!  #$%@#$#@^@@….!!!!!  Windows 7, etc… *need* UEFI 2.0 to properly work with GPT partitions.

These 2 pages have more to say on the issue:

http://darobins.spaces.live.com/blog/cns!C188BEF79F825945!529.entry

http://www.insanelymac.com/forum/index.php?showtopic=186440

So how then do we install the 2 OSes side-by-side?  We’re left with two ways:

1) Hybrid GPT-MBR partitioned disk

or

2) MBR partitioned disk

From a Windows-centric viewpoint, method 2 is probably the cleanest and lets you deal with your partitions with standard tools like Partition Manager.  In this case, you will need to hack your OS X install DVD to install on an MBR disk.  The two links below explain how:

http://blog.netnerds.net/2009/10/easily-install-mac-os-x-leopard-on-an-mbr-formatted-disk/

http://www.insanelymac.com/forum/index.php?showtopic=181287

But because they involve extensive tweaking on the Mac command line which I don’t currently wish to involve myself in, I will go with method 1 instead which this blog article will explain further.

Firstly, a hybrid GPT-MBR disk is one looks like an MBR drive to older non-GPT supporting OSes but which GPT-supporting OSes sees as GPT.  As far as I understand, only the Disk Utility that comes with the OS X install DVD to create a hybrid GPT-MBR table correctly (if gParted can do this, drop me a comment…)

In my case, I needed 4 partitions, 3 for Windows and one for OS X.  In Disk Utility, I did the following steps:

1) Create 4 partitions in the partition editor, 3 as FAT and 1 as an OS X filesystem.  IMPORTANT: Make the OS X partition the last one.

2) (VERY IMPORTANT) Select GUID Partition table instead of MBR type using the Options button.

3) Apply changes and then reboot into the Windows 7 install DVD.

4) When the Windows 7 installer shows the available partitions you will see one extra 200MB partition at the beginning.  DO NOT DELETE THIS!  This is the GPT protective partition, deleting it will prevent Windows 7 from booting correctly afterwards.

5) The free space you allocated for OS X will show up as “unallocated free space”.  Do not panic.  This is because MBR only allows 4 primary partitions and they will already have been taken up by the GPT protective partition and the 3 primary FAT 32 partitions.  OS X uses GPT aand will see this last partition correctly, however, MBR cannot show it.

6) A side effect of pre-partitioning this way is that the 200MB (for Win7 RC) and 100MB (for Win7 RTM) “System Reserved Partition” will no longer get created.  Some people consider this an annoyance so this would be a good thing for them.

7) You can now proceed to format one or all 3 partitions via the Windows 7 installer.  This will turn them into NTFS, and allow install of Windows 7 on them.

8 ) NOTE: If you had installed OS X in Step 3, before booting into the Windows 7 Install DVD, the machine will default to booting in OS X, so you should hold down the Alt/Option key to see the Windows partition and boot from it instead.


Filed in Modbook, OS, OS X, Windows | No responses yet

DLL handling in Windows x64: The Big Gotcha

The Webmechs Editor on Nov 7th 2009


I had a nasty time trying to get the PHP module to run under Apache 2.2 in Windows 7 x64.  Specifically, I kept getting a “php_mysql.dll could not be loaded” error. After some sleuthing, decided to use Dependency Walker to help figure out what was wrong.  It turns out that I had installed the 64-bit version of MySQL and so it was trying to load the 64-bit version of libmysql.dll.  So instead, I must use the 32-bit version of libmysql.dll.  Traditionally, the way to do this is to manually copy libmysql.dll over to the \Windows\System32 directory, and after reading the entry below, I realized I was going to save myself countless hours because I saw this before I was going to attempt the copy:

http://blogs.msdn.com/ashishme/archive/2009/04/01/32-bit-vs-64-bit.aspx

In a nutshell, what this means is that on 64-bit Windoze, you should copy your 32-bit dlls into \Windows\SysWOW64 rather than \Windows\System32 otherwise, your 32-bit programs will never find them.  Why?  This is because all 32-bit programs running on Windows x64 are handled by the WOW64 emulator which transparently maps all access to \Windows\System32 to \Windows\SysWOW64\Windows\System32 on Windows x64 is, ironically, reserved for 64-bit dlls.  MS claims this had to be done for compatibility reasons.



Filed in OS, Windows | No responses yet