.\" This file is in -*- nroff-fill -*- mode .\" STATUS: 2nd edition .\" $Id: install.mm,v 2.5 1997/12/15 08:43:39 grog Exp $ .\" $Log: install.mm,v $ .\" Revision 2.5 1997/12/15 08:43:39 grog .\" Minor nits .\" .\" Revision 2.4 1997/12/13 10:21:42 grog .\" Last-minute cosmetics .\" .\" Revision 2.3 1997/12/11 08:06:56 grog .\" Adjust indentation .\" .\" Revision 1.54 1997/11/29 06:26:42 grog .\" Cosmetic mods .\" .\" Revision 1.53 1997/11/29 02:36:50 grog .\" First complete release version of second edition .\" .\" Revision 1.52 1997/11/28 07:57:34 grog .\" Minor cosmetics .\" .\" Revision 1.51 1997/11/26 08:00:41 grog .\" Minor mods .\" .\" Revision 1.50 1997/11/24 07:07:49 grog .\" Checkin 24 November, first stab at release version .\" .\" Revision 1.49 1997/11/06 03:47:00 grog .\" Checkin 6 November 1997 .\" .\" Revision 1.48 1997/11/05 03:16:54 grog .\" Checkin 5 November .\" .\" Revision 1.47 1997/11/04 07:50:34 grog .\" Checkin 4 November 1997 .\" .\" Revision 1.46 1997/11/03 02:45:12 grog .\" Checkin 3 November 1997 .\" .\" Revision 1.45 1997/11/01 08:14:08 grog .\" Checkin 1 November .\" .\" Revision 1.44 1997/10/25 08:13:54 grog .\" Checkin 25 October .\" .\" Revision 1.43 1997/10/12 01:38:44 grog .\" Checkin 13 October .\" .\" Revision 1.42 1997/10/09 06:15:14 grog .\" Checkin 9 October .\" .\" Revision 1.41 1997/10/05 03:40:11 grog .\" Checkopint 6 October .\" .\" Revision 1.39 1997/09/15 01:37:41 grog .\" Checkpoint 16 September .\" .\" Revision 1.37 1997/09/09 01:19:31 grog .\" Checkin 9 September .\" .\" Revision 1.36 1996/11/04 12:28:24 grog .\" Checkpoint 12 November .\" .\" Revision 1.35 1996/07/17 07:25:26 grog .\" Minor mods--maybe this time it will get printed .\" .Chapter \*[nchinstall] "Installing FreeBSD"

.Pn install-start So now you're ready to install FreeBSD on your system. In this chapter, we'll look at how to install FreeBSD on a disk by itself. If you run into trouble, I'll refer you back to the page of Chapter \*[nchconcepts] which discusses this topic. If you want to install FreeBSD on the same disk as another operating system, such as MS-DOS, move on to \*[chshareinstall]. .H2 "Preparing the data for installation"

.Pn sw-prepare To install FreeBSD you need the software in a form which the installation software understands. You may also need a boot diskette. The choices you have are, in order of decreasing attractiveness: .Ls B .LI .X "El Torito" CD-ROM. This is by far the easiest way to install FreeBSD. If your system BIOS supports the El Torito CD-ROM boot standard, or you have a running MS-DOS system on the system on which you want to install FreeBSD, you may not even need a boot diskette. .LI Over the network. You have the choice of ftp or NFS connection. ..if long If you're connected to the Internet and you're not in a hurry, you can load directly from one of the distribution sites described in the FreeBSD handbook. ..endif .LI From a locally mounted disk partition, either FreeBSD (if you have already installed it) or MS-DOS. .LI From tape in tar format. This is slower than CD-ROM, and it requires more space, but once you have the tape, it's just as simple. .LI From floppy disk. This is only for masochists or people who really have almost no hardware: depending on the extent of the installation, you will need up to 200 disks, and at least one of them is bound to have an I/O error. .Le .H3 "Preparing a boot floppy"

.Pn make-floppy .X "boot floppy, preparing" .X "floppies/boot.flp" .X "boot disk" For most kinds of installation, you need a single floppy disk, called the Boot Disk, to boot the installation programs. The same image works both on a 5\(14" floppy and a 3\(12" floppy. You can find it in the CD-ROM distribution in the file floppies/boot.flp. If you have your CD-ROM mounted on a MS-DOS system, it will be called FLOPPIES\eBOOT.FLP. The bootstrap does not recover bad blocks, so the floppy must be 100% readable.

.P The way you get the boot disk image onto a real floppy depends on the operating system you use. If you are using any flavour of UNIX, just perform something like
.Dx $ dd if=/cdrom/floppies/boot.flp of=/dev/rfd0c bs=36b .De .X "rfd0c, device" .X "device, rfd0c" This assumes that your software is on CD-ROM, and that it is mounted on the directory /cdrom. It also assumes that your floppy drive is called /dev/rfd0c (this is the FreeBSD name, which is also used by other BSD systems\(emsee page .Sref \*[disk-partitions] \& for an overview). If you're using Linux, the device name would be /dev/fd0 or /dev/fd1.

.P Some versions of UNIX, particularly older System V variants, may complain about the option bs=36b. If this happens, just leave it out. It might take up to 10 minutes to write the floppy, but it will work, and it will make you appreciate FreeBSD all the more.

.P .X "VIEW.EXE, MS-DOS command" .X "MS-DOS command, VIEW.EXE"

.Pn VIEW If you have to create the boot floppy from MS-DOS, you have three choices. You can use VIEW.EXE, a self-documenting menu-driven utility which is located in the root directory of the CD-ROM, to perform all preparation necessary from MS-DOS:
.Dx C:> R: the drive letter of the CD-ROM R:> VIEW .De In addition, the CD-ROM distribution includes a program TOOLS\eRAWRITE.EXE which will copy to floppy. Since the boot floppy image is on FLOPPIES\eBOOT.FLP, you enter:
.Dx C:> R: the drive letter of the CD-ROM R:> TOOLS\eRAWRITE FLOPPIES\eBOOT.FLP .De .X "MAKEFLP.BAT, MS-DOS command" .X "MS-DOS command, MAKEFLP.BAT" .X "floppies/boot.flp" This requires just a little more typing, but that's all there is to it. Another alternative is to use the program MAKEFLP.BAT supplied with the distribution. This batch file assumes that it is in the parent directory of TOOLS and FLOPPIES (in our example, the root directory of drive R:). It also formats the floppy before copying the boot disk to it. .H3 "Creating floppies for a floppy installation"

.Pn create-floppies Installation from floppy disk is definitely the worst choice you have. You will need 14 floppies for the minimum installation, and up to 200 for the complete installation. The chance of one of them being bad is high. Most problems on a floppy install can be traced to bad media, so: .Highlight .ce Format all floppies before starting. .End-highlight Some people claim that this is even a good idea for factory pre-formatted floppies: one of the major causes of lost data are differences of alignment between floppy disk drives.

.P .X "floppies/boot.flp" .X "RAWRITE.EXE, MS-DOS command" .X "dd command" .X "command, dd" The first floppy you'll need is floppies/boot.flp, a gziped cpio file. If you're using MS-DOS to create the floppies, use RAWRITE.EXE. If you are preparing the floppies with UNIX, use dd. Once this floppy is made, go on to make the distribution set floppies.

.P You will need, at minimum, as many floppies as it takes to hold all files in the bin directory, which contains the binary distribution. The distribution files are split into chunks conveniently sized so that 5 of them will fit on a conventional 1.2 MB floppy, and 6 will fit on a 1.44 MB floppy (with a little space left over). For example, the files in the bin distribution are:
.Dx $ ls CHECKSUM.MD5 bin.ao bin.be bin.bu bin.ck TRANS.TBL bin.ap bin.bf bin.bv bin.cl bin.aa bin.aq bin.bg bin.bw bin.cm bin.ab bin.ar bin.bh bin.bx bin.cn bin.ac bin.as bin.bi bin.by bin.co bin.ad bin.at bin.bj bin.bz bin.cp bin.ae bin.au bin.bk bin.ca bin.cq bin.af bin.av bin.bl bin.cb bin.cr bin.ag bin.aw bin.bm bin.cc bin.cs bin.ah bin.ax bin.bn bin.cd bin.ct bin.ai bin.ay bin.bo bin.ce bin.inf bin.aj bin.az bin.bp bin.cf bin.mtree bin.ak bin.ba bin.bq bin.cg install.sh bin.al bin.bb bin.br bin.ch bin.am bin.bc bin.bs bin.ci bin.an bin.bd bin.bt bin.cj .De The important files are the ones whose names start with bin. followed by two letters. They are all 240640 bytes long, except for the final one which is usually shorter. Copy them in alphabetical order, five or six to a floppy, using the MS-DOS COPY program, until you've got all the distributions you want packed up in this fashion. Copy each distribution into a subdirectory on the floppy, for example A:\eBIN\eBIN.AA, A:\eBIN\eBIN.AB and so on. .H3 "Installing via FTP" .X "installing, from Internet"

.Pn ftp-install The fun way to install FreeBSD is via the Internet, but it's not always the best choice. There's a lot of data to transfer, and unless you have a really high-speed, non-overloaded connection to the server, it could take forever. On the other hand, of course, if you have your own private server (like another UNIX machine with the sources on it), and the system on which you want to install FreeBSD doesn't have a CD-ROM drive, these conditions are fulfilled, and this could be for you. Before you decide, though, read about the alternative of NFS installation below: if you don't have an FTP server with the files already installed, it's a lot easier to set up an NFS installation.

.P There are two FTP installation modes you can use: .Ls B .LI Regular FTP mode does not work through most firewalls but will often work best with older ftp servers that do not support passive mode. Use this mode if your connection hangs with passive mode. .LI .X "FTP, passive" If you need to pass through firewalls that do not allow incoming connections, try passive FTP. .Le Whichever mode of installation and whichever remote machine you choose, you need to have access to the remote machine. The easiest and most common way to ensure access is to use anonymous FTP. If you're installing from another FreeBSD machine, read how to install anonymous FTP in \*[chbasics], page .Sref \*[anonymous-ftp] . This information is also generally correct for other UNIX systems. .H4 "Setting up the ftp server" .X "\*[Fver]-RELEASE" .X "/usr/ftp" To set up the ftp server, the system from which you load the software, you must load the software into the public FTP directory. On BSD systems, this will be the home directory of user ftp, which in FreeBSD defaults to /usr/ftp. The name of the directory is the name of the release, which in this example we'll assume to be \*[Fver]-RELEASE. .\" .ad l .\" .nh You can put this directory in a subdirectory of /usr/ftp, for example /usr/ftp/FreeBSD/\*[Fver]-RELEASE, .\" .hy .\" .ad but the only optional part in this example is the parent directory FreeBSD.

.P This directory has a slightly different structure from the CD-ROM distribution. To set it up, assuming you have your distribution CD-ROM mounted on /cdrom, and that you are installing in the directory /usr/ftp/FreeBSD/\*[Fver]-RELEASE, perform the following steps:
.Dx # cd /usr/ftp/FreeBSD/\*[Fver]-RELEASE # mkdir floppies # cd floppies # cp /cdrom/floppies/* . don't omit the . at the end # cd /cdrom the distribution directory on CD-ROM # tar cf - [b-d]* g* man* po* pr* [s-z]* | (cd /usr/ftp/FreeBSD/\*[Fver]-RELEASE; tar xvf -) .De This copies all the directories of /cdrom into /usr/ftp/FreeBSD/\*[Fver]-RELEASE except for packages, a total of about 180 MB. If you have enough space for the packages file as well (about 500 MB more), you can simplify the last line to:
.Dx # tar cf - . | (cd /usr/ftp/FreeBSD/\*[Fver]-RELEASE; tar xvf -)
.De For a minimal installation, you need only the directory bin, about 16 MB. To just install bin rather than all of the distribution, change the last line of the example above to
.Dx # mkdir bin
# cp /cdrom/bin/* bin .De ..if itworks

.P If you're installing from a CD-ROM across the net, for example because the system you're installing to doesn't have a CD-ROM drive, and the system with the CD-ROM drive is running FreeBSD, you can modify the home directory of the user ftp to point to the CD-ROM:
.Dx ftp:*:14:5:Anonymous FTP Admin:/cdrom:/bin/date .De ..endif .H3 "Installing via NFS"

.Pn nfs-install-setup If you're installing from a CD-ROM drive on another system in the local network, you will probably find an installation via FTP too complicated for your liking. Installation is a lot easier if the other system supports NFS. Before you start, make sure you have the CD-ROM mounted on the remote machine, and that the remote machine is exporting the file system (in System V terminology, exporting is called sharing). When prompted for the name of the directory, specify the name of the directory on which the CD-ROM is mounted. For example, if the CD-ROM is mounted on directory /cdrom on the system presto.example.org, enter presto.example.org:/cdrom. That's all there is to it! .Aside Older versions of FreeBSD stored the distribution on a subdirectory dists. Newer versions store it in the root directory of the CD-ROM. .End-aside .H3 "Installing from a MS-DOS partition" It's also possible to install from a primary MS-DOS partition on the first disk. At the moment, it's not possible to install from extended partitions. To prepare for installation from an MS-DOS partition, copy the files from the distribution into a directory called \eFREEBSD. For example, to do a minimal installation of FreeBSD from MS-DOS using files copied from a CD-ROM mounted on R:, you might do something like this:
.Dx C> MKDIR C:\eFREEBSD C> XCOPY /S R:\eBIN C:\eFREEBSD\eBIN C> XCOPY /S R:\eFLOPPIES C:\eFREEBSD\eFLOPPIES .De .X "sysinstall command" .X "command, sysinstall" .X "boot.flp" You need the directory FLOPPIES because that's where sysinstall looks for the boot.flp, the first image in every installation.

.P .X "The bin directory" The only required directory is bin. You can include as many other directories as you want, but be sure to maintain the directory structure. In other words, if you also wanted to install XF86312 and manpages, you would copy them to C:\eFREEBSD\eXF86312 and C:\eFREEBSD\eMANPAGES. .H3 "Installing from tape" .X "installing, from tape"

.Pn tape-install If you're installing from tape, you need a tape written in tar format with a block size of 5120 bytes (10 sectors). Don't use tar's default value of 10240 bytes or 20 sectors. Since the install program reads the entire tape onto disk, you will need a \fBbig disk. As a further restriction, you can install only from the first tape unit in the system. .H3 "Installing from a FreeBSD partition" .X "installing, from disk partition"

.Pn unix-partition-install If you already have a copy of the FreeBSD distribution on the disk on which you are installing, you can use this option. Unfortunately, it doesn't work if the partition is on another disk. We're still working on this one\(emconsider it an experimental option. .H2 "Booting the install kernel" No matter which installation medium you choose, the first step in installing FreeBSD is to start a minimal version of the operating system. The simplest way is to boot directly from the installation CD-ROM, if your system BIOS supports it. If your system doesn't support this kind of boot, you have the choice of booting directly from CD-ROM floppy or from a running MS-DOS system.

.P In the following sections, we'll look at a real-life installation on a real machine. When you install FreeBSD on your machine, a number of things will be different, depending on the hardware you're running and the way you're installing the software. Nevertheless, you should be able to recognize what it going on. .H3 "Booting from CD-ROM" Booting from CD-ROM is mainly a matter of setting up your system BIOS and possibly your SCSI BIOS, Typically, you perform one of the following procedures: .Ls B .LI If you're booting from an IDE CD-ROM, you enter your system BIOS setup routines and set the Boot sequence parameter to select CD-ROM booting ahead of hard disk booting, and possibly also ahead of floppy disk booting. A typical sequence might be CDROM,C,A. .LI On most machines, if you're booting from a SCSI CD-ROM, you also need a host adapter which supports CD-ROM boot. Set up the system BIOS to boot in the sequence, say, SCSI,A,C. On typical host adapters (such as the Adaptec 2940 series), you set the adapter to enable CD-ROM booting, and set the ID of the boot device to the ID of the CD-ROM drive. .Le Note that these settings are probably not what you want to use for normal operation. If you leave the settings like this, and there is a bootable CD-ROM in your CD-ROM drive, it always boots from that CD-ROM rather than from the hard disk. After installation, change the parameters back again to boot from hard disk before CD-ROM. See your system documentation for further details. .H3 "Booting from floppy" .X "booting, from floppy"

.Pn floppy-boot If you are installing from tape or CD-ROM, put the medium in the drive before booting. The installation may fail if you boot before inserting the medium.

.P .X "/dev/rfd0" .X "A: drive" Boot the system in the normal manner: insert the boot diskette in /dev/rfd0, the first floppy drive (A: in MS-DOS parlance), and reset the computer or turn power on. After the PC has gone through its hardware tests, it will boot the FreeBSD install kernel from the floppy. .H3 "Installing from a running MS-DOS system If the disk on which you plan to install FreeBSD contains MS-DOS, and you're installing from CD-ROM, you can usually boot directly from MS-DOS. This will work whether you plan to overwrite the MS-DOS partition, or whether you plan to install to another slice or another disk on the same system. To boot this way, change to the CD-ROM volume (R: in this example) and start INSTALL or VIEW:
.Dx C> R: change to CD-ROM R> cd \e make sure you're in the root directory R> install and start the INSTALL program .De Don't try this from MS Windows\(emthe installation will fail with the message not enough memory. The boot will progress in the same way as if you had booted from floppy. The advantage of starting VIEW is that you get more documentation: ultimately VIEW will start INSTALL to boot the system.

.P INSTALL doesn't always work. It depends on what drivers or TSRs are in your system. There's no reason to try changing your MS-DOS configuration to get it to work: it's a lot easier just to boot from floppy. See page .Sref \*[make-floppy] \& for further information. .H3 "Boot messages"

.Pn boot-msg-start Once the bootstrap loader has been loaded, you will see something like:
.Dx >> FreeBSD BOOT @ 0x10000: 640/15360 k of memory, internal console Boot default: 0:fd(0,a)kernel Usage: bios_drive:interface(unit,partition)kernel_name options bios_drive 0, 1, ... interface fd, wd or sd unit 0, 1, ... partition a, c, ... kernel_name name of kernel, or ? for list of files in root directory options -a (ask name) -C (cdrom) -c (userconfig) -D (dual consoles) -d (debug early) -g (gdb) -h (serial console) -P (probe kbd) -r (default root) -s (single user) -v (verbose) Examples: 1:sd(0,a)mykernel boot `mykernel' on the first SCSI drive when one IDE drive is present 1:wd(2,a) boot from the second (secondary master) IDE drive 1:sd(0,a)? list the files in the root directory on the specified drive/unit/partition, and set the default bios_drive, interface, unit and partition -cv boot with the defaults, then run UserConfig to modify hardware parameters (c), and print verbose messages (v) boot: .De .X "fd(0,a)/kernel" Pressing ENTER does not list the defaults: it continues by booting the default kernel fd(0,a)/kernel. The bootstrap will also automatically continue with the default boot sequence if you leave this prompt alone for about 10 seconds:
.Dx Booting fd(0,a)/kernel @ 0x279000 text=0xf40000 / .De .X "baton, twirling" .X "twirling baton" If you're loading from floppy, the / character at the end of the previous line keeps changing through -, \e, and | before going back to / again, giving the impression that the character is rotating. This display, called a twirling baton, is your indication that the system hasn't crashed and burned. This doesn't happen if you're starting from MS-DOS.

.P After the kernel has been loaded, it will take control of the machine. You will see something like:
.Dx text=0xf40000 data=0x0 bss=0xa00 symbols=[+0x600+0x4+0x258+0x4+0x1d9] total=0x3f5439 entry point=0x300000 Uncompressing kernel...done Booting the kernel Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. FreeBSD 3.0 #0: Wed Jan 28 14:43:28 1998 jkh@westhill.cdrom.com:/usr/src/sys/compile/BOOTMFS .De The first two lines tell you how large the kernel is and where it is being loaded. Unless you run into problems, which are unlikely at this point, this information is of little interest. If you do have problems, the most important information is the date of compilation and the pathname of the kernel on the last two lines of this example. Please include this information if you report a problem. .H3 "UserConfig: Modifying the boot configuration"

.Pn modify-boot-config .X "UserConfig"

.Pn "UserConfig" After the kernel has been loaded, the following screen will appear:
.Dx Kernel configuration Menu Skip kernel configuration and continue with installation Start kernel configuration in full-screen visual mode Start kernel configuration in CLI mode Here you have the chance to go into kernel configuration mode, making any changes which may be necessary to properly adjust the kernel to match your hardware configuration. If you are installing FreeBSD for the first time, select Visual Mode (press Down-Arrow then ENTER). If you need to do more specialized kernel configuration and are an experienced FreeBSD user, select CLI mode. If you are \fBcertain that you do not need to configure your kernel then simply press ENTER or Q now. .De If your hardware configuration matches what the generic kernel expects (see page \*[supported-hardware]), just press \fBENTER. The kernel will continue with the device probes
, which we discuss on page \*[device-probe].

.P If you do need to change the configuration, press the downarrow key to choose the kernel configuration in full-screen mode, then press \fBENTER. This starts UserConfig, a part of the kernel which can be activated at boot time to change the system's idea of device configuration. It presents you with a full-screen menu:
.Dx ---Active Drivers----------------------------25 Conflicts------Dev---IRQ--Port-- Storage : (Collapsed) Network : (Collapsed) Communications : (Collapsed) Input : (Collapsed) Multimedia : Miscellaneous : ---Inactive Drivers--------------------------------------------Dev-------------- Storage : (Collapsed) Network : (Collapsed) Communications : (Collapsed) Input : (Collapsed) Multimedia : Miscellaneous : .De Note the word Conflicts at the top of the screen. This is a warning, not an error. We'll see on page \*[device-probe] that the drivers look for hardware in a number of configurations. Not all of these configurations can coexist, but there will not be a problem unless you install hardware that can't coexist.

.P The word (Collapsed) doesn't mean that your hardware has given up the ghost\(emit means that the information about the corresponding hardware, which is usually a large number of devices, has been omitted. You can display it by pressing \fBEnter on the appropriate line. A bar cursor stretches across the line Storage (Collapsed). You can move it up and down with the arrow keys. In our example, we have a NE2000 compatible Ethernet board, but its I/O registers start at address 0x320, and it is set up for IRQ 9, and we want to change the kernel configuration to recognize it. We move the bar down to the line Network and press \fBEnter. The display changes to:
.Dx ---Active Drivers----------------------------25 Conflicts------Dev---IRQ--Port-- Storage : (Collapsed) Network : NE1000,NE2000,3C503,WD/SMC80xx Ethernet adapters conf ed0 5 0x280 NE1000,NE2000,3C503,WD/SMC80xx Ethernet adapters conf ed1 5 0x300 3C509 Ethernet adapter conf ep0 10 0x300 Fujitsu MD86960A/MB869685A Ethernet adapters conf fe0 5 0x240 Intel EtherExpress Ethernet adapter conf ix0 10 0x300 DEC Etherworks 2 and 3 Ethernet adapters conf le0 5 0x300 ---Inactive Drivers--------------------------------------------Dev-------------- Storage : (Collapsed) Network : (Collapsed) Communications : (Collapsed) Input : (Collapsed) Multimedia : Miscellaneous : .De The highlighted conf means that the current configuration could conflict with another device: the I/O address, IRQ or memory address will also be probed by another driver. This is only a problem if you really have two boards with the same configuration; otherwise you can ignore this warning. In this case, by chance our Novell NE2000 board is already highlighted, so all we need to do is to press \fBEnter again to edit the configuration. The configuration is copied to individual fields at the bottom of the screen, so we now see:
.Dx ---Active Drivers----------------------------25 Conflicts------Dev---IRQ--Port-- Storage : (Collapsed) Network : NE1000,NE2000,3C503,WD/SMC80xx Ethernet adapters conf ed0 5 0x280 NE1000,NE2000,3C503,WD/SMC80xx Ethernet adapters conf ed1 5 0x300 3C509 Ethernet adapter conf ep0 10 0x300 Fujitsu MD86960A/MB869685A Ethernet adapters conf fe0 5 0x240 Intel EtherExpress Ethernet adapter conf ix0 10 0x300 DEC Etherworks 2 and 3 Ethernet adapters conf le0 5 0x300 ---Inactive Drivers--------------------------------------------Dev-------------- Storage : (Collapsed) Network : (Collapsed) Communications : (Collapsed) Input : (Collapsed) Multimedia : Miscellaneous : -------------------------------------------------------------------------------- Port address : 0x280 Memory address : 0xd8000 Conflict allowed IRQ number : 5 Flags : 0 -------------------------------------------------------------------------------- .De The port address is in reverse video, which means that we can edit it. We type in 0x320 and press \fBTab to get to the IRQ field, where we enter 9. Then we press \fBEnter to leave the edit mode, and q to leave the configuration editor. Booting continues as normal, but this time the system finds our Ethernet board.

.P This is only an example, of course. It's easier to play around with the editor than to describe it. Don't worry about damaging anything on disk, since at this point it's just you and the computer, and the computer doesn't yet know about any peripherals. .Highlight Due to the nature of PC hardware, IRQ 2 and IRQ 9 are the same thing. Never specify IRQ 2 to UserConfig: use IRQ 9 instead. If you use IRQ 2, the driver will not work correctly. .End-highlight .H3 "Starting UserConfig from hard disk" When you boot from hard disk, the selection menu does not appear, since this would be a nuisance: normally you will not want to change your configuration once it is installed. If you need to do so, however, make sure that UserConfig is included in your kernel (see \*[chbuild], page \*[config-USERCONFIG]). To activate UserConfig on boot, wait until you see:
.Dx >> FreeBSD BOOT @ 0x10000: 640/15360 k of memory Use hd(1,a)/kernel to boot sd0 when wd0 is also installed. Usage: [[fd(0,a)]/kernel][-abcCdgrsv] Use ? for file list or press Enter for defaults Boot: .De Normally, you just press \fBENTER, or wait a few seconds, and the bootstrap will continue. You have a number of options, however\(emsee the man page for boot (page .Sref \*[manpage-boot] ) for a complete discussion. To start UserConfig, enter:
.Dx Boot: -c Booting fd(0,a)/kernel @ 0x20e000 text=0xf40000 data=0x0 bss=0xa00 symbols=[+0x600+0x4+0x258+0x4+0x1d9] total=0x3f5439 entry point=0x300000 Uncompressing kernel...done Booting the kernel Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the Univesity of California. All rights reserved. FreeBSD \*[Fver] #0: Fri Jun 28 14:43:28 1996 jkh@westhill.cdrom.com:/usr/src/sys/compile/BOOTMFS CPU: i486DX (486-class CPU) real memory = 16777216 (16384K bytes) FreeBSD Kernel Configuration Utility - Version 1.0 Type "help" for help or "visual" to go to the visual configuration interface (requires MGA/VGA display or serial terminal capable of displaying ANSI graphics). config> v enter visual configuration .De You can type help for help, as the prompt suggests, but just about the only thing you need is the visual configuration interface. You don't really need to type visual: v is enough. .H3 "Probing the hardware" .X "probing"

.Pn device-probe When you continue from the UserConfig selection menu, an incredible amount of information will scroll off the screen. Once the boot is complete, you can go back and examine text that has scrolled off the top of the screen: press \fBScrollLock. The cursor will disappear, and you can use the \fBPageUp and \fBPageDown keys to scroll up to 3 previous screenfuls. To exit this mode, press \fBScrollLock again. We'll go through this output in some detail over the next couple of pages.

.P Once it has finished loading, the kernel calls all configured drivers to examine the hardware configuration of the machine on which it is running. This is called probing for the devices. If you have time to follow it, it's a good idea to confirm that it's correct. It's not that important unless something goes wrong, and then it won't scroll off the screen. We see something like:
.Dx CPU: i486DX (486-class CPU) real memory = 16777216 (16384K bytes) avail memory = 14753792 (14408K bytes) Probing for devices on the ISA bus: sc0 at 0x60-0x6f irq 1 on motherboard sc0 is the system console sc0: VGA color <16 virtual consoles, flags=0x0> ed0 not found at 0x280 ed0 is a possible ethernet board ed1 at 0x300-0x31f irq 5 on isa this ethernet board was found ed1: address b4:66:e9:60:98:81, type NE2000 (16 bit) ...it's an NE2000 .De As they probe, the drivers give information on what they are looking for and how successful they were. They don't always tell the truth. For example, the NE2000 driver, which also drives Western Digital boards and the 3Com 3C503, does not check whether the Ethernet board really does generate the interrupt that it expects (5 in the case of ed1 above). If your board generates a different interrupt, it will still return the same information, including the correct ethernet address, which the driver can read without waiting for an interrupt.

.P Continuing,
.Dx sio0 at 0x3f8-0x3ff irq 4 on isa first serial I/O sio0: type 16450A unbuffered serial port sio1 at 0x2f8-0x2ff irq 3 on isa second serial I/O sio1: type 16550A buffered serial port sio2 not found at 0x3e8 no more serial I/O ports sio3 not found at 0x2e8 .De Recall from \*[chconcepts], page .Sref \*[supported-hardware] , .X "COM1:" that UNIX devices start counting from 0, whereas MS-DOS starts counting from 1. Devices sio0 through sio3 are known as COM1: through COM4: in the MS-DOS world.
.Dx lpt0 at 0x378-0x37f irq 7 on isa first parallel I/O lpt0: Interrupt-driven port it generates interrupts lp0: TCP/IP capable interface and our IP interface can run on it lpt1 not found at 0xffffffff no more parallel interfaces lpt2 not found at 0xffffffff mse0: wrong signature ff See the text below mse0 not found at 0x23c Bus mouse .De The ``wrong signature'' message means that the driver read data 0xff, which was not what it expected. Typically, this means that nothing was present at all at the address it tried.
.Dx fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa found a floppy controller fdc0: NEC 765 of conventional type
fd0: 1.44MB 3.5in and two floppy drives fd1: 1.2MB 5.25in wdc0 at 0x1f0-0x1f7 irq 14 on isa found a conventional disk controller wdc0: unit 0 (wd0): and a Western Digital AC2200F driver wd0: 202MB (415380 sectors), 989 cyls, 12 heads, 35 S/T, 512 B/S wdc1 not found at 0x170 no second IDE controller .De

.Pn found-caviar .X "WDC 2200F" The driver gets the information WDC AC2200F and the geometry by reading it from the drive itself. This drive was sold by Western Digital as the Caviar 2200. If your system installs just fine and then won't boot, you should check whether the CMOS configuration agrees with what the driver found.

.P Before the driver for wdc1 gives up and produces the message on the last line above, it waits for quite a long time, about 30 seconds. Don't despair, the system probably hasn't crashed and burned, the driver just wants to be really sure. ..if stillthere If this wait gets on your nerves, you can rebuild the kernel with a shorter wait.See \*[chbuild], page .Sref \*[delays] \& for further information. ..endif

.P .\" XXX Next, the SCSI drivers check for their boards:
.Dx bt0 not found at 0x330 no BusLogic Host Adapter uha0 not found at 0x330 no Ultrastore Host Adapter ahc1 not found ahb0 not found aha0: AHA-154x[AB]-V0.5, enabling residuals, target ops aha0: reading board settings, dma=5 int=11 (bus speed defaulted) aha0 at 0x330-0x333 irq 11 drq 5 on isa aha0 waiting for scsi devices to settle significant delay here (aha0:0:0): "FUJITSU M2266S-512 0020" type 0 fixed SCSI 2 sd0(aha0:0:0): Direct-Access 1029MB (2107704 512 byte sectors) (aha0:1:0): "MICROP 2112-15MQ1094802 HQ48" type 0 fixed SCSI 1 sd1(aha0:1:0): Direct-Access 1001MB (2051615 512 byte sectors) (aha0:2:0): "HP HP35480A 1109" type 1 removable SCSI 2 st0(aha0:2:0): Sequential-Access density code 0x13, variable blocks, write-protected (aha0:4:0): "EXABYTE EXB-8500-85Qanx0 0415" type 1 removable SCSI 2 st1(aha0:4:0): Sequential-Access density code 0x0, drive empty (aha0:6:0): "TOSHIBA CD-ROM XM-3401TA 3353" type 5 removable SCSI 2 cd0(aha0:6:0): CD-ROM cd present.[327008 x 2048 byte records] .De Here we have found an Adaptec 154X SCSI host adapter. The SCSI driver can read the DMA channel number and the IRQ value (which it calls int), but it hasn't checked the bus speed, since this can cause some controllers to crash. Next, the drivers for the individual SCSI devices wait for a while for the drives to go through their self check before reading their configuration information. We continue looking for other storage devices:
.Dx aic0 not found at 0x340 nca0 not found at 0x1f88 nca1 not found at 0x350 sea0 not found wt0 not probed due to I/O address conflict with ed1 at 0x300 mcd0 not probed due to I/O address conflict with ed1 at 0x300 .De wt0 would be a Wangtek QIC-02 tape controller, but the only address that the generic driver would look for is 0x300. The system has already found an Ethernet board there, so the driver doesn't even try. The Mitsumi CD-ROM driver has the same problem, but it has a second possibility:
.Dx mcd1: timeout getting status really no Mitsumi on this machine mcd1 not found at 0x340 matcdc0 not found at 0xffffffff no Matsushita CD-ROM either
scd0 not found at 0x230 ie0 not found at 0x360 ep0 not probed due to I/O address conflict with ed1 at 0x300 ix0 not probed due to I/O address conflict with ed1 at 0x300 le0 not probed due to I/O address conflict with ed1 at 0x300 lnc0 not found at 0x280 lnc1 not probed due to I/O address conflict with ed1 at 0x300 ze0 not probed due to I/O address conflict with ed1 at 0x300 zp0 not probed due to I/O address conflict with ed1 at 0x300 npx0 on motherboard found a numeric coprocessor
npx0: INT 16 interface which generates the standard interrupt Probing for devices on the PCI bus: .De

.Pn boot-msg-end .X "command, sysinstall" .X "sysinstall, command" After about 30 to 60 seconds, depending on the speed of the machine and the amount of hardware connected to it, the screen will be cleared and you will see the main sysinstall menu (in colour, if your system supports it).

.P In order to be able to install the machine, the system must recognize all your hardware. But what happens if you want to install via the network and your Ethernet board is set up to generate IRQ 10? As we have seen, the driver doesn't notice it, and it won't be until quite some time later that you will find that the installation can't work. Don't worry, there are things you can do. We'll look at them in \*[chproblems], page .Sref \*[modify-boot-config] . .H3 "Using sysinstall"

.Pn sysinstall-main .X "sysinstall, using" .X "FAQ/Text" .DF .fam G

.PSPIC images/main-install.ps 4i .Figure-heading "Main installation menu" .Tn main-installation-menu .DE .\" XXX .pageref \*[main-installation-menu] "on page \*[main-installation-menu]" Figure \*[main-installation-menu] shows the main sysinstall menu. Note particularly that sysinstall includes on-line help at all stages. Simply press \fBF1 and you will be given appropriate help. Also, if you haven't been here before, the Doc menu gives you a large part of the appropriate information from the handbook. .H2 "Kinds of installation" .X "novice installation" .X "express installation" .X "custom installation" .X "installation, novice" .X "installation, express" .X "installation, custom" To get started, you select one of Novice, Express or Custom. As the names imply, Novice installation is intended for people who are new to installing FreeBSD, the Express installation is for people in a hurry, and Custom installation is for you if you want to specify exactly what is to be done.

.P There isn't really that much difference between the three forms of installation. In almost every case you will want to perform the same steps: .Ls B .LI Possibly set up options. ..if verylong We'll look at this on page .Sref \*[install-options] . ..endif .LI Set up disk partitions, which we'll discuss in the next section. .LI Set up file systems and swap space within a FreeBSD slice, which we start on page .Sref \*[disklabel-editor] . .LI Choose what you want to install, which we discuss on page .Sref \*[select-distribution] . .LI Choose where you want to install it from. We'll look at this on page .Sref \*[select-medium] . .LI Actually install the software. We'll treat this on page .Sref \*[commit] . .Le We looked at disk partitions and file systems on page \*[partitions]. We'll look at the other points when we get to them.

.P The Novice and Express installation will take you through these steps in sequence, while the Custom installation will return you to its main menu after each step. It would be confusing to say what happens next after each of the steps, so I won't mention the exact transition each time: it should be obvious what's going on. In practice, you should use the Novice installation, even if you're an experienced UNIX hacker: the term ``Novice'' applies to the usage of sysinstall, not of UNIX. .H2 "Creating space on disk" .X "partition table, building" .X "disks, creating file systems" .X "disks, creating space"

.Pn building-partition-table The first step is to set up space for FreeBSD on the disk. We looked at the technical background in \*[chconcepts], page .Sref \*[make-fs] . In this section, we'll use the term partition to refer to a slice or MS-DOS partition, since that's the usual terminology, even if it's a little confusing.

.P .X "partition" Whether or not you need to build or modify a partition table, select Partition. The installation routines need to enter this screen in order to read the partition information from the disk. If you like what you see, you can leave again immediately with q (quit), but you must first enter this menu.

.P If you have more than one disk connected to your machine, you will next see the screen shown in figure \*[disk-selection-menu]. This menu allows you to choose the drives that you want to use for FreeBSD. In our example case, we have three drives.. .DF .fam G

.PSPIC images/select-disk.ps 4i .Figure-heading "Disk selection menu" .Tn disk-selection-menu .DE .X "wd0" We want to put the system on wd0, and that's where the cursor is positioned, so we just enter SPACE followed by ENTER. .Aside If you intend to use more than one disk for FreeBSD, you have the choice of setting them all up now, or setting the others up after the system is up and running. We'll look at the latter option in \*[chdisks], on page .Sref \*[second-disk] . As you'll see there, it's much easier to do it now. .End-aside The next screen shows: .br
.Dx Disk name: wd0 FDISK Partition Editor BIOS Geometry: 989 cyls/12 heads/35 sectors Offset Size End Name PType Desc Subtype Flags 0 35 34 - 6 unused 0 35 414925 414959 wd0s1 2 fat 6 = 414960 420 415379 - 2 unused 0 The following commands are supported (in upper or lower case): A = Use Entire Disk B = Bad Block Scan C = Create Partition D = Delete Partition G = Set BIOS Geometry S = Set Bootable U = Undo All Changes Q = Finish W = Write Changes The currently selected partition is displayed in reverse video Use F1 or ? to get more help, arrow keys to move. .De .Highlight Don't use the W (Write Changes) command here. It's intended for use only once the system is up and running. .End-highlight Table .Sref \*[fdisk-tab] \& explains the meanings of the columns in this display. This display shows the current partition table on our Western Digital Caviar 2200 disk drive (see page .Sref \*[found-caviar] ). The first partition contains the Master Boot Record, which is exactly one sector long, and the bootstrap, which can be up to 15 sectors long. The partitioning tools use the complete first track: note that the geometry information from BIOS says that it has 35 sectors per track. .Df .TB "fdisk information" .Tn fdisk-tab .TS H box,center,tab(#) ; | lfCWp9w8 | lw70 | . .sp .4v \s10Column#description = .TH N .X "fat" .X "file allocation table" Offset#T{ the number of the first sector in the partition T} .sp .4v Size#T{ the length of the partition in sectors T} .sp .4v End#T{ the number of the last sector in the partition T} .sp .4v Name#T{ where present, this is the name by which FreeBSD knows the partition. In this example, only the second partition has a name. T} .sp .4v Ptype#T{ the partition type. Partition type 6 is the Master Boot Record, which is exactly one track long (note that the header says that this drive has 35 sectors per track). Type 2 is a regular partition. T} .sp .4v .X "fat" .X "File Allocation Table" T{ Subtype Desc T}#T{ These describe the type of partition numerically and in text. fat stands for File Allocation Table, which is a central part of the MS-DOS disk space allocation strategy. In more general terms, we can say that the first partition is a MS-DOS file system. T} .sp .4v Flags#can be one or more of the following characters: .sp .5v #= The partition is correctly aligned #T{ > The partition finishes after cylinder 1024, which can cause problems for MS-DOS. T} #A This is the active (bootable) partition. #B The partition employs BAD144 bad-spot handling. #C This is a FreeBSD compatibility partition. #R This partition contains a root file system. .TE .sp 1.5v .DE

.P In our case, the MS-DOS file system uses up the whole disk except for the last track, 420 sectors (210 kB) at the end of the disk. Clearly there's not much left to share. We could shorten the MS-DOS partition with FIPS\(emsee \*[chshareinstall], page .Sref \*[FIPS] \& if that's what you want to do\(embut in this example we choose to remove it. .Highlight Don't forget that if you remove a partition, you lose all the data in it. If you have anything in the partition, make sure you have a legible backup. .End-highlight We remove the partition with the d command. After this, our display looks like:
.Dx 0 415380 415379 - 6 unused 0 .De The next step is to allocate a FreeBSD partition with the C command. We get a menu asking us the size of the partition, with a suggested value of 415380 sectors, the complete size of the disk. We can edit this value if we wish, but in this case it's what we want, so we just press ENTER. Now the display looks like this:
.Dx 0 35 34 - 6 unused 0 35 415345 415379 wd0s1 3 freebsd 165 C .De .X "fdisk, command" .X "command, fdisk" Although we were offered the complete disk, and we accepted, fdisk reserved the complete first track (35 sectors) for the MBR. The new partition uses the rest of the disk, including the last 420 sectors which MS-DOS rejected, and it has a partition type 3 (extended partition) and subtype 165 (0xa5), our FreeBSD partition.

.P All we need to do now is to mark the partition active or bootable, by pressing s. The A flag appears at the end of the partition line:
.Dx 0 35 34 - 6 unused 0 35 415345 415379 wd0s1 3 freebsd 165 CA .De .X "command, fdisk" .X "fdisk, command" .X "boot selector" .X "MBR" .X "master boot record" That's all we need to do here: we leave fdisk with the q command. Next we are asked what kind of boot selector (in other words, MBR
) we want. We have three choices, as shown in Table \*[MBR-choices]. .X "BootMgr" Since we plan to have only one operating system on this disk, we select Standard. If we were sharing with, say, MS-DOS, we could choose BootMgr
instead. .Df

.Pn select-mbr .TB "MBR choices" .TS H box,center,tab(#) ; lfCWp9 | lw70 . \s10Choice#Description = .TH N .X "booteasy" BootMgr#T{ Install the FreeBSD booteasy boot manager in the MBR. This will enable you choose which partition to boot every time you start the system. T} .sp .4v Standard#T{ Use a standard MBR. You will only be able to boot from the active partition. T} .sp .4v None#T{ Don't change the MBR. This is useful if you already have another boot manager installed. T} .TE .sp 1.5v .Tn MBR-choices .DE .H4 "Where we are now" At this point in the installation, you have told sysinstall the overall layout of the disk or disks you intend to use for FreeBSD, and whether or how you intend to share them with other operating systems. The next step is to specify how you want to use the FreeBSD partitions. .H3 "Specifying disk labels" .X "disk label, specifying"

.Pn disklabel-editor .X "/usr" In the next step we tell the installation program what to put in our FreeBSD partion. We will typically need a root file system, a /usr file system and swap space\(emsee \*[chdisks], page .Sref \*[file-system-layout] , for the reasoning behind the file system layout. When we select Label, we get the following screen: .br .ne 2i
.Dx FreeBSD Disklabel Editor Disk: wd0 Partition name: wd0s1 Free: 415345 blocks (202MB) Part Mount Size Newfs Part Mount Size Newfs ---- ----- ---- ----- ---- ----- ---- ----- The following commands are valid here (upper or lower case): C = Create D = Delete M = Mount W = Write N = Newfs Opts T = Newfs Toggle U = Undo Q = Finish A = Auto Defaults for all! The default target will be displayed in reverse video. Use F1 or ? to get more help, arrow keys to move. .De In this display, bold print indicates the reverse video fields. The highlighted line at the top of the screen is the ``cursor'', and you can move up and down with the arrow keys.

.P At this point, we have two choices: decide for ourselves what we want, or let the disk label editor do it for us. Let's look at both ways: .H4 "Automatically generated labels"

.Pn automatic-labels If we enter a, the disk label editor generates everything for us. Even if we don't want to accept them, it's a good idea to look at the suggestions. We get:
.Dx Part Mount Size Newfs Part Mount Size Newfs ---- ----- ---- ----- ---- ----- ---- ----- wd0s1a / 32MB UFS Y wd0s1b 42MB SWAP wd0s1e /var 30MB UFS Y wd0s1f /usr 97MB UFS Y .De .X "/var" .X "/usr" The disk label editor has given us an additional file system, /var, which is used to store files which change frequently, such as mail or news. The trouble here is that we're left with only 97 MB for /usr, which is far too little for what we intend to install on this disk. On a larger system, this might not be a bad way to divide the disk.

.P .X "UNIX File System" .X "Mount" .X "Newfs" .X "UFS" For the file systems, the column Mount now shows the mount points, and Newfs contains the letters UFS for UNIX File System, and the letter Y, indicating that we need to create a new file system before we can use it. .H4 "Second time through" If you have already started an installation and aborted it for some reason after creating the file systems, things will look a little different when you get here:
.Dx Part Mount Size Newfs Part Mount Size Newfs ---- ----- ---- ----- ---- ----- ---- ----- wd0s1a 32MB * wd0s1b 42MB SWAP wd0s1e 30MB * wd0s1f 97MB * .De The label editor has found the partitions, but it doesn't know where to mount the file systems. Before you can use them, you must tell the label editor the types and mount points of the UFS partitions. To do this: .Ls B .LI Position the cursor on each of the partitions in turn. .LI .X "/var" .X "/usr" .X "Mount" .X "Newfs" Press m (Mount). A prompt window will pop up asking you to specify the mount point. Enter the name of the mount point, in this example, first /, then press return. The label editor will enter the name of the mount point under Mount, and under Newfs it will enter UFS N\(emit knows that this is a UFS file system, so it will just check its consistency, not overwrite it. Repeat this procedure for /var, and then /usr, and you're done.

.Pn dos-mount-point If you are sharing your disk with another system, you can also use this method to specify mount points for your MS-DOS file systems. Simply select the MS-DOS partition and specify the name of a mount point. .LI .X "command, fsck" .X "fsck, command" Unless you are very sure that the file system is valid, and you really want to keep the data in the partitions, press t to specify that the file system should be created. The UFS N will change to UFS Y. If you leave the N there, the commit phase will check the integrity of the file system with fsck rather than creating a new one. .Le .H4 "Manually generated labels" .X "/usr" If we enter c to create a disk partition, the disk label editor prompts us for details of the partition. Let's assume that we've decided that, for this disk, we want 20 MB root file system, 32 MB swap and the rest for /usr. We hit c and get a prompt window asking how much we want, suggesting the whole disk. We replace this with 20m (the trailing m says the the value is in units of megabytes), and get another question asking whether this is a file system or swap space. We choose file system and get a further prompt asking where to mount it. We enter /, and come back to the display, which now shows
.Dx Part Mount Size Newfs Part Mount Size Newfs ---- ----- ---- ----- ---- ----- ---- ----- wd0s1a / 20MB UFS Y .De Next we define the swap space. This time we specify 32 MB, and that it should be swap space. Now the display looks like:
.Dx Part Mount Size Newfs Part Mount Size Newfs ---- ----- ---- ----- ---- ----- ---- ----- wd0s1a / 20MB UFS Y wd0s1b 32MB SWAP .De .X "/usr" Finally, we create the /usr file system. This time we accept the offer of everything available, tell it to mount the file system on /usr, and end up with:
.Dx Part Mount Size Newfs Part Mount Size Newfs ---- ----- ---- ----- ---- ----- ---- ----- wd0s1a / 20MB UFS Y wd0s1b 32MB SWAP wd0s1e /usr 150MB UFS Y .De .sp -1v That's all we need to do. We enter q to proceed to the next menu. .H4 "How much swap?" .X "swap space"

.Pn how-much-swap In the examples above, we've just assumed that 32 MB of swap space are a good value. In fact, it's very difficult to predict just how much swap space you need. The automatic option gave us 42 MB. In the manual example, we chose 32 MB. Maybe you can get by with 16 MB. Maybe you'll need 96 MB. How do you decide?

.P It's almost impossible to know in advance what your system will require. Here are some considerations: .Ls B .LI Swap space is needed for all pages of virtual memory which contain data that is not locked in memory and which can't be recreated automatically. This is the majority of virtual memory in the system. .LI Some people use rules of thumb like ``2.5 times the size of physical memory, or 64 MB, whichever is bigger''. These rules all work by making assumptions about your workload. .LI Known memory hogs are X11 and the GNU C compiler (gcc). If you use these, you will probably need more swap space. .LI You can add additional swap partitions on other disks. This has the additional advantage of balancing the disk load if your machine swaps a lot. .LI About the only ways to change the size of a swap partition are to add another partition or to reinstall the system, so if you're not sure, a little bit more won't do any harm, but too little can really be a problem. .LI If your system panics, and memory dumping is enabled, it will write the contents of memory to the swap partition. This will obviously not work if your swap partition is smaller than main memory. Under these circumstances, the system refuses to dump, but it's not impossible that a bug might cause the dump to write beyond the bounds of the swap partition, probably causing irreperable damage to your /usr partition. .LI Even with lightly memory loads, the virtual memory system slowly pages out data in preparation for a possible sudden demand for memory. This means that it can be more responsive to such requests. As a result, you should have at least as much swap as memory. .Le A couple of examples might make this clearer: .Ls N .LI I run X, StarOffice, Netscape and a whole lot of other memory-hungry applications on my old 486 with 16 MB. Sure, it's really slow, especially when changing from one application, but it works. Since there's not much memory, it uses a lot of swap. Here's a typical view of its swap space:
.Dx Device 1024-blocks Used Avail Capacity Type /dev/sd0s1b 122880 65148 57668 53% Interleaved .De .LI I run much more stuff on my Pentium with 96 MB of memory. I've got lots of swap space, but what I see is:
.Dx Device 1024-blocks Used Avail Capacity Type /dev/wd0s1b 51200 14416 36720 28% Interleaved /dev/sd0b 66036 14332 51640 22% Interleaved /dev/sd2b 204800 14384 190352 7% Interleaved Total 321844 43132 278712 13% .De .Le It's not so important that the Pentium is using less swap: it's using 0.67 of its memory in swap, whereas the 486 is using 4 times its memory. Look at it from a different point, and it makes more sense: swap makes up for the lack of real memory, so the 486 is using a total of 80 MB of memory, and the Pentium is using 140 MB. In other words, there is a tendency to be able to say ``the more main memory you have, the less swap you need''.

.P If, however, you look at it from the point of view of acceptable performance, you will hear things like ``you need at least one-third of your virtual memory in real memory''. That makes sense from a performance point of view, assuming all processes are relatively active. And, of course, it's another way of saying ``take twice as much swap as real memory''.

.P In summary: be generous in allocating swap space. In this example, we have a tiny disk, so we're forced to use a small swap partition. If you have the choice, use more. If you really can't make up your mind, take 128 MB of swap space. .H4 "Where we are now" When you get to this point in the installation, you have told sysinstall everything it needs to know about the layout of the disk or disks you intend to use for FreeBSD. Next, you tell it what you want to put on the disks. .br .DF .br .fam G

.PSPIC images/select-dist.ps 4i .Figure-heading "Disk selection menu" .Tn select-distribution-menu .DE .DF .fam G

.PSPIC images/x-selection.ps 4i .Figure-heading "X user selection menu" .Tn x-selection-menu .DE .sp .H3 "Selecting distributions" .X "distributions, selecting"

.Pn select-distribution The next step is to decide what to install. The easiest thing to say, of course, is ``everything'', but we don't have enough disk space for that. Figure \*[select-distribution-menu] .\" XXX fix refs .pageref \*[select-distribution-menu-page] "on page \*[select-distribution-menu-page] " shows us the menu we get when we enter Distributions. We have a total of 170 MB at our disposal. For this example, we assume that we want to install the X-User distribution. Figure \*[x-selection-menu] .\" XXX .pageref \*[x-selection-menu-page] "on page \*[x-selection-menu-page]" shows us the choices offered when we select X-User. Each of these menus goes further. Figure \*[x-base-menu] .\" XXX .pageref \*[x-base-menu-page] "on page \*[x-base-menu-page] " shows the Basic menu. .DF .fam G

.PSPIC images/select-basic.ps 4i .Figure-heading "X base distribution menu" .Tn x-base-menu .DE .DF .fam G

.PSPIC images/select-medium.ps 4i .Figure-heading "Installation medium menu" .Tn medium-menu .DE We select everything from the basic menu, and we also select the X server, but since this machine runs only an ancient Tseng ET4000 display board, we don't need any additional servers. When we've finished, we exit the menu. On the way, we are asked if we want to install the DES software and the Ports Collection. In each case, we decide not to: we can always do it after the system is up and running. .H4 "Where we are now" Now sysinstall knows the layout of the disk or disks you intend to use for FreeBSD, and what to put on them. Next, you specify where to get the data from. .H2 "Selecting the installation medium" .X "installation medium, selecting"

.Pn select-medium .X "menu, media" The next thing we need to specify is where we will get the data from. So far in this chapter, you've had to go through every step. Where you go now depends on your installation medium. Figure \*[medium-menu] .\" XXX .pageref \*[medium-menu-page] "on page \*[medium-menu-page]" shows the Media menu. If you're installing from anything except an FTP server or NFS, you just need to select your medium and then commit the installation, which we look at on page .Sref \*[commit] . .H3 "Installing via FTP" Figure \*[ftp-server-menu] .\"XXX .pageref \*[ftp-server-menu-page] "on page \*[ftp-server-menu-page]" shows the menu you get when you select FTP or FTP Passive. .DF .fam G

.PSPIC images/select-server.ps 4i .Figure-heading "Selecting FTP server" .Tn ftp-server-menu .DE .X "/usr/ftp" .X "/pub/FreeBSD/\*[Fver]-RELEASE" .X "command, sysinstall" .X "sysinstall, command"

.Pn install-set-hostname To see the remainder of the sites, use the \fBPageDown key. We want to install from presto, a system on the local network. presto isn't on this list, of course, so we select Other. Another menu appears, asking for an ftp pathname in the URL form ftp://hostname/pathname. hostname is the name of the system, in this case presto.example.org, and pathname is the path relative to the anonymous ftp directory, which on FreeBSD systems is usually /usr/ftp. The install program knows its version number, and it attaches it to the name you supply. .Aside You can change the version number from the options menu, for example in order to install a snapshot of a newer release of FreeBSD. .End-aside In this case, we're installing version \*[Fver] of FreeBSD, and it's in the directory /pub/FreeBSD/\*[Fver]-RELEASE. sysinstall knows the \*[Fver]-RELEASE, so we enter only ftp://presto.example.org/pub/FreeBSD. The next menu asks us to configure our network. This is the same menu which we would normally fill out at the end of the installation\(emsee page .Sref \*[net-setup] \& for details. .hy

.P This information will be used to set up the machine after installation, so it pays to fill this information out absolutely correctly, even though, for example, you won't need a gateway to access presto from freebie, since they're both on the same local net. ..if verylong See \*[chsysadm], page \*[netconfig] for further details. ..endif

.P After entering this information, you continue with Commit (below). .H3 "Installing via NFS" We considered the prerequisites for NFS installation on page \*[nfs-install-setup]. All you need to do at this point is to give this information to sysinstall, as shown in figure \*[nfs-install-menu]. After entering this information, sysinstall will ask you to configure an interface. This is the same procedure which you would otherwise do after installation\(emsee page \*[net-setup]. After performing this configuration, you continue with Commit (below). .DF .fam G

.PSPIC images/nfs-select.ps 4i .Figure-heading "Specifying NFS file system" .Tn nfs-install-menu .DE .H3 "Installing from floppy disk"

.Pn brain-dead-floppy-install Installation from floppy disk is definitely the worst choice you have. You will need lots of floppies, and the chance of one of them being bad is high. We looked at how to prepare floppies for installation in \*[chconcepts], page .Sref \*[create-floppies] . .X "floppy" The installation itself is straightforward enough: select Floppy and follow the prompts. .H4 "Where we are now" Now sysinstall knows everything it needs to install the software. It's just waiting for you to tell it to go ahead. .H2 "Performing the installation"

.Pn commit So far, everything we have done has had no effect on the disk drives. If you change your mind at this point, you can just abort the installation, and the data on your disks will be unchanged.

.P That changes completely in the next step, which we call commiting the installation. Now is the big moment. We've set up our partitions, decided what we want to install and from where. Now we do it.

.P If you are installing with the Custom installation, you need to select Commit explicitly. The Novice installation asks you if you want to proceed:
.Dx Last Chance! Are you SURE you want continue the installation? If you're running this on an existing system, we STRONGLY encourage you to make proper backups before proceeding. We take no responsibility for lost disk contents! .De .X "command, sysinstall" .X "sysinstall, command" When you answer yes
, sysinstall does what we've been preparing for: .Blist .LI It creates the partitions and disk partitions. .LI It mounts swap space. .LI It creates the file system structures in the file system partitions. .Le .X "command, sysinstall" .X "sysinstall, command" .X "/dev/ttyv1" At this point, it's interesting to know that two other virtual terminals are also available. /dev/ttyv1 shows you what's going on behind the scenes. You can switch to it with \fBALT-F2. Right at the beginning you'll see a whole lot of error messages as sysinstall tries to initialize every device it can think of. Don't worry about this. To get back to the install screen, press \fBALT-F1.

.P .X "/dev/ttyv3" In addition, after sysinstall mounts the root file system, it starts an interactive shell on /dev/ttyv3. You can use it if something goes wrong, or simply to watch what's going on while you're installing. You switch to it with \fBALT-F4.

.P After reading in all the files, sysinstall displays further information messages:
.Dx Remaking all devices.. Please wait! Making slice entries Fixing permissions.. .De And we're done! .X "command, sysinstall" .X "sysinstall, command" .H4 "Where we are now" When we get here, the software has been installed on the disk, but we still need to customize some information to our environment. We'll look at this in the following sections. .H2 "Network services" .X "network services" .Tn network-services-menu Figure \*[network-services] .\" XXX .pageref \*[network-services-page] "on page \*[network-services-page]" shows the Network Services Menu. You don't see this menu in the Novice and Express installations: after setting up your network interfaces, sysinstall presents you with various items from the Network Services Menu. The Custom installation presents you with the menu itself. .DF .fam G

.PSPIC images/network-services.ps 4i .Figure-heading "Network services menu" .Tn network-services .DE The first step should always be to set up the network interfaces, so this is where you find yourself if you are performing a Novice or Express installation. .H3 "Setting up network interfaces" .X "network interfaces, setting up"

.Pn net-setup .X "command, sysinstall" .X "sysinstall, command" Figure \*[network-setup-menu] .\" XXX .pageref \*[network-setup-menu-page] "on page \*[network-setup-menu-page]" shows the network setup menu. If you installed via FTP or NFS, you will already have set up your network interfaces, and sysinstall won't ask the questions again. .DF .fam G

.PSPIC images/network-setup.ps 4i .Figure-heading "Network setup menu" .Tn network-setup-menu .DE The only real network board on this list is ed1, the Ethernet board. The others are standard hardware which can also be used as network interfaces. In our case, we choose the Ethernet board. The next menu asks us to set the internet parameters. Figure \*[network-config-menu] .\" XXX .pageref \*[network-config-menu-page] "on page \*[network-config-menu-page]" shows the network configuration menu after filling in the values. .DF .fam G

.PSPIC images/network-config.ps 4i .Figure-heading "Network Configuration Menu" .Tn network-config-menu .DE You need to specify the local host name and the domain name separately. The names and addresses correspond to the example network that we will look at in \*[chnetintro], on page \*[reference-net-page]. We have chosen to call this machine presto, and the domain is example.org. In other words, the full name of the machine is presto.example.org. Its IP address is 223.147.37.2. In this configuration, all access to the outside world goes via gw.example.org, which has the IP address 223.147.37.5. The name server is located on the same host, presto.example.org. Since the name server isn't running when this information is needed, we specify all addresses in numeric form.

.P What happens if you don't have a domain name? Well, the simple answer is ``go out and get one''\(emsee page \*[domainreg]. But in the meantime, don't fake it. Just leave the fields empty.

.P .X "command, sysinstall" .X "sysinstall, command" .X "command, ifconfig" .X "ifconfig, command" As is usual for a class C network, the net mask is 255.255.255.0. You don't need to fill in this information\(emif you leave this field without filling it in, sysinstall will insert it for you. Normally, as in this case, you wouldn't need any additional options to ifconfig. .H3 "Other network options" You don't need to specify any of the remaining configuration options during ..if verylong configuration, so we'll look at them in \*[chnetsetup]. ..else configuration. See the online handbook for further details. ..endif .H2 "Machine Configuration" .X "command, sysinstall" .X "sysinstall, command" The final part of the installation deals with optional setup items. You don't need to do any of this right now, but if this is the first time you have installed FreeBSD, you will probably want to at least add a user. If you're like me, you'll also have a couple of favourite programs that you want to install, probably including XFree86. The Express and Novice installations walk you through these points, while figure \*[final-config-menu] .\" XXX .pageref \*[final-config-menu-page] "on page \*[final-config-menu-page]" shows you the menu that Custom installation presents. .DF .fam G

.PSPIC images/final-config.ps 4i .Figure-heading "Final Configuration Menu" .Tn final-config-menu .DE ..if finished None of these items are required in order to be able to reboot the machine, and it's beyond the scope of this book to describe them all. The installation help should be enough to help you find your way\(emif not, check in the online handbook after you have the system up and running.

.P You can return to this menu from a running system\(emsee page .Sref \*[reconfig] . ..endif .H2 "Rebooting the new system" Finally, it's done. You exit the main menu by selecting Quit. Before you answer the question asking for confirmation, remember to remove the boot diskette\(emotherwise you'll end up booting from the floppy instead.

.P After that, the system will reboot. The results look much the same as before, but this time, instead of going in to the sysinstall menu, it continues to start up the machine and give you a login prompt. You're done! .H3 "Where to put \f(BI/var and \f(BI/tmp"

.Pn symlink-var .X "/var" .X "/usr/var" .X "/var" .X "/usr/var" Now the installation is completed, but you may still have some housekeeping to do. Did you include a /var file system on your disk? In the example, we didn't. If we don't specify anything else, /var will end up on the root file system, which isn't enormous. If we leave things like that, there's a very good chance that the root file system will fill up. We solve this problem by creating a directory /usr/var and a symbolic link /var which points to /usr/var:
.Dx # mkdir /usr/var create a new directory # cd /var move to the old /var directory # tar cf - . | (cd /usr/var; tar xf - ) copy its contents # cd / get out of the directory # rm -rf /var and remove it # ln -s /usr/var /var now link to the new directory .De After performing these steps, you might see messages like:
.Dx Jan 9 13:15:00 myname syslogd: /var/run/utmp: no such file or directory .De .X "syslogd" .X "System Log d\(aemon" .X "d\(aemon, System Log" syslogd is the System Log d\(aemon.\*F .FS See \*[chunixref], page .Sref \*[daemon] , for a description of d\(aemons. .FE Don't worry about these messages. If you're intending to restart the system soon, just wait until then and the messages will go away. Otherwise you can restart syslogd:
.Dx # ps aux | grep syslogd look for the syslog d\(aemon root 152 11.0 1.6 176 476 v0 D+ 1:16M 0:00.15 grep syslogd root 58 0.0 1.1 184 332 ?? Ds 1:13 0:00:57 syslogd # kill -9 58 stop the PID of syslogd
# syslogd and start it again .De The PID of the syslogd is the second field on the line which ends with just syslogd. The first line is the process which is looking for the text syslogd. See \*[chunixref], page .Sref \*[stopping-processes] , for more information on stopping processes.

.P .X "/tmp" .X "file system, /tmp" .X "/var/tmp" .X "file system, /var/tmp" Programs should not write large files to /tmp; if a program needs to create a large temporary file, it should create it in /var/tmp. Unfortunately, the location of the temporary files is not usually in your hands. It would be tempting to also replace /tmp with a symbolic link to /var/tmp, but the system handles /tmp and /var/tmp slightly differently: after a reboot, it removes all files from /tmp, but it leaves the files in /var/tmp. You can solve this problem by creating a directory /usr/tmp and creating a link to it.

.P Perform the following steps in single-user mode (see \*[chunixref], page .Sref \*[single-user] , for a description of single user mode and how to get into it).
.Dx # mkdir /usr/tmp create a new directory # rm -rf /tmp and remove the old /tmp # ln -s /usr/tmp /tmp now link to the new directory .De .H2 "Upgrade installation"

.Pn upgrade-install As the name implies, upgrade installations are intended to help you upgrade from an earlier version of FreeBSD. This kind of installation is still being developed, and it is possible that all sorts of things can go wrong. If you want to use it, make sure you have backed up your old system before you start, and read carefully the warning messages that appear. If things do go wrong, you can always reinstall and then restore your backups. .H2 "Changing configuration" .X "configuration, changing"

.Pn reconfig Once your system is up and running, you're bound to find something that you want to change. The online handbook gives more information on this, but it's good to know that you can start sysinstall after the system is running: it's called stand/sysinstall. For an alternative way to configure additional disks, see \*[chdisks], page \*[second-disk]. .H2 "Installing additional software"

.Pn pkg_add .X "emacs, command" .X "command, emacs" .X "bash, command" .X "command, bash" .X "less, command" .X "command, less" .X "pine, command" .X "command, pine" Once your system is up and running, you may find that things you expect are missing. Where's Emacs? Where's bash? Where's less? They're all there, and just about everything else is as well. We'll look at how to install them in \*[chports], starting on page \*[ports-collection].