Ubuntu 11.10 and OSX Lion dual boot on MacBook Pro 8,2 even with FileVault2!

Standard

Hi there guys – so I heard that the latest OSX / MacBook Pro was causing issues for people wanting to dual boot with the latest Ubuntu release so I decided to have a go. OK so I’m not going to pretend it was easy but you should be able to get it running if you just follow this simple set of steps. I have included notes about what you will have to do differently if you are using FileVault2 also – the encryption of the main partition makes booting a tad trickier!

  1. Download the latest Ubuntu, 64bit ISO from ubuntu.com I recommend the 64bit build as I do for all software running on the MacBook Pros. Once you have downloaded the file you need to burn a CDR using Disky Utility’s “Burn” feature.
  2. Prepare a partition to install UbuntuUsing Boot Camp Assistant or Disk Utility you should create 1 new partition at the end of the disk at least 50GB in size. We will be using only 1 partition to get round complexities with the partition syncing required with complex partition schemes. This means a swap file should be used but that is performing well enough for me.
  3. Download and install rEFIt Using the automatic installer should be enough for most people but if you are using FileVault2’s full disk encryption you will need to perform the following steps in a terminal once installation has completed:
    sudo -s
    cd /tmp
    mkdir efi
    mount -t msdos /dev/disk0s1 efi
    cp -r /efi/refit efi/EFI/
    bless --mount /tmp/efi --setBoot --file /tmp/efi/EFI/refit/refit.efi --labelfile /tmp/efi/EFI/refit/refit.vollabel

    That code will copy the rEFIt booter to the hidden system boot partition so it can be read at boot time.

  4. Boot the Ubuntu CD and run a standard installation into the partition you createdThe installation should proceed as normal but be sure to allow the “closed” software to be installed (this helps with media playback etc) and choose a “custom” installation type when prompted. This will take you to the partition management section. Here you must:
  5. Choose the new partition to use the mount point “/” and format it in ext4
  6. Tell the bootloader to install to /dev/sda (yes, I know the MBR is not what is recommended in older OSX dual boots but due to some new restrictions with the booting it is the only way to go)
  7. Other than that pick your preferences etc – the install should take less than an hour unless you chose to download lots of updates and you have a slow internet connection!
  8. Reboot into OSX and re-enable rEFItIf rEFIt disappeared during the installation (which is more likely if you are using FileVault2) you need to execute the following in a terminal for a normal installtion:
    cd /efi/refit
    sudo ./enable.sh

    or for a FileVault2 setup use the following terminal commands:

    sudo -s
    cd /tmp
    mkdir efi
    mount -t msdos /dev/disk0s1 efi
    bless --mount /tmp/efi --setBoot --file /tmp/efi/EFI/refit/refit.efi --labelfile /tmp/efi/EFI/refit/refit.vollabel

    That should get the boot process back in order.

  9. Restart and choose “Linux” from the boot options – hooray!At this point you should see tux sitting on a grey screen for around 5 seconds before linux starts booting. if you see anything else then you probably messed up the partition options in the ubuntu installer – read my doc above and try again…
  10. Set up a swap file to make up for the missing swap partitionAs we have no swap partition we will need to set up a swap file instead. Remember that the file should be about twice the size of your installed RAM and enter the following commands into a root terminal:
    sudo dd if=/dev/zero of=/mnt/8GB.swap bs=1024 count=524288
    sudo chmod 600 /mnt/8GB.swap
    sudo mkswap /mnt/8GB.swap
    sudo swapon /mnt/8GB.swap

    Then you need to edit the file /etc/fstab and add the following line at the end:

    /mnt/8GB.swap  none  swap  sw  0 0

    There is no need to reboot at this point – there is more to do

  11. Whilst connected to an ethernet cable install the wireless and video driversI will document this more at a later date but you will, after a short while, see a notification icon about “proprietory drivers” here you want to install the graphics and wireless drivers to acheive full compatibility.

I think that covers everything. Please get in touch if you have any problems following this HowTo.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s