Friday, August 5, 2011

Triple-boot Archlinux, Windows 7 and Mac OSX

First of all, watch these three videos

This will give you a rough idea as to what you are going to do & believe me, there is more to know than just this.

I will add only the points which are not covered in the video. If you have been a Mac OSX for a while you might also be having your BOOTCAMP partition. Sadly, you would have to get rid of your Windows install..

To do that, start your "Boot Camp Assistant" and select proper options to remove the BOOTCAMP partition. Once that partition is removed, you will now be having only one partition (visible).

Now install rEFIT. And open terminal and type the following commands:-

$cd /efi/refit
$./enable-always.sh

These two comamnds basically enable rEFIT menu to come everytime you start your computer which is not the case by default. There are cases when the DVD you inserted don't come in the menu. In that cases, just select REBOOT from the menu, then keep OPTION button pressed while starting up of the MBP and select refit. This solves the problem, dont know how!!

Now, do as told in the first two videos by that guy. As in the video, make sure that windows partition is the last partition in the HDD. There will be no issues as the process is pretty straight forward..

Without any issues, now you will have a dual boot Windows & Mac install. Don't forget to install the BOOTCAMP drivers by inserting the official MAC disk in Windows.

Now, here comes the hard part. The video shows how to install ubuntu linux which is actually installed without any issues or commands. But, the case is not the same with ArchLinux.

First of all, being a reddit user, I had heard some guy few days earlier that older arch isos were not working with the latest macbook pros. So, without taking any chances, I download the latest version from the official website. For the record, I used DVD-RW to boot from the CD. So, try your look using the USB disk, but I did it simply using DVD.

Now, same as before, restart the system, select the Arch DVD from the menu & install the Arch as you do in a normal PC. Make sure that when the option to Prepare Drives come, don't use the linux's partition tool to partition as we have already done it using Disk Utility in Mac OSX. Just choose the third (or fourth, I dont remember) which asks you "which method to choose; uuid, or partition number or label... & format it with ext4 partition type.

You might face some doubts regarding where to install and get scared, so I have put screenshot for some critical steps.


Now, make sure that while you are configuring your arch system during the setup, add usbinput HOOK as said in the official archwiki. If you forget to do this, in case your system fails to boot the kernel and drops to the recovery shell, you won't be able to type anything & will be forced to do a hard reset.

When the option to install the GRUB comes, please dont install it. We will leave it for later. Now, that you have completed the setup, do a reboot. We still have to do a job, which we never do in PCs. We have to resync the tables.

Do a reboot and let the rEFIT boot menu load, select the option to start the partition editor and sync the tables. (It should already be showing that you need to resync the tables). In case you are curious to know as to what happens if you dont sync the tables. It happened with me as I didn't know about resyncing tables. fdisk and parted were showing different partition types for the same /dev/sda3. See the screenshot below.


So, this is the reason, we have to sync the table as without doing that you wont be able to install the GRUB.

Now, that you have done resyncing the tables, run the livecd of arch linux again and type GRUB in prompt and type the following commands.

root (hd0,2)
setup (hd0,2)

Make sure that you install GRUb in the partition you installed ArchLinux otherwise you will fuck your system.

Hopefully, your GRUb will be installed. My GRUB looked like this.



Now, try to boot.

BTW, I got this error while booting on my MBP 7.1



Look at that error, that means that its not able to find /dev/sda3. So, its strange, isn't it? The live cd is able to find /dev/sda3 but not the install.
After researching a bit, I came to know that it was being caused because of the autodetect HOOK. What this HOOK does is that, it autodetects which modules are not required and accordingly strips down the size of the generated kernel image. In this process, image somehow got damaged to boot on my MBP. To solve this error, I restarted the computer using the arch livecd and wrote the following commands.

mkdir /mnt/chroot
mount /dev/disk/[YOUR ROOT PARTITION] /mnt/chroot
cd /mnt/chroot
mkdir boot
mount /dev/disk/[YOUR BOOT PARTITION] boot
mount -t proc proc proc/
mount -t sysfs sys sys/
mount -o bind /dev dev/
chroot . /bin/bash

#Remove autodetect from HOOKS in /etc/mkinitcpio.conf
#Then execute the command below.

mkinitcpio -p kernel26

Now, you restart and keep your fingers crossed. After this, I was successfully able to boot my arch.

NOW, setting up arch perfectly..
  • To get the keyboard backlight, I installed pommed. Also, make sure to edit the PKGBUILD, by adding the line
find . -name "*" -exec sed -i 's/nvidia_backlight/apple_backlight/' '{}' \;
        as instructed in the ArchWiki.

Now, both keyboard backlight, wifi & changing screen brightness; all should work.
  • That last thing that bugged me was the sound. I was unable to get the sound via internal speaker of my Macbook Pro 7.1. For that I had to create a file /etc/modprobe.d/50-sound.conf and add

options snd_hda_intel model=intel-mac-auto

Then, restart the system or reload the module again (whichever seems more easy to you).

Even now, sound from internal speaker was not working. But, I was able to hear sound from my earphones or headphones. Later, I figured out that, there are actually 2 speakers in MBP 7.1 and they were muted. To unmute them, use gnome-alsamixer. Make sure, there are two speakers to enable to hear the full sound. 

So, now, I had a fully working linux. (and a triple boot too)...


No comments:

Post a Comment