HOWTO Install CentOS on a MacBook Pro
From Consultancy.EdVoncken.NET
Contents |
Overview
- Bootcamp
- On Leopard, I used Bootcamp to partition the harddisk. I reserved about 80GB for Linux (to make room for several Xen instances).
- rEFIt
- Installed the rEFIt boot loader to make life easier
- CentOS
- Installed CentOS 5 x86_64 (the 64-bit version, I used 5.1). Take into account the limited nr. of partitions (MBR: max. 4 Primary, can use Extended. GPT: more Primary, cannot use Extended. Therefore, max. 4 partitions).
Installation
Late 2009, I installed Fedora 12 on my MacBook Pro.
Constraints
- /dev/sda1 and /dev/sda2 are already in use by Mac OS X
- For dual-boot, only 1 partition is really needed, but a Swap-partition is strongly recommended. So in practice, you want at least 2 partitions (Swap and /)
- Can use LVM, but you need a /boot partition outside of LVM
I opted to have a /boot partition on /dev/sda3, with LVM using /dev/sda4 as a physical volume. In this PV, I created the root, swap etc. filesystems as usual.
The remainder of the PV can be allocated to Xen DomU guests, or used for Snapshot backups.
Troubleshooting
- I used rEFIt to sync the MBR and GPT partition tables
- The system would not boot into Linux; "Missing operating system" error. The icon for Linux is a "greyed out" square instead of a nice Tux
- It turns out that Anaconda silently fails to install Grub (on /dev/sda3, not in the MBR!)
- Install CentOS as usual
- Reboot, notice that system won't boot into CentOS
- Boot from CentOS DVD, go into "linux rescue" mode
chroot /mnt/sysimage grub-install /dev/sda3
Voila, this should fix the problem. Reboot and enjoy your nice CentOS installation!
Wireless LAN
I've had success using MadWifi and wpa_supplicant.
The 'wifi0' interface did not work for me, I use the 'ath0' interface instead.
- Install madwifi and dkms (RPMs available on RPMforge)
- Set your WPA parameters using wpa_passphrase - this will generate output similar to:
# wpa_passphrase SSID passphrase
network={
ssid="SSID"
#psk="passphrase"
psk=28964ba6ea8b8f3a0db1c4414b327da253d0af5d4f4adccec0f8abf5b05b10f8
}
- Append the output to /etc/wpa_supplicant/wpa_supplicant.conf
- Enable wpa_supplicant: chkconfig wpa_supplicant on
- Test wpa_supplicant by starting it in debugging-mode, and restarting networking:
wpa_supplicant -D madwifi -i ath0 -c /etc/wpa_supplicant/wpa_supplicant.conf -d
In a separate terminal, run
service network restart
You should see debugging messages, and if all is well you should obtain a WiFi connection with your access point.
Bluetooth
Wireless Keyboard and Mighty Mouse
Activating the Apple Wireless Keyboard and Mighty Mouse was simple, once I figured out how to do it. They are, in fact, standard Bluetooth devices:
hidd --search
Alternatively, you can directly select your keyboard or mouse by BD (MAC) address:
hidd --connect 00:1D:DE:AD:BE:EF
Scrolling using the mouse wheel doesn´t work properly yet - don´t know why.
Note: the 'hidd' binary is part of the bluez-utils package.
Hints and Tips
Mounting Mac OS X volumes under Linux
- Mount the Mac volume as "hfs+"
Sample /etc/fstab entry:
/dev/sda2 /mnt/apple hfsplus defaults,ro 1 2
Mounting Linux volumes under Mac OS X
- ext2fsx - Mac OS X ext2 Filesystem - appears to be buggy!