PPC Partitioning

From openSUSE

back to main

To install SuSE Linux on your Mac, some dedicated space on the hard drive (partitions) has to be allocated. This can be done with the tools on the MacOS installation CD, or during the installation of SuSE Linux. If you want to share the same hard drive between MacOS and Linux, you have to reinstall both after the repartitioning. There is no way to resize the MacOS volumes (Edit: This is possible, see Talk:PPC_Partitioning). MacOS refers to (visible) partitions in the Finder as 'volumes', all Linux related documentation uses the term (disk) partitions.

Note: SuSE Linux versions prior 10.1 had no support to repartition your hard drive from within YaST. Everything had to be done manually before starting the Linux installation.

The instructions below describe possbile ways to do the repartitioning.
In any case: make a BACKUP of your private data and system settings, AND make sure you can RESTORE these data!

Note: Using Carbon Copy Cloner makes it real easy to duplicate your internal hard disk to an external drive that can be booted if needed as well. A quick way to backup.

Contents

How to layout the partitions on an Apple PowerMac

To use an operating system beside MacOS, a small boot partition must exist. Its filesystem format must be readable by the OpenFirmware. This leaves only HFS as possible option. MacOS itself is installed on a HFS filesystem variant. Thats why normally no special boot partition exists, OpenFirmware can read from the MacOS partition directly. But it can not read the common Linux filesystems such as reiserfs, ext3 etc.

Beside the boot partition, Linux needs a 'root' partition and a 'swap' partition. More data partitions can be created as needed. So in the minimal case, 4 partitions must exist for a dual boot setup between MacOS and Linux: one HFS partition for MacOS, one small HFS boot partition, one small swap partition and a root partition for Linux. The order of the partitions on disk does not matter, SuSE Linux can handle all possibilities.

Note that Linux can handle only a limited number of partitions per drive, even though the 'mac' disk label could handle much more. For IDE drives, the maximal number of partitions per disk is 63, for SCSI, SATA and Firewire the number is only 15.
The 'Disk Utility' from MacOS X creates a large number of very small partitions between the actual data partitions, they can exceed the maximum number of partitions per drive easily. If you need more partitions per drive, create all required partitions with Linux to avoid these unused extra partitions.
An IDE or SCSI drive that is supposed to be used with MacOS 9 or earlier requires a few Apple_Driver partitions, otherwise none of the existing partitions can be used by MacOS. This requirement does not exist for MacOS X. YaST will not show and touch these driver partitions.


Creating partitions with MacOS X:

  1. Boot from your MacOS X installation CD (hold down the C key during the startup chime), and open 'Disk Utility' at the first screen (from the top menu)
  2. Partition your disk and set up one or more partitions for MacOS X, and one huge partition for SuSE Linux. This partition will be split in the required pieces in YaST.
  3. After writing the changes to disk, start the MacOS installation.
  4. Once this is done, restart and boot into the SuSE Linux installer to finalize the hard drive partitioning.

Creating partitions with MacOS 9:

  1. Boot from your MacOS 9 installation CD (hold down the C key during the startup chime), and open 'Drive Setup' in the utilities folder.
  2. Partition your disk and set up one or more partitions for MacOS 9, and one huge partition for SuSE Linux. This partition will be split in the required pieces in YaST.
  3. After writing the changes to disk, start the MacOS installation.
  4. Once this is done, restart and boot into the SuSE Linux installer to finalize the hard drive partitioning.

Creating partitions with YaST:

  1. Once YaST gets to its main menu, it will make a suggestion (proposal) for a possible partition layout. Often this proposal is correct and usable, but most of the time it has to be changed to something that suits your needs. Click on the link to get into the partitioner screen. In the first screen, select 'Create Custom Partition Setup'.
  2. Now you have the option to either use the whole hard disk for SuSE Linux, or to do custom partitioning.
  3. In the custom partitioner window, select the partitions you want to delete, create or format with a Linux filesystem. Select the huge partition for Linux and click on 'Delete'. Then create a small boot partition, size around 32MB, a swap and root partition.

Remember to format the small HFS boot partition with filesystem type 'MacHFS', the bootloader can not be written if you leave this partition as is.
Do not assign a mount point to the small HFS boot partition, the bootloader configuration will fail if you do assign a mount point!


Creating your Linux partitions manually with pdisk:

  • Boot from your SuSE installation CD1 and when prompted by yaboot type:
install start_shell
This will start the shell before YaST loads up and allow you to edit your disk partitions.
  • In shell, run the following commands to print your patitioning table:
pdisk -l   # to see the available hard drives
pdisk /dev/hda  
#replace hda with any other devices if needed

type p in prompt to print table

Command (? for help): p
Partition map (with 512 byte blocks) on '/dev/hda'
#:                type name                     length   base     ( size )
1: Apple_partition_map 'Apple               '       63 @ 1
2:          Apple_Free '                    '   262144 @ 64       (128.0M)
3:          Apple_HFS 'Apple_HFS_Untitled_3'  83623936 @ 262208   ( 39.9G)
4:          Apple_HFS 'Apple_HFS_Untitled_4'  30660096 @ 83886144 ( 15.4G)
Note that this is only an exaple output (yours might have different block sizes etc.)

In the above example, partition 3 is our OS X partition and partition 4 is our Linux partition.

  • Create the boot, swap and root partitions with pdisk
# Delete the linux partition
Command (? for help): d
Partition number: 4

See results - partition 4 is now just free space

Command (? for help): p
Partition map (with 512 byte blocks) on '/dev/hda'
#:                type name                     length   base     ( size )
1: Apple_partition_map 'Apple               '       63 @ 1
2:          Apple_Free '                    '   262144 @ 64       (128.0M)
3:           Apple_HFS 'Apple_HFS_Untitled_3' 83623936 @ 262208   ( 39.9G)
4:          Apple_Free '                    ' 30660096 @ 83886144 ( 15.4G)

Create Apple Bootstrap partition for the boot loader:

Command (? for help): C
First Block: 4p # number of the free partition
Length in blocks: 32m
Name of partition: boot
Type of partition: Apple_HFS

Create swap partition:

Command (? for help): C
First Block: 5p # number of the free partition
Length in blocks: 1300m # or any other size in MB (m) or GB (g) you want
Name of partition: swap
Type of partition: Linux

Create the root partition for your Linux installation:

Command (? for help): C
First Block: 6p # number of the free partition
Length in blocks: 15g
Name of partition: root
Type of partition: Linux

lets see the result:

Command (? for help): p
Partition map (with 512 byte blocks) on '/dev/hda'
#:                type name                     length   base     ( size )
1: Apple_partition_map 'Apple               '       63 @ 1
2:          Apple_Free '                    '   262144 @ 64       (128.0M)
3:           Apple_HFS 'Apple_HFS_Untitled_3' 83623936 @ 262208   ( 39.9G)
4:           Apple_HFS 'boot                '    65536 @ 83886144 ( 32.0M)
5:               Linux 'swap                '  2662400 @ 83951680 (  1.3G)
6:               Linux 'root                ' 30660096 @ 86614080 ( 14.6G)

If you're happy with the result write the partition table:

Command (? for help): w

To quit pdisk type 'q' and then leave the shell by typing 'exit'.

Once you exited the shell, YaST will start up. Follow the instructions on the screen until you reach the partitioning stage.

In this stage it is very important not to allow YaST to suggest a partitioning scheme or indeed alter the partitioning table. All we let YaST do for us is format our newly created partitions (excluding the boot partition) and mount them.

Select:

'Partitioning'
 -> 'Create Custom Partition Setup'
    -> 'Custom Partitioning (for experts)'

Select your boot partition -> edit -> Choose to format as Apple_HFS and make sure there is no mount point assigned to this partition

Select your swap partition -> edit -> Choose to format as Swap and set the mount point to Swap

Select your root partition -> edit -> Format as Reiser or EXT3 (what ever you think suits you most) Set mount point to '/'

[ in my experience (with early new-world P3 iMac), yaboot was not able to read kernel from Reiser.

Save yourself grief, use ext2 or 3, or make a ext2 /boot partition! --Ddelv 02:59, 3 October 2006 (UTC) ]

Continue installation as usual.

Bootloader setup

During setup, YaST will try to set up a bootloader configuration. It will look for Apple_HFS partitions with size less than 128MB. If it finds one one the same drive as the current to be created Linux root partition, it will be used as boot partition. Double check the bootloader settings in the 'Expert settings' tab, especially the bootloader location.

Myth #1: The Apple_Bootstrap partition

MacOS uses the HFS filesystem. This filesystem has one feature: One directory/folder can be blessed (marked as bootable). The firmware will load files from this directory when it is referenced with a double backslash in the Open Firmware boot path, instead of its full path. From the MacOS perspective, a bootable folder has a few more requirements. It must contain at least the System and the Finder files, with valid type/creator properties. Furthermore, the System file must contain a few special resources in its resource fork. Unfortunately, the full list of these requirements is not publically available. A good compromise are the System and Finder files found in the miboot part of the BootX distribution. It contains a faked System file, fully opensource in its executable parts. If these 2 files are placed in a blessed folder, all MacOS versions accept this folder as bootable and leave the blessed flag alone. Too bad, the type/create flags in the BootX distribution are not correct, they have to be adjusted manually.

If a blessed folder is empty, or if its content doesnt meet the criteria from MacOS, the blessed flag will be removed by MacOS. This happens even if the firmware would be happy with the files in there.

The toolchain to create the System and the Finder file is the Metrowerks CodeWarrior, CW4 for MacOS. All parts of miboot are open source, but thats appearently still not good enough for some folks.

As a result, a new partition type was invented: Apple_Bootstrap. MacOS will only mount partitions with a known type, such as Apple_HFS, Apple_UFS and likely others. Everything else will be ignored. The OpenFirmware will only load from partition types that start with Apple_HFS or Apple_Boot.

SuSE Linux uses lilo to copy yaboot and related files over to the HFS boot partition. It will always copy the System and Finder files and give them the correct type/creator pair:

   hmount /dev/partition
   hmkdir suseboot
   hattrib -b suseboot
   hcd suseboot
   hcopy $TEMP/os-chooser :os-chooser
   hcopy $TEMP/yaboot.conf :yaboot.conf
   hcopy /lib/lilo/pmac/yaboot :yaboot
   hcopy /lib/lilo/pmac/Finder.bin :Finder
   hcopy /lib/lilo/pmac/System.bin :System
   hattrib -t tbxi -c chrp os-chooser
   hattrib -t FNDR -c MACS Finder
   hattrib -t zsys -c MACS System
   hattrib -t TEXT -c "R*ch" yaboot.conf
   hattrib -t BINA -c UNIX yaboot
   humount

Conclusion: There is no need to create a partition of type Apple_Bootstrap. Create Apple_HFS partitions. This will allow you to see and modify these volumes also from within MacOS.

Myth #2: The location of the boot partition

All Macs have a built-in graphical boot partition selector: hold down the Alt key during startup. The OpenFirmware will scan all attached drives for bootable HFS partitions and offer them as buttons. Only the older B&W G3 Macs may not have this feature, perhaps a firmware update will fix this.

Since there is always a way to select the small HFS boot partition with yaboot, the location of this partition does not matter.

Conclusion: The location of the HFS boot partition does not matter on recent Macs (recent == iBook1 and newer).

How to layout the partitions on an IBM pSeries or RS/6000 system

All supported IBM systems use the msdos partition label. YaST will be able to create and modify them as desired.

A quick way to get the system installed

A simple way to install is the 'use whole disk' checkbox in the YaST expert partitioner:

Partitioner
  -> Create custom partitions
    -> Select one of the offered drives, then <Next>
      -> Click on Delete all partitions, then <Next>

This will create a partition layout that works, it is the most tested install method.

Create a custom partition layout

To boot such a system from disk, a primary partition for the bootloader is a hard requirement. This boot partition must be either a 0x41 PReP Boot Partition or 0x06 FAT.

when to use a 0x41 PReP Boot Partition
  • if the root filesystem with the kernel and the yaboot.conf is readable by yaboot. This is the case for ext2, ext3 and reiserfs filesystems.
when to use a 0x06 FAT partition
  • if the root filesystem with the kernel and the yaboot.conf is on a filesystem not readable by yaboot. This is the case for root on LVM, software raid and JFS.

In any case, ALWAYS create a 16MB 0x41 PReP Boot Partition in YaST. This partition will be converted to the correct type for you, there is some magic going on behind the scenes.

Older versions of yaboot can not read from extended/logical partitions, also the XFS support was broken and there were lots of other bugs. All these bugs have been fixed for SuSE Linux 10.1 and SLES10.


back to main