-   Linux - Laptop and Netbook (
-   -   how to dual boot Ubuntu and Win 7 on Macbook Pro (

jagibbs 01-05-2013 10:15 PM

how to dual boot Ubuntu and Win 7 on Macbook Pro
I picked up a Macbook Pro 9.2 recently and want to dual boot Xubuntu 12.10 and Windows 7 Pro (both 64 bit), but have been having a bit of trouble. All of this EFI booting and GPT partitioning is new to me. If you're wondering why I got a Mac to begin with, it's because of the build quality, compactness, and 16:10 screen aspect ratio, but no other reason...

I used to have no problem dual booting the same two OS'es on my older Dell laptop.

I would like to retain the EFI booting and GPT partitioning scheme. I would prefer NOT to use any sort of hybrid partitioning schemes, or even rEFIt or rEFIrd unless absolutely necessary.

I'll forgo my long list of things I've already tried for now. Any tips on partitioning, and the recommended install processes are appreciated.

I'm mostly confused as to how I should partition the disk, what tool I should use to partition the disk, which OS I should install first, and how to get the bootloader to appear and work properly.

otoomet 01-07-2013 06:24 AM

I haven't much experience with EFI. In general, you should first install windows, and thereafter linux (as windows' bootloader does not find other os-s).

In your current case, I would first run ubuntu (or whatever modern EFI-aware distro) live, and partition the harddrive with parted (fdisk does not allow gpt partitions). Thereafter I would install windows on one (or more) of these partitions. Finally, I would put linux on the rest of the disk.

The trick is to configure EFI bootloader correctly. I am pretty sure the modern distros do it, but haven't experimented with dual boot. Take a look at the command "efibootmgr".

Perhaps it helps.

jagibbs 01-08-2013 08:44 PM

I'm generally aware that typical installations go better when Windows is installed first, then linux second. That's how I've always dual booted my older laptops with BIOS and MBR schemes. What's hanging me up now is the combination of GPT partitioning and the EFI boot process. Both are new to me.

Windows 7 Pro 64-bit is GPT and EFI aware. I installed it first, it recognized the EFI, and used GPT partitioning by default. The problem was that the Xubuntu 12.10 installer had no idea what was going on when it saw my disk. It simply thought the entire disk was empty unpartitioned space...

This made me think 1 of 2 things:
1) the Xubuntu installer still has a bit to learn about detecting the current state of things or
2) I'm missing some critical step in the setup or layout of my hard disk partitioning before I even put the Xubuntu install disk in...but I'm not sure what that is.

I'm also not real sure about configuring the default Mac EFI bootloader, but I suspect this is something that would be done after both OS'es are installed?

---> forward a few days <---
When I tried to install Xubuntu first, the partitioning and install went fine, but then the EFI bootloader did not detect my install on my first boot. Perhaps I need a special EFI install of Xubuntu? Not sure how to do this, and if it will then be possible to install Windows second sucessfully.

otoomet 01-09-2013 01:12 AM

Have no experience with (x)ubuntu 12.10. 12.04 recognizes EFI and plays well with it. I had similar issues with 11.10 on a lenovo laptop -- tried 12.04 (too unstable then), made GPT partitions, and later had a lot of trouble when throwing 11.10 on top of it. Installation went fine, but then I spent hours to get it to boot.

The key was to use "grub-efi" to actually write the bootloader to the efi partition (or whatever is written there), and thereafter to use "efibootmgr" to tell EFI what is available and how the boot order will look like. AFAIR, there are two versions of grub, you have to install the efi-version, which behaves exactly like BIOS version, just it can talk all this new EFI stuff. You may try to play around with these programs manually.

Perhaps it helps.

jagibbs 01-09-2013 08:24 AM

OK, so to get things rolling I pretty much followed Rod's Books procedure here:

I started with the section titled "Installing Ubuntu" in which I restored OS-X Mountain Lion onto a small partition first.

I continued the procedure through the "Fixing the Installation" section to create the protective MBR.

I also then installed rEFInd as discussed.

I however did NOT need to do anything special to get GRUB 2 installed (it just automatically appeared with the proper OS-X and Ubuntu listings after the rEFInd boot screen. I also did NOT have to perform any of the steps from 20-28, as everything was already set up properly exactly as described.

At this point I can sucessfully boot into either OS-X or Xubuntu from my selection at the rEFInd screen, then another selection at the following GRUB2 screen.

My question at this point is if I now attempt to install Windows 7 into the large partition I created for that purpose earlier, will it wipe out some sort of critical startup files or structure, requiring additional fixes, or will it simply work out of the box with an additional option in rEFInd and my GRUB2 menus?

otoomet 01-09-2013 06:21 PM

Just my guess.

Look at the content of /boot/efi/. It should include a number of folders for different OS-s (well, in my case only one for linux). Each of them holds a file which I guess is the bootloader. My guess is that windows will either delete everything from there and replace with it's own stuff, or just trick the efi bootmanager to only load windows. In 1st case, you should backup the /boot/efi directory (about 100k in my case), and afterwards restore it and set the new boot menu with efibootmgr. In the second case just play with the boot menu.

I have never tested this with windows though.

jagibbs 01-12-2013 12:25 AM

After a few more nights of no luck, I decided to go back and try to install windows 7 first, then attempt Ubuntu next.

I EFI installed Windows 7 64-bit which created a GPT partitioning scheme.

Now when trying to EFI install Ubuntu 12.10 I see the same error as before.. The installer does not detect any of my existing partitions or my Windows OS.

According to Rods Books at this link...

...the problem is with GPT's protective MBR partition size and a bug in the libparted library which the Ubuntu installer uses.

Rod suggests re-creating the protective MBR using his gparted application, but what I'm wondering is if this will screw up my existing Windows installation, or if Windows will fail to boot after I create the new protective MBR and write the partition changes to disk like he suggests.

Anyone know?

I'm so tired of re-partitioning, reinstalling OS'es that I really don't want to blow away another 2 hours worth of work and customizing of my Windows install. I just really wish the Ubuntu installer was a bit smarter or if this "bug" could be worked out soon. Good thing I purchased the all-inclusive warranty on this macbook when I bought it. I may end up throwing it out the window soon, as much as I like the build quality and screen.

otoomet: thanks for your suggestions. I've taken them seriously, and they seem related to my problems, but haven't been able to create something that works yet.

keithrbau 01-29-2013 05:55 PM

G'day jagibbs,

My experience with an older macbook was after I installed windows and applied the mac drivers, I got OSX to shrink both partitions to reasonable minimum. Then let ubuntu with mac add ons do its thing. It created the additional small partition (efi-grub I think) which took care of grubb. I then went back and deleted that major partition, created a few 20G partitions, a swap and /home partitions and set about installing several flavours of ubuntu and LinuxMint.

After setting up linux as I wanted, I went back to osx and set the default boot partition to boot camp. Then when I boot macbook goes straight to grubb. It lists osx & windows. From memory choosing osx meant a reboot, but windows & linux proceeded as normal.

That was many months ago. I have since changed disks and installed only linux. All good so far.

I am interested to learn that you have had some success with a newer macbook though. My mentor was having much difficulty. He had done the triple boot many times before.


Keith Bainbridge
PO Box 324
BELMONT Vic 3216 Australia
+61 (0)447 667 468

All times are GMT -5. The time now is 12:20 AM.