Monthly Archives: May 2015

Installing elementary OS on my late 2006 MacBook 2,1

In January 2007 I bought my first OS X MacBookdevice, a white 13.3-inch MacBook, running OS X 10.4 Tiger on a 2.0Ghz Intel Core 2 Duo processor, having 1GB of RAM. Along the way I upgraded it to 2GB RAM and gave it a fantastic boost by replacing the HDD by an Intel 320 Series SSD. I also upgraded OS X to 10.5 Leopard, 10.6 Snow Leopard and in the end to 10.7 Lion. At the same time YouTube started (2008) offering 720p HD videos. Now almost all videos are available in >720p format. What always frustrated me a bit is that this MacBook wasn’t 100% capable to show 720p YouTube videos. It was viewable, but with annoying frame-drop here and there.

Lately I stumbled upon this “Linux Sucks” YouTube video, which showed the enormous growth of elementary OS on distrowatch.com in the past years. I was interested. Normally I use Debian with i3 or sometimes Gnome3. But I was interested in this lightweight Ubuntu based OS to replace OS X on my MacBook.

I’d like to explain how I installed elementary OS on my MacBook including full disk encryption.

Creating a MacBook compatible bootable USB stick

First of all I downloaded the 32-bit ISO of the latest elementary OS release (Freya). To be able to boot this ISO from a USB stick on a MacBook, you have to create FAT32 formatted USB stick which contains an EFI/BOOT/ folder, with 2 files in there:

Installing elementary OS

Now you can boot from the USB stick. After a minute or 2 the live CD is started.

elementary1

Start the installation by clicking the bottom-right CD icon and follow the wizard.

elementary2 elementary3 elementary4 elementary5

When you get a question about unmounting /dev/sdb, just say “No”. /dev/sdb is your USB device. At the “Installation type” screen choose “Something else”.

elementary6

The interesting part starts now. This screen shows the partition layout of the recognized devices. /dev/sda here is the internal harddrive. In my case it also says INTEL SSD at the bottom. Again ignore /dev/sdb, this is your USB device.

When OS X is installed you have a couple of partitions on the internal harddrive:

  • /dev/sda1: EFI partition, required for booting
  • /dev/sda2: HFS+ partition containing Mac OS X
  • /dev/sda3: An optional ~650MB recovery partition (since OS X 10.7 Lion)

Remove /dev/sda2 and /dev/sda3. Now create 2 new partitions on /dev/sda:

  • a 256MB ext2 partition, this will be the /boot partition
  • fill up the rest with a partition that will be used as “physical volume for encryption

elementary7 elementary8

The installer tries to be smart now, by marking sda3_crypt to be formatted as ext4. Change this partition and configure it to not format it. After that “Quit” the installer.

We just quit the installer, because we want to create 3 partitions in the encrypted sda3_crypt for the root partition (/), swap partition and home partition (/home) using LVM2. This is not possible to configure this via the installer.

elementary9b elementary10b

Open the terminal App. As you can see /dev/sda3 is encrypted and referred to as /dev/mapper/sda3_crypt. Now execute the pvcreate, vgcreate and lvcreate commands. We’ll create a 10GB root partition, 4GB swap partition and the rest is for the home partition. You’ll see it also created some device symlinks in /dev/mapper.

Now run through the installer once again. At the “Installation type” screen choose “Something else” once again.

Now you see that the installer sees the partitions we just created. Configure the partitions:

  • /dev/mapper/apple-home: btrfs partition mounted at /home
  • /dev/mapper/apple-root: ext4 partition mounted at /
  • /dev/mapper/apple-swap: swap partition
  • /dev/sda2: ext2 partition mounted at /boot

elementary11 elementary12 elementary13

Continue clicking “Install Now” and click “Continue” to confirm to write the changes to disk.

elementary14 elementary15 elementary16 elementary17

Follow the wizard until it starts installing elementary OS and wait for a while.

elementary18 elementary19

It will fail to install the bootloader. Continue without a bootloader. After that the installation from the wizard is complete. Choose “Continue Testing” here.

elementary20b elementary21b

Now we have to fix the bootloader manually. Open the Terminal App. Mount the required partitions and chroot into the new elementary OS installation. Install grub-efi-ia32 and run grub-install. Copy a grub.mo file to /boot/grub/locale/en.mo and run grub-mkconfig to generate the grub configuration.

elementary22b

To make the initial RAMdisk (/boot/initrd.img) aware that /dev/sda3 is an encrypted partition. Put the desired configuration in /etc/crypttab and update the initial RAMdisk.

You can now reboot the MacBook. The funny thing is that elementary OS is snappier then OS X on this MacBook. And it now plays 720p videos flawlessly. 😀