.\"	$NetBSD: prep,v 2009/04/25 23:16:34 snj Exp $
No matter which installation method you use, there is some planning
and preparation that is required beforehand.  First and foremost,
before beginning the installation process, make sure you have a
reliable backup of any data on your hard disk that you wish to keep.
.Em "Mistakes in partitioning your hard disk may lead to data loss."
uses the same disk mapping scheme as Mac OS: the Apple Disk Partition Map.
This permits both systems to reside on the same disk, but introduces some
installation problems unique to the Macintosh. There are very few, if any,
reliable ways to reduce the size of an existing Mac OS disk partition, so
partitioning a disk that currently contains Mac OS will almost always
require a backup and reload step under Mac OS.
If you are using the
.Ic sysinst
method of installation you will be able to
do most, if not all, of your disk partitioning during the install
process.  Partitioning the disk with
.Ic sysinst
will destroy any partition
that is resized, deleted, converted, or designated for use by NetBSD.
All space not planned to be used for Mac OS HFS partitions may be used
by NetBSD and can be sub-divided by the
.Ic sysinst
process.  This space
may be defined within one or more existing disk partitions of any type,
including HFS partitions that are no longer needed for Mac OS. However
it is best if this space is physically contiguous on the disk as
.Ic sysinst
is not capable of merging non-contiguous disk partitions.  If you are
using the
.Ic sysinst
method and have sufficient disk space in one or more
disk partitions you should skip forward to the section labeled
.Sx Installing\ the\ NetBSD\ System\ (Sysinst\ Method)
in this document.
If you are using the Traditional method of installation you must use a
disk partitioning utility to designate the different partitions you
will want in your final
configuration.  It is not necessary to create
(or AU/X) type partitions at this stage; the Mkfs utility
can convert a partition of any type to one usable for
.Nx .
If disk partitioning is required because you've selected the Traditional
method of installation, or because disk space needs to be freed up for
use for the
.Ic sysinst
method of installation, follow the directions in the remainder of this section.
Find your favorite disk partitioning utility. Any formatter capable of
partitioning a SCSI disk should work. Some of the ones that have been
tried and seem to work are:
.(bullet -compact -offset indent
Apple HD SC Setup
Hard Disk ToolKit from FWB
SCSI Director Lite
Disk Manager Mac from OnTrack
Silverlining from LaCie
APS Disk Tools
Apple's HD SC Setup is probably the easiest to use and the most commonly
available. Instructions for patching HD SC Setup so that it will recognize
non-Apple drives is available at:
First, you need to choose a drive on which to install
.Nx .
Try to pick a
drive with a low SCSI target number (or "SCSI ID"), especially if you are
likely to add or
remove drives to your SCSI chain in the future.
Be certain you have a reliable backup of any data that you may want to keep.
Repartitioning your hard drive is an excellent way to destroy important data.
Second, decide how you want to set up your partitions. At minimum, you
need a partition to hold the
installation (the root partition \(em 
.Pa / )
and a
partition to serve as swap space. You may choose to use more than one partition
to hold the installation. This allows you to separate the more vital
portions of the file system (such as the kernel and the
.Pa /etc
directory) from the more volatile parts of the file system.
Typical setups place the
.Pa /usr
directory on a separate partition from the root partition
.Pq Pa / .
.Pa /
can be fairly small while the
.Pa /usr
partition should be fairly large.
If you plan to use this machine as a server, you may also want a separate
.Pa /var
Once you have decided how to lay out your partitions, you need to calculate
how much space to allocate to each partition. A minimal install of
.Pa base.tgz , etc.tgz, No and either
.Pa kern-GENERIC.tgz No or
.Pa kern-GENERICSBC.tgz )
requires about 100MB.
A general rule of thumb for sizing the swap partition is to allocate
twice as much swap space as you have real memory.
Having your swap + real memory total at least 20 MB is also a good idea.
Systems that will be heavily used or that are low on real memory should
have more swap space allocated. Systems that will be only lightly used
or have a very large amount of real memory can get away with less.
Keep in mind that
currently requires
.Tn Mac OS
in order to boot, so it is likely that you will
want to keep at least a minimal install of
.Tn Mac OS
around on an HFS
partition for this purpose.  The size of this partition may vary depending
on the size requirements for the version of
.Tn Mac OS
you are using.  Of
course, if you have
.Tn Mac OS
on another hard drive or can boot from a floppy,
feel free to dedicate the entire drive to
.Nx .
Next, use your favorite partitioning utility to make partitions of the
necessary sizes. You can use any type of partition, but partitions of type
.Li "Apple_Free"
might save you some confusion in the future.
You are now set to install
on your hard drive.