Booting on x86

Finlay Dobbie

Revision History
Revision 32 October 2004fd - [email protected]
Completely rewritten to reflect the current state of affairs, based on directions supplied by Brian Bechtel.
Revision 28 October 2001rjh - [email protected]
Changed title to "Darwin Committer" and cleaned up some formatting.
Revision 110 August 2001rb - [email protected]
Created.

Abstract

The term "partition" is used throughout this document in preference of "slice". For example, /dev/disk0s1 is the first partition of the device /dev/disk0.


Table of Contents

Partitioning
Editing the partition map
Formatting partitions
Booting
Troubleshooting
Copyright

Partitioning

The standard x86 partition scheme uses an array of four partitions, each of which could potentially be an extended partition pointer to another array.

Two basic supported partition types in Darwin, HFS+ and UFS (the Apple Booter partition type is no longer used). While HFS+ is currently the recommended and default choice for Mac OS X and Darwin systems on PPC, it is currently required that you use UFS for your x86 Darwin root partition.

Editing the partition map

By default, the Darwin installer will create a single UFS partition containing your entire disk. If you want to sub-divide your disk into more than the one partition, you need to use the fdisk command. Darwin's fdisk behaves much like the similarly named command on other operating systems. It is recommended that you read its manual page for more information.

Here is an example of a hard disk partitioned for booting Darwin plus an additional HFS+ partition for other data:

# fdisk /dev/rdisk0
Disk: /dev/rdisk0       geometry: 1836/255/63 [29498112 sectors]
Signature: 0xAA55
                 Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
*1: A8    0   1   1 -  933 181  15 [        63 -   15000000] Darwin UFS  
 2: AF  933 181  16 - 1023  43  63 [  15000063 -   14498049] HFS+        
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused 

Note that in this example, there are two unused partitions. The first partition, called /dev/disk0s1, is a UFS partition and has been flagged as "active" - it is the default partition for booting.

The second partition is a HFS+ partition, which could be used to hold sources and other files which you don't want to lose when you reinstall Darwin.

If this machine had a Windows partition, it would have a partition ID of either 07 (NTFS) or 0C (FAT32L) or possibly some other partition IDs, depending upon how the drive was initialized. If the machine had Linux partitions you would see partition IDs of 82 (swap) and 83 (one or more linux data).

Formatting partitions

Format partitions with newfs (UFS), newfs_hfs (HFS, HFS+ and HFSX), or newfs_msdos (FAT32). You must be root to format a partition. See the man pages for additional arguments you can pass to these commands.