openSUSE on a Mac

From openSUSE

This article is under review!
The contents are currently being evaluated and edited by User:Jonathan_R. Others should not make major changes in the meantime. Thanks for the cooperation.
Documentation:
Installation - Package management - Configuration - Hardware - HOWTOs - Users_FAQ


Geeko This is the home page for instructions on installing openSUSE on an Apple Computer, but the advice applies equally to installing any recent Linux distribution. The instructions here assume an openSUSE version 11.1, earlier versions have various problems which are no longer documented here. This page will describe the background and common procedures for installing Linux on an Intel Mac, and any special issues with the general openSUSE installation procedure. Separate pages will detail any exceptions to the process for specific Mac hardware and openSUSE combinations. While there are several different ways to set-up a Mactel to run Linux, the procedure described here is the most commonly used and most widely supported as at November 2009.


Contents

Specific Hardware

Please read the specific details on your hardware and openSUSE version before proceeding to the general steps below.

Preparation

This chapter describes the steps you should do before you install openSUSE on your MacBook.

Remember to always back-up your data first!

You can choose to install only openSUSE, dual-boot OS X and openSUSE, or triple-boot OS X, Windows and openSUSE. It is recommended that you keep OS X even if you don't intend to use it, as this will allow you to install any firmware updates the Apple releases.

If you intend to install only openSUSE, you can skip all the Preparation steps.

Update OS X

In OS X run the Software Update tool to check for OS and Firmware updates.

Install rEFIt In OSX

The easiest way to manage booting multiple OS's on an EFI based Intel Mac is to install the rEFIt boot manager rEFIt. Install rEFIt in OS X using the Mac disk image download.

As at 2009-10-30 the current version is 0.13 released on 2009-03-23: "This release supports the new Mac Pro models, and should automatically support future Mac models with changes to the firmware memory layout. It also adds NetBSD detection and fixes issues with case-sensitive file systems."

rEFIt includes a useful tool to synchronize the GPT and MBR partition details. You should run this after any change to your partitioning scheme either in Mac, Linux or Windows. From the rEFIt initial boot screen, choose "Start Partitioning Tool", carefully read the output, and type 'y' to confirm. Be aware that rEFIt assumes an American keyboard layout.

Re-size The OSX Partition

The OS X partition has to be re-sized to make space for Linux and Windows if you want to triple-boot.

Using Disk Utility in OS X 10.5 Leopard or OS X 10.6 Snow Leopard

This is the recommended method as it both natively shrinks the HFS+ partition and writes a guaranteed valid GPT partition table. Under Applications / Utilities or using Spotlight launch the Disk Utility and resize the OSX partition to the required size. It is also recommended that you set up your chosen partition scheme for Linux and Windows here as well to ensure your GPT partition table is valid. Simply create all the required partitions in the required size and set the type to HFS+, except for your intended Windows partition which you should make FAT. See the notes on Partition Schemes below.

Using BootCamp in OS X 10.5 Leopard or OS X 10.6 Snow Leopard

Bootcamp provides a simple GUI to split the exisiting OSX drive into two partitions, non-destructively shrinking the first partition for OSX and creating a second partition as FAT32, which can be re-partitioned later as you require. Once finished partitioning, exit BootCamp without installing Windows, even if you plan a triple-boot set-up. The Disk Utility method is preferred as it is more flexible.

Using diskutil in OS X 10.4.6 or later

BootCamp was originally released in beta form for OS X 10.4, but is no longer available for download. An alternative is to use the Mac OS X program diskutil. The ability to non-destructively re-size volumes was added to diskutil in OS X 10.4.6 (for more information see macgeekery.com).

The following command example assumes that "disk0s2" is the OS X partition and will resize it to 60 gigabytes):

$ sudo diskutil resizeVolume disk0s2 60G
Started resizing on disk disk0s2 Mac OS X
Verifying
Resizing Volume
Adjusting Partitions
[ + 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% ] 
Finished resizing on disk disk0s2 Mac OS X
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *149.1 Gi   disk0
   1:                        EFI                         200.0 Mi   disk0s1
   2:                  Apple_HFS Mac OS X                59.9 Gi    disk0s2
$

Warning: this may or may not work depending if your partition has been re-sized before.

Alternate approach

Disable journaling in MacOS, boot to Linux, use Parted to re-size the MacOS partition and turn journaling back on in MacOS and have the filesystem checked.

Booting From Install CD / DVD

To make your Mac boot from a Linux or Windows CD or DVD, you need to hold down the 'c' key as the Mac starts up, keep holding it down until it is obvious the CD is booting.

Partitioning

There is a myth that you can only have 4 partitions on an Intel Mac, this is no longer true. The limitation is that Windows and GRUB only know how to read the MBR and not the GPT and are thus limited to the first four primary partitions. Both OSX and modern Linux kernels know how to read the GPT and so are not restricted once booted.

All that is thus needed is to ensure that:

  • The first partition (/dev/sda1) is kept for the EFI boot partition, do not delete or format.
  • The second partition (/dev/sda2) is kept for OS X, do not delete or format.
  • The third partition (/dev/sda3) is kept for GRUB, so use for either Linux / or /boot
  • The fourth partition (/dev/sda4) is kept for Windows
  • The fifth and subsequent partitions are used for Linux as required, e.g. /, /home, /tmp, swap, etc.

Notes:

  • After partitioning, always run the rEFIt GPT/MBR re-sync tool.
  • The bootloader must NOT be installed in the MBR, it MUST be installed in the Linux boot partition, so in /dev/sda3 for the partition scheme described above.
  • The EFI boot partition is not actually used by OS X to boot, but is believed to be needed for firmware upgrades.
  • OS X can actually be on any partition, but is easiest left where it already is.
  • It is reported that Windows must go on the 'last' partition in the MBR, otherwise you may experience problems when re-installing Windows when it inevitably needs it.
  • You need to use a partitioning tool such as Free FDisk (contained on e.g. Ultimate Boot CD) to make the Windows partition the active one, otherwise your Windows installation will fail.
  • You could use elilo instead of GRUB to boot Linux without using the MBR, but this would also bypass the BIOS which is required by various video drivers for accelerated 3D graphics.

GPT support was introduced into the kernel in version x.x.x.x and is enabled at compile-time with the CONFIG_EFI_PARTITION option. This support has been enabled in openSUSE since xx.x. The procedure for older versions of Linux is no longer documented here as it is assumed new installs will be for recent enough versions.

Triple-Booting With Windows

You can triple-boot your Mac with OS X, Windows XP/Vista, and Linux. If you want to do this, it is best to install Windows first before openSUSE. You will need to re-partition the hard-drive to your chosen scheme for Windows AND openSUSE before you install Windows.

It is strongly recommended to use the built-in OSX Disk Utility as this will guarantee a valid GPT table. Alternatively use a Linux Live CD with a GPT capable partition tool (parted > x.x.x), such as openSUSE >= 11.1 or Ubuntu >= 8.10 or Mandriva >= 2010 (Mandriva 2009 is know not to work properly), to boot your Mac and set up your partition scheme (see partitioning below). Reboot and in rEFIt choose the GPT Re-sync tool to confirm the GPT and MBR records are synchronized.

Now proceed with your Windows install. You cannot use BootCamp to do this, as it only supports a Mac/Windows partition scheme. Instead boot your Windows install CD directly. Ensure you have either a full Windows install disk, or if you have an upgrade disk a second external CD drive, as you cannot manually eject the main install CD on most Macs when required to insert your original licensed disk. Afterwards install the Mac drivers from your OSX install DVD. Note that running Apples unified driver installer the drivers requires at least XP SP2. If you only have a SP1 version of XP you should download the SP2 redistributable installer first and install that.

While installing WinXP SP2 or SP3 you will get the following message:

"There is not enough disk space on C:\WINDOWS\$NtServicePackUninstall$ to install Service Pack 3 Setup requires an additional 4 megabytes of free space or if you also want to archive the files for uninstallation, Setup requires 4 additional megabytes of free space. Free additional space on your hard disk and then try again."

This happens because OSX uses the EFI file format which Windows XP does not support. To workaround this problem, add a registry key as follows:

   1. Click Start - Run - Type “regedit” and press enter.
   2. Navigate to
   [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup]
    
   HKEY_LOCAL_MACHINE
       \Software
            \Microsoft
                 \Windows
                     \CurrentVersion
                          \Setup
                         
   3. In the right pane, Right-click and select New - String value
   4. Name it as “BootDir” and set its value to “C:\”

Once Windows is installed, you can then proceed with your Linux install.

openSUSE Installation

The normal openSUSE installation process is followed so is not covered here in detail. This section will only discuss where the Mac install differs from the normal.

Keyboard Issues

It has been reported that sometimes the built-in keyboard of the MacBook and Macbook Pro is not recognized during the boot. If the openSUSE install menu (with install/rescue/options) hangs on the 'boot from hard-drive option', try rebooting your MacBook. A workaround is connecting a USB keyboard to your MacBook when the installation menu starts.

Location of the Bootloader

This step is very important!

Be sure that the bootloader is NOT installed in the MBR—just in the Linux boot partition, so in /dev/sda3 for the partition scheme described above.

Look at the Bootloader section in the Installation Overview screen to confirm that this is set correctly.