Markus
Schatzl
Written by
Justin
Sherrill
Marked up by
Installation from CD
CD Installation Overview
This document describes the installation of DragonFly BSD on a plain i386
machine. This process uses a bootable DragonFly CD, usually referred to as a
'live CD'.
This CD is available at one of the current mirrors, which distribute the images
by various protocols. The authorative list can be found at the
DragonFly website.
The DragonFly development team is working on an automatic installation
tool, which simplifies the partitioning and installation processes. Until this
tool is in place, the manual process here is required. Some experience with
BSD-style tools is recommended.
While this guide covers installing to
a computer with an existing non-DragonFly operating system, take no chances! Back up
any data on your disk drives that you want to save.
When installing to an old machine, it may not be possible to boot from
a CD. Use a bootmanager on a floppy in those cases, such as
Smart Bootmanager.
CD Installation - Making room
DragonFly as the only operating system
If DragonFly is to be the only operating system on the target computer, preparing
the disk is a short and simple process. Boot with the live CD, and log in as root
to reach a command prompt.
First, the master boot record (MBR) must be cleared of any old information. This
command clears all old data off your disk by writing zeros (if=/dev/zero) onto the
system's master ata drive (of=/dev/ad0).
&prompt.root; dd if=/dev/zero of=/dev/ad0 bs=32k count=16
The now-empty disk must be formatted. While the following two commands can be issued
as one,
&prompt.root; fdisk -I ad0
&prompt.root; fdisk -B ad0
Multiple operating systems on one hard disk
This example assumes that the target computer for installation has at least
one operating system installed that needs to survive the installation process.
A new partition for DragonFly needs to be created from the existing
partition(s) that otherwise fill the disk. There must be unused space within
the existing partition in order to resize it.
The new partition is created from empty space in an existing partition.
For example, an 18 gigabyte disk that has 17 gigabytes of existing data in the existing
partition will only have 1 gigabyte available for the new partition.
Partition resizing needs to be accomplished with a third-party tool. Commercial
programs such as Partition Magic
can accomplish these tasks. Free tools exist that can be adapted to this task, such as
'GNU parted', found on the
Knoppix CD,
or PAUD.
Create a new partition of at least 5-6 gigabytes. It is possible to
install within a smaller amount of disk space, but this will create some
problems that this document does not cover. The newly created partition
does not need to be formatted; the rest of the
installation process treats that new partiton as a new disk.
Multiple operating systems, multiple hard disks
Installing DragonFly to a separate disk removes the need
for partition resizing, and is generally safer when trying to preserve
an existing operating system installation.
This type of installation is very similar to installing DragonFly
as the only operating system. The only difference is the disk named
in each command.
Always be sure of the target disk for any command.
CD Installation - Disk setup
Disk formatting
The newly created partition, whether part of an existing disk or on a
completely new drive, needs to be formatted. The following command can
interactively format your disk.
&prompt.root; fdisk -u
If there are multiple operating systems on the disk, pick the correct
partition judging by what partitions were created earlier with a resizing tool.
Boot block installation
The 'ad0' here refers to the first disk on the first IDE bus of a computer.
Increment the number if the target disk is farther down the chain. For example,
the master disk on the second IDE controller would be 'ad2'.
&prompt.root; boot0cfg -B ad0
&prompt.root; boot0cfg -v ad0
-s SLICE, where SLICE is a number, controls which
slice on disk is used by boot0cfg to start from. By default, this number is 1, and
will only need modification if a different slice contains DragonFly.
Disklabel
If DragonFly is installed anywhere but the first partition of the disk,
the device entry for that partition will have to be created. Otherwise, the
device entry is automatically created. Refer to this different partition
instead of the 'ad0s1a' used in later examples.
&prompt.root; cd /dev; ./MAKEDEV ad0s2
The partition needs to be created on the DragonFly disk.
&prompt.root; disklabel -B -r -w ad0s1 auto
Using /etc/disklabel.ad0s1 as an example, issue the following command to
edit the disklabel for the just-created partition.
&prompt.root; disklabel -e ad0s1
Partition
Size
Mountpoint
ad0s2a
256m
/
ad0s2b
1024m
swap
ad0s2c
leave alone
This represents the whole slice.
ad0s2d
256m
/var
ad0s2e
256m
/tmp !
ad0s2f
8192m
/usr - This should be at least 4096m
ad0s2g
*
/home - This holds 'everything else'
Partition Format
newfs will format each individual partition.
&prompt.root; newfs /dev/ad0s1a
&prompt.root; newfs -U /dev/ad0s1d
&prompt.root; newfs -U /dev/ad0s1e
&prompt.root; newfs -U /dev/ad0s1f
&prompt.root; newfs -U /dev/ad0s1g
The root partition does not need softupdates; the
-U option is not used.
The command listing skips directly from ad0s1a to ad0s1d. This is
because /dev/ad0s1b is used as swap and does not require formatting;
ad0s1c refers to the entire disk and does not need to be formatted.