Linux for Macintosh

From LQWiki
Jump to: navigation, search

Introduction

GNU/Linux users mostly install their systems on PCs running Windows. Subsequently, many Linux docs are geared towards these users. These docs do not usually cover issues having to do with running Linux on Macintosh hardware or running OS X and Linux side by side. Apple users may also have to go the extra mile to find programs compiled on PPC rather than x86 architectures, possibly even compiling the source code themselves.

For those users interested in using two operating systems, OS X is a fine choice. OS X runs on a BSD-derived open-source UNIX system called Darwin: the UNIX-style memory management insures that crashing programs will not affect the rest of the system.

Before Installing Linux

Choose a distribution

First, you must choose a distribution to use. Many distributions provide PPC-specific installers:

The Yellow Dog Linux distribution is an Apple-oriented release of GNU/Linux based on the Red Hat and/or Fedora Core distributions. Visit http://www.yellowdoglinux.com to find out more about their system.

The Fedora Project recently released Fedora Core 4, which supports Linux running on both mobile, G4 and G5 architectures. They have an active IRC support channel of #fedora-ppc on irc.freenode.net that deals with ppc specific issues.

To date, only Gentoo has issued a working Live CD for PPC architectures. The Gentoo LiveCD only works on New World machines to date. [Gentoo PPC Project]

Knoppix is currently working on a LiveCD distribution of its Debian-based distribution. [Knoppix PPC mailing list]

The relative merits of each distribution are amply discussed elsewhere. This page is currently based on the author's experience installing Debian's 3.0 "Woody" release.

Initial precautions

When booting Linux on any machine, make sure to back up all of the important data on your hard drive.

Keep your Macintosh Software Restore or OS X Installation CDs handy. You can rescue your Mac from these discs if you need to.

It is usually a good idea to keep another internet-ready computer around, so you can consult on-line documentation if your installation fails in any way. If you are installing Linux on your only computer, be extra sure to have rescue CDs on hand and print out all pertinent documentation (like this page, and your distribution's installation guide) before you start installing.

Discover your hardware

The vast majority of installation-related heartache comes from one part of the process: installing the correct drivers and finding the right configurations for your equipment. Chances are that you do not know if your computer is using an ATI Rage or ATI Radeon graphics card at the moment and do not think the difference is important -- you're incorrect. Knowing the difference between these cards can save you at least 12+ hours of pain, suffering, and frustration.

Find out each and every detail about your hardware. This is easy if you are still running Mac OS X. Merely click in the upper-left-hand corner on the blue Apple-logo. Click on the menu item "About This Mac". The screen that pops up will have a "More Info" button. Clicking this button will launch the "Apple System Profiler" program. Export the system profiler information to a text file, then either email it to yourself (if you will have access to a computer during the install) or print it out.

This list of system information will acquaint you with every single component in your computer. When it comes time to configure your kernel and set up your config files, this piece of paper will save your life.

Installing Linux

Setting up your Hard drive

All Linux distributions require dedicated hard drive partitions. Creating these partitions usually requires the destruction of all data on your hard drive. Non-destructive partitioning is possible, but the common program used for this task, mac-fdisk, is not capable of it.

If you have a multiple hard drives in your system and you want to set Linux to be your default system, you must install it on the "MASTER" disk. The "MASTER" disk occupies the first disk drive port. All other disks are called "SLAVE" drives and cannot contain the primary operating system.

If you are interested in dual booting your system, there is a Macintosh program capable of non-destructive partitioning called ipartition. Unfortunately this program is commercial.

Partitioning for Dual Boot

If you desire to partition your hard drive so both OS X and Linux can co-exist, please read this section carefully. If you are wiping OS X from your system entirely, skip this section.

Not too long ago, the "Linux" part of the hard drive was invisible to OS X and vice-versa. Fortunately, this is no longer true. As of this writing, HFS+ support on Linux is still experimental. Recent Linux kernels can mount Macintosh hard drives based on the HFS+ file system. OS X support for ext2 and ext3 is adequate, but far from seamless. The OS X user has to become the superuser to write onto many of the files. On Mac OS X 10.2.x and 10.3.x, there is a free utility available at sourceforge that allows users to read and write on ext2 and ext3 file systems. ReiserFS is not yet supported.

If you are using ipartition, merely create a lot of free hard drive space, and then use that free space on the existing OS X partition to create a new "free space" partition at the end of your hard drive. Your hard drive has a beginning and an end, and OS X strongly prefers to be located at the front. The size of the Linux partition is up to you, but a few gigabytes is not a bad idea.

If you are using the Macintosh Disk Utility program provided on the OS X Install CDs, first erase the entire disk. After you are finished with that, create your OS X partition at the beginning of the hard drive (graphically, this will be depicted as the partition at the top of the rectangle depicting the hard drive space). If you want to be able to boot OS 9 on another partition, create a second partition for that purpose. For the OS X and OS 9 partitions, you will be given the choice of a file system format. Choose either Macintosh file system for these partitions (it is not significant).

For the next part -- this is important -- leave the rest of the hard drive blank, as "free space." Do not choose "UNIX style" or any of the other options. The mac-fdisk will do a better job partitioning this free space than the Disk Utility.

Before continuing on to your Linux booting, install the Macintosh systems first. "Disk Utility" doesn't play nice with pre-existing systems.

How to install without a floppy drive

In the late 1990's, Apple no longer included floppy disk or zip drives on many of their computers. In the years since, these drives have become largely vestigial on most other computers and the community has become used to the idea of floppy-free installations.

There are two ways to begin installation without a floppy drive:

  • Boot from a CD
  • Install a minimal base system and install from the Internet

Booting from a CD

First check to see if the distribution's CD is bootable. Most, if not all, PPC distributions should have this attribute. To boot from the CD, insert the disk into the drive and restart your computer. While the computer is starting, hold down the "c"-key on your keyboard. If you hold the key down during the initial "chime" made by the computer, your CD-based boot should be already in progress. Your distro of choice will take care of the rest from this point.

Booting from your Hard Drive

You will need to install what would have been on the "Linux install floppy" on your main hard drive. This "floppy" consists of a very very basic Linux system, including a kernel image and a bootloader. In this case, the bootloader should be yaboot (yet another bootloader).

External links

There are a handful of sites devoted to apple-linux discussions and problems:

Source pages

These pages contain source material for this topic. Please consult them if you are contributing to the page. We appreciate your help!