my Geek::Story;

06/12/2013

Debian on the MacBookPro11,1

Filed under: — guedou @ 16:27

A lot of contradictory information are available online concerning Linux and Apple computers. It is indeed quite simple to install Linux on the (late 2013) Mac Book Pro, and there is no need for rEFIt or rEFInd.

This step by step installation guide aims to have both Mac OS X and Debian installed on two separated encrypted partitions. Operating systems will be selected at boot time by pressing alt/option.

1. Resize the Mac OS X partition

In OS X, open “Disk Utility” and resize the “Macintosh HD” partition. A 64GB partition is a good compromise and will leave enough space to use Linux as the primary operating system.

Removing OS X seems to be a bad idea as it will be needed for future firmware updates. To stay on the safe side, do not remove the Recovery partition, as it is really useful if anything goes wrong, and as it is required to activate File Vault.

2. Prepare the USB key

From OS X, download a devel netinst ISO and copy it to an USB key, using the following command.
$ sudo dd if=Downloads/netinst.iso of=/dev/rdisk2

If everything is OK, the USB key should contain two partitions. The second one being an UEFI boot partition (that you can mount as a FAT32 volume).

3. Boot and check if UEFI is activated

Reboot, and press the alt/option key. When the menu appears, choose the USB key. The Debian installer will start, with a really tiny font.

You can check that it boots in UEFI mode by typing:
# dmesg | grep -i efi

If you get a lot of information related to EFI memory mapping, you are good to go.

4. Manual partitioning & installation

The automatic install should work fine, however a manual partitioning is required to get an encrypted Linux partition. Three partitions should be visible:

  1. the OS X EFI partition should be visible as an “EFI boot partition”, later on grub will be installed into that partition;
  2. the Macintosh HD;
  3. the Recovery HD.

First you need to create a partition that will be used as /boot; 128MB is enough to store the kernels. Then you need to create an “encrypted volume” (it takes a while are the disk is being blanked).

Once created, the encrypted volume must be used as a LVM volume. Inside the volume group, at least two logical volume/partitions are required: swap and /root.

The last part of the Debian installation runs perfectly find. A the end, the EFI partition is mounted into /boot/efi and grub installed.

5. Make the system bootable

Debian is installed, however it cannot be booted, as grub must be renamed to a filename that the Mac Book Pro will recognized. This can be done on OS X as follows:
$ mkdir /boot/efi
$ sudo mount -t vfat /dev/disk0s1 /Volumes/EFI
$ sudo su –
# cd /Volumes/EFI
# mv debian BOOT
# mv BOOT/grubx64.efi BOOT/bootx64.efi

6. Enjoy

Leave a Reply

Your email address will not be published. Required fields are marked *