Jump to content
mickles

Guide: Multiboot Windows 7, Leopard, Ubuntu on GPT disk

27 posts in this topic

Recommended Posts

Note: This is a bit of a tricky setup and I wouldn't recommend it if you're not starting with a fresh hard drive. It also helps a lot to already have an osx install on another computer or on another drive that you can switch over so that you can connect your target drive as an external.

 

1. Partition your hard disk in disk utility

You can have more than 4 partitions, but your windows 7 partition must be in the first three. It would also be wise to have your osx partition in the first three as well. All partitions for ubuntu and windows should be formatted as FAT.

 

Disk utility creates a hybrid MBR/GPT disk this way, but MBR only allows four primary partitions. The system EFI partition counts as one, so you have 3 beyond that to work with. Fdisk and diskpart can only mark those first four active, hence the reason to have osx in there as well.

 

2. Install Windows 7

Windows 7 seems to be the trickiest install, so install this first. When you get to the point in the installer where you choose a partition, go to advanced options, find the partition for windows and click format. This will format as NTFS. If you've followed this correctly and your hybrid disk's MBR portion isn't messed up, you should then be able to install on that partition.

 

When you're finished installing Windows 7, you can install EasyBCD 2.0 beta, though I think this isn't needed if you plan to use Chameleon 2.

 

3. Install Ubuntu

Boot the ubuntu disk, and format your ubuntu partitions (eg ext3 for root filesystem, swap) in the installer's partition manager. Gparted will work with this as a GPT disk, not a hybrid, and destroys the MBR in the process. Not to worry, we'll get this back.

 

Also, when you get to the last step of the installer where it presents a summary of the installation it is about to undertake, click on Advanced. By default ubuntu installs the grub boot loader to the MBR instead of its partition. This can be fixed by replacing hd(0) with hd(0,x) as the place to install grub. Replace x with your drive's number counting from zero.

 

4. Install Chameleon to the EFI Partition

Follow this guide to install Chameleon to the EFI partition.

This is based on this thread, but really what you need is your boot132 extensions, munky's update.sh (which is handy for updating the mkext you'll use in /Extra and can be edited to use Extra instead of /System/Booter).

 

Run this before you start the chameleon guide too:

diskutil eraseVolume "HFS+" "EFI" /dev/diskXs1

(this formats your EFI partition as HFS+)

 

Now you need to set your osx partition as active (or maybe just anything but the windows partition). Mount your drive as an external, then unmount all disks in disk utility.

 

4. Use gptsync to fix your MBR

Gptsync is a little script to sync up the MBR partition table from the GPT partition table in a hybrid disk. It's really invaluable if you're trying to install ubuntu and windows on a GPT disk.

 

Mount your disk as an external in your osx install. Unmount all partitions of the disk in disk utility. Using the attached gptsync file run:

./gptsync /dev/diskX

where X ix your disk's number (use diskutil list)

It should show the updated MBR, click Y, and it should write it out. It should also show a star beside your windows partition, denoting it is marking it active.

 

 

5. Fix Windows 7 Bootloader

The windows 7 bootloader will have been screwed up by losing the MBR table in step 3. Now you need to repair it. The windows partition must be marked active for this. Boot your windows 7 disk (or vista, win7 repair didn't work on my disk), and after selecting language etc, click on repair. It should find your windows install in the box (if it doesn't the partition isn't active), and should immediately repair it and ask to reboot. Reboot, and if you end up with a vista boot graphic, use this command in an administrator command prompt:

 

bcdedit /set {current} locale en-US

 

6. Set osx partition active

To get Chameleon instead of the Windows boot loader, you need to set the osx partition active. (or maybe any partition but windows). You can do this in windows or osx:

 

1. Windows

Open up a command prompt from windows 7 (or from repair in windows disk) and type diskpart. Then type:

list disk
select disk X <--replace X with your disk's number
list partition
select partition X <--again replace
Active

After this, it should say partition x marked active.

 

2. OSX

type fdisk -e /dev/rdiskX where X is your disk's number

p <-- lists partitions
f 1 <-- to mark partition 1 active
write
y
exit

 

Note: both of these work on the MBR partition table and so they only see the first 4 partitions and will not work if the disk hasn't been gptsynced.

 

7. Test bootloader

At this point its probably wise to test the setup and see if chameleon can boot ubuntu and windows 7 correctly. It's even worth testing before you install chameleon, you'll just need to do step 5 twice--before and after.

 

Boot the drive, and make sure all oses (except osx of course) boot.

 

8. Install OSX from retail disk

Install osx by whatever method you like. I prefer to open Osinstall.mpkg from the installation DVD and install to the drive mounted as an external while inside my existing osx install.

 

If all goes well, things should be running. If you have problems, it's probably one of the ones that steps 4, 5, and 6 address, so play around with them.

 

 

This will probably also work with vista, though I'm unsure of how winxp is handled.

gptsync.zip

Share this post


Link to post
Share on other sites
Advertisement

Hello

 

This is what I've got and I am really stuck.

I had my windows 7 and mac osx working perfectly wiith easybcd installed.

I installed chameleon 2 with the installer. I actived and repaired my windows partition with windows install disc. But then I still had easybcd and chameleon as bootloaders. I unistalled easybcd but it stilled showed up as a bootloader . Then I actived the Mac partition using the windows install disc. Now the blinking cursor at boot. Now I cant repair my windows partition. All I want is just the chameleon bootloader and no easybcd. I need help please.

 

Thank you

 

Edit: ok now I have the bootloaders working again but I still want to get rid of easybcd?

Share this post


Link to post
Share on other sites

Do I install grub to the same partition I am installing Ubuntu(disk0s4) or should it be installed to the EFI partition windows created(disk0s1)? Thanks is advance!

 

I am constantly in awe of everyone who has contributed to these projects and hope to soon graduate from a little worker monkey following directions line by line-- to being someone who can contribute something of use...hey its working on ppcgeeks, surely after all theses installed os's on so many different environments will teach me something, I've broken them enough...thanks again.

 

** EDIT

 

I now know that I should be installing on the Ubuntu partition, no matter what I do though it fails to copy required files to any partition but the MBR. What Am I doing wrong.

 

I have a SATA which it sees as scsi so I am typing /dev/sda4 (1 is EFI, 2 is windows, 3 is leopard --not installed yet-- and 4 is ubuntu root install, 5 is swap)

 

I am using Ubuntu 9.04 server i386...

 

Please I need help! Thank You!

Share this post


Link to post
Share on other sites

Install grub to your Ubuntu partition.

I lost my grub boot when I installed Chameleon 2, so I booted from a bootable Linux CD.

When there, mount your Ubuntu partition,

rename your old Ubuntu boot directory to something else,

run grub-install --root-directory=/where_you_mounted_it /dev/sda4

(make sure you write to the correct partition!!!),

delete the newly created boot directory and rename your old one back.

If you get a grub prompt and it doesn't work, you can check

for the right argument for root= by trying for example

(hd0,2)/ then press tab to see if it recognises the partition

and if it's the right one. You can edit the boot arguments

on the fly, but perhaps you know that.

Hope that helps you somewhat.

Share this post


Link to post
Share on other sites

Hi,

The laptop I am working with doesn't have a second drive or an external one plus I don't have another mac is computer availible to me so I was wondering if it is possible to use the os x install environment for the formatting steps which require the unmountig I all disks and partitions and run the gpt script via terminal from a USB drive? Also I have my my he'd partitioned like this so far(says diskutil):

 

1: windows (fat)

2: os x (macos journaled)

3: Linux mint (fat)

4: shares is data space (fat)

 

When I get to the install on w7 I get this:

 

1 partition 1 (200mb)

2 part 2 (79gb was windows )

3 part 3 (30gb was os x)

4 unallocated (128mb didn't exist)

5 part4: Linux mint (25gb properly named)

6 unallocated (14.7gb was the shared space)

 

I imagine that the setup detects patitions in mgr mode so that's why the shared drive dissappeared but when I format partition 2 as ntfs for the windows install I still told thatbi cannot install to that location because the computer doesn't support booting form that disk and hat I should make sure it's controller is enabled in the bios...I'm not sure what to do from here any help with this?

Share this post


Link to post
Share on other sites

Ok so I worked around my earlier problem. I was able to get all of my OS's installed, Windows 7, OS X and Linux Mint (I went a little out of order, installing OS X because I do not have access to another Mac). I started going through the guide further and then ran into problems during the Chameleon install at the end of it's directions, particularly:

 

*I couldn't find a DSDT.aml file to copy to my EFI/Extras

*I have no directory under EFI labelled /System/Booter

 

I followed the Chameleon install directions from post #19 in the thread listed for installing Chameleon in the OP's directions (heading #4).

 

After I rebooted, Chameleon was installed but I was only able to boot Linux Mint successfully. When I tried booting Windows 7, I get "disk read error, Ctrl+Alt+Del to restart" which I imagine is the MBR problem (more on my gptsync problems in a sec). When I try booting OS X, it goes to the white Apple Screen but then I am told to hold the power button to reset. I think this has do to with the missing files I mentioned on my EFI.

 

On to gptsync. Unfortunately because of my inability to mount the drive as external, I copied gptsync to a usb flash drive and then booted into the Mac OS X install environment and ran it from the flash drive via terminal. I ran the following commands:

 

cd /Volumes/disk6 (flash drive)

./gptsync disk0 (my HDD)

 

Then gptsync requests if it is ok to apply MBR, so I hit Y.

Then gptsync returns an error saying it is unable to write. What did I do wrong?

 

So that's where I am stuck. In summary:

 

*I need to know where to locate DSDT.aml so I can copy it to EFI\Extras

*I need to know why I don't have an EFI\System\Booter directory and what needs to be in it

*How do I get gptsync to write to my HDD?

 

Also as a side note, is there anyway to use Safari in the install environment? What is the OS X Terminal command that will list a directories contents (equivalent to "dir" in MS Command Prompt or Linux Terminal)?

Share this post


Link to post
Share on other sites

No one has any solution for this problem?

Share this post


Link to post
Share on other sites

is there a way to multi boot: windows 7, macosx 10.5.6 (ideneb) and ubuntu, without having mac os x on a different external hard drive, and using one hard drive and do 3 seperate partitions?

Share this post


Link to post
Share on other sites
cd /Volumes/disk6 (flash drive)

./gptsync disk0 (my HDD)

 

It has to be /.gptsync /dev/disk0

also, make sure you unmount the target drive first with the umount command, or else it can't write to it

Share this post


Link to post
Share on other sites

It should be a disk partitioned with a GUID boot record by using disk util. From there You should end up with:

 

EFI (200MB hidden partition, part of GUID)

Windows 7 (NTFS)

Ubuntu (ext3, swap)

OS X (HFS+)

Share this post


Link to post
Share on other sites

Hi all i have had this sort of setup running i will try again having all operating systems on the one laptop i first had this setup on my old laptop

which was 7, ubuntu, xp on internal hard disk and iatkos v.5i on external 160gb because i ran out of room on the acer 120gb hard drive and i will try it on my acer extensa and get back to you on how it goes also i have been reading that with grub2 you can boot all of them

Share this post


Link to post
Share on other sites

Hi!

I'm trying to get a quad boot setup to work: Snow Leopard, Windows XP, Windows 7, Ubuntu. I managed to get OSX, Win7 and Ubuntu to work, but WinXP can't see the harddisk in the setup process. I installed OSX first and did the partitioning with Disk Utitlity. After that I installed Win7. After installing Ubuntu, Win7 refused to boot and the repair program doesn't want to repair it, but I think reinstalling it shouldn't be a problem. Now I'm trying to install WinXP and its setup doesn't see any harddrives. I tried to fix the MBR part of the GPT scheme with gptsync, which has found errors and fixed them. But WinXP setup still doesn't see the harddrive. Has anyone an idea what I can do?

Share this post


Link to post
Share on other sites
Hi!

I'm trying to get a quad boot setup to work: Snow Leopard, Windows XP, Windows 7, Ubuntu. I managed to get OSX, Win7 and Ubuntu to work, but WinXP can't see the harddisk in the setup process. I installed OSX first and did the partitioning with Disk Utitlity. After that I installed Win7. After installing Ubuntu, Win7 refused to boot and the repair program doesn't want to repair it, but I think reinstalling it shouldn't be a problem. Now I'm trying to install WinXP and its setup doesn't see any harddrives. I tried to fix the MBR part of the GPT scheme with gptsync, which has found errors and fixed them. But WinXP setup still doesn't see the harddrive. Has anyone an idea what I can do?

 

Could you post partitioning details, please? It's possible that you've got a pure GPT disk rather than a hybrid disk, or your Windows XP partition isn't included in the hybrid configuration. I need to see both the GPT and the MBR partition tables. You can either use different utilities for this (such as OS X's standard gpt and fdisk programs) or view them both with GPT fdisk (use "p" on the main menu and "o" on the experts' menu).

Share this post


Link to post
Share on other sites
Hi!

I'm trying to get a quad boot setup to work: Snow Leopard, Windows XP, Windows 7, Ubuntu. I managed to get OSX, Win7 and Ubuntu to work, but WinXP can't see the harddisk in the setup process. I installed OSX first and did the partitioning with Disk Utitlity. After that I installed Win7. After installing Ubuntu, Win7 refused to boot and the repair program doesn't want to repair it, but I think reinstalling it shouldn't be a problem. Now I'm trying to install WinXP and its setup doesn't see any harddrives. I tried to fix the MBR part of the GPT scheme with gptsync, which has found errors and fixed them. But WinXP setup still doesn't see the harddrive. Has anyone an idea what I can do?

 

 

IIRC XP likes to be installed first in the root of the drive or else it gives u problems. I had the same problem when I wanted to dual boot Vista and XP and I just had to rearange the install order

Share this post


Link to post
Share on other sites

wow, this is really a goot tutorial. But i got a problem... finaly it works with win7 and snowleopard.. but i lost one mbr partition because i have a seconde ex-efi-partition as first partition with only some kb... i dont know where it comes from. How i can solve this prob?

 

diskutil list doesnt show this partition:

/dev/disk0

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *300.1 GB disk0

1: Apple_HFS EFI 209.7 MB disk0s1

2: Apple_HFS Snowleopard 160.1 GB disk0s2

3: Microsoft Basic Data Windows 7 139.6 GB disk0s3

 

but gptsync sees it... and makes a sync to mbr... so i lost a bootable mbr partition:

Current GPT partition table:

# Start LBA End LBA Type

1 40 409639 Mac OS X HFS+

2 409640 313171967 Mac OS X HFS+

3 313434112 586070015 Basic Data

 

Current MBR partition table:

# A Start LBA End LBA Type

1 1 39 ee EFI Protective

2 40 409639 af Mac OS X HFS+

3 * 409640 313171967 af Mac OS X HFS+

4 313434112 586070015 07 NTFS/HPFS

 

Status: MBR table must be updated.

 

Proposed new MBR partition table:

# A Start LBA End LBA Type

1 1 39 ee EFI Protective

2 40 409639 af Mac OS X HFS+

3 409640 313171967 af Mac OS X HFS+

4 313434112 586070015 07 NTFS/HPFS

Share this post


Link to post
Share on other sites
wow, this is really a goot tutorial. But i got a problem... finaly it works with win7 and snowleopard.. but i lost one mbr partition because i have a seconde ex-efi-partition as first partition with only some kb... i dont know where it comes from. How i can solve this prob?

 

Try using my GPT fdisk program. It lets you specify which partitions to include in the MBR side of a hybrid MBR, so you can omit anything you don't want included. There's also a modified gptsync floating around somewhere that's more flexible, but I don't have a URL handy. I recommend you back up the partition table ('b' on the GPT fdisk main menu) before doing anything else; that way, if Windows objects to the changes, you can restore the original and try again some other way.

Share this post


Link to post
Share on other sites

hi !

 

I would like to know why a "GPT/EFI installation" of leo is stressed ?

mbr installation of leo, works fine on both my mbp17 and pc.

 

thanks

Share this post


Link to post
Share on other sites
Try using my GPT fdisk program. It lets you specify which partitions to include in the MBR side of a hybrid MBR, so you can omit anything you don't want included. There's also a modified gptsync floating around somewhere that's more flexible, but I don't have a URL handy. I recommend you back up the partition table ('b' on the GPT fdisk main menu) before doing anything else; that way, if Windows objects to the changes, you can restore the original and try again some other way.

 

 

 

I can vouch for his gdisk program, worked well for me (thanks Rod). Now that I have my dual boot working (using info from this thread and the parts (3 and 9) of this guide that relate to Chameleon), is there a way to back up my hybrid MBR/GPT?

 

 

I thought I'd mention this just in case someone else ran into it: I was stumped for a while that my Windows partition was listed as type EFI by diskutil. Stupidly, I had set that partition with the boot flag in GParted on a Live CD. I'm pretty sure there aren't supposed to be partitions flagged for boot for a GPT disk (correct me if I'm wrong). GParted saw it correctly as NTFS, and once I had removed the boot flag, diskutil did as well.

Supposedly you need to have your Windows 7 partition active for sleep to work; remember this should be in the MBR portion, not the GPT (I wasted some time figuring this one out).

Share this post


Link to post
Share on other sites
I can vouch for his gdisk program, worked well for me (thanks Rod). Now that I have my dual boot working (using info from this thread and the parts (3 and 9) of this guide that relate to Chameleon), is there a way to back up my hybrid MBR/GPT?

 

If you mean you want to back up the partition information so that you can easily restore it if some errant partitioning tool deletes or changes the partition table, then GPT fdisk will do it. It's the "b" option on the main menu. (The "l" option on the recovery & transformation menu restores a backup.) The backup includes the MBR (including any boot loader that's stored there) and all the GPT data.

 

If you want to back up all the data on the disk, then I recommend using OS-specific tools for each OS, such as Carbon Copy Cloner for OS X or DriveImage XML for Windows. Cross-OS tools can work, but sometimes they've got subtle limitations or "gotchas" that can cause you grief at restore time.

 

I thought I'd mention this just in case someone else ran into it: I was stumped for a while that my Windows partition was listed as type EFI by diskutil. Stupidly, I had set that partition with the boot flag in GParted on a Live CD. I'm pretty sure there aren't supposed to be partitions flagged for boot for a GPT disk (correct me if I'm wrong). GParted saw it correctly as NTFS, and once I had removed the boot flag, diskutil did as well.

 

GPT does not have an equivalent to MBR's boot/active flag, so you're right about that. Confusingly, GParted identifies the EFI System Partition as having the "boot flag" set, so the sort of mistake you made is actually encouraged by the program's design. I know that real Macs have a concept of "blessing" a partition, which is similar to setting an MBR partition's boot/active flag, but I don't know how Apple does this on GPT disks.

 

Supposedly you need to have your Windows 7 partition active for sleep to work; remember this should be in the MBR portion, not the GPT (I wasted some time figuring this one out).

 

I've never before heard this. I discovered just a few months ago that Windows no longer requires the active/boot flag to be set in order to boot. It's a bit of a step back if it's needed for sleep to work!

Share this post


Link to post
Share on other sites
If you mean you want to back up the partition information so that you can easily restore it if some errant partitioning tool deletes or changes the partition table, then GPT fdisk will do it. It's the "b" option on the main menu. (The "l" option on the recovery & transformation menu restores a backup.) The backup includes the MBR (including any boot loader that's stored there) and all the GPT data.

 

 

Perfect, thanks for that.

 

Another question where you might be able to provide some insight: I'd like to be able to access my HFS partitions from Windows. It seems MacDrive won't support this, do you have any suggestions on how it might be possible?

Share this post


Link to post
Share on other sites
Another question where you might be able to provide some insight: I'd like to be able to access my HFS partitions from Windows. It seems MacDrive won't support this, do you have any suggestions on how it might be possible?

 

Are you referring to the ancient HFS or the much newer HFS+? I've never used it, but I was under the impression that MacDrive supported both HFS and HFS+. (We are both talking about the same MacDrive, right?) If you've tried it and are having problems, I recommend you start a new thread on that problem. If you've not tried it, why are you under the impression it won't work?

 

Also, IIRC the latest versions of Boot Camp include a read-only HFS+ driver, so if MacDrive isn't working and you don't need to write to the volume, you could look for that.

Share this post


Link to post
Share on other sites

I meant HFS+, sorry for the lazy omission. I never did figure out how to access my OS X partition from Windows, but I don't use Windows except for Matlab really.

 

 

I currently have a problem with booting my Windows partition. I overwrote the hybrid MBR by resizing one of my HFS+ partitions. Strangely, srs's GPT Fdisk reports the partition table as APM and gptsync says no GPT is present. However, Acronis, Disk Utility, and TestDisk all report GPT and can read the structure of the disk fine. Chameleon works, and boots my 2 OS X partitions fine.

 

Any thoughts?

Share this post


Link to post
Share on other sites

Does the Windows-partition have to come first here, then Ubuntu, then OSX...?

 

Or can I partition OSX first, then Windows, then ubuntu ?

 

I want to OSX as the autoloaded OS like it was before I started with this multiboot thing.

 

I guess it doesnt have much difference, and that you can actually set what OS it is supposed to autoboot from someway ?

 

Excellent if you want to explain me how also for this.

Share this post


Link to post
Share on other sites

Hi to everybody. I am interested in dual booting windows 7 and snow leopard using a macmini. The problem is that I have an apple cinema display 20 inches, in which no bios can be seen. I have been wondering if it is possible to do dual boot and how to do it. Thank you for your response.... :rolleyes:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×