2.2. Installation Guide

The following sections will guide you through preparing for and actually installing FreeBSD. If you find something missing, please let us know about it by sending email to the FreeBSD documentation project mailing list .

2.2.1. Preparing for the Installation

There are various things you should do in preparation for the installation. The following describes what needs to be done prior to each type of installation.

The first thing to do is to make sure your hardware is supported by FreeBSD. The list of supported hardware should come in handy here. ;-) It would also be a good idea to make a list of any ``special'' cards you have installed, such as SCSI controllers, ethernet cards, sound cards, etc.. The list should include their IRQs and IO port addresses.

2.2.1.1. Creating the Installation Floppies

You may need to prepare some floppy disks. These disks will be used to boot your computer in to the FreeBSD install process. This step is not necessary if you are installing from CD-ROM, and your computer supports booting from the CD-ROM. If you do not meet these requirements then you will need to create some floppies to boot from.

Note: If you are not sure whether your computer can boot from the CD-ROM it does not hurt to try. Just insert the CD-ROM as normal and restart your computer. You might need to adjust some options in your BIOS so that your computer will try and boot from the CD-ROM drive before the hard disk.

Tip: Even if you have the CD-ROM it might make sense for you to download the files. There have been occasions where bugs in the FreeBSD installer have been discovered after the CDs have been released. When this happens the copies of the images on the FTP site will be fixed as soon as possible. Obviously, it is not possible to update the CDs after they have been pressed.

  1. Acquire the boot floppy images

    These are files with a .flp extension. If you have a CD-ROM release of FreeBSD then you will find the files in the floppies subdirectory. Alternatively, you can download the images from the floppies directory of the FreeBSD FTP site or your local mirror.

    The names of the files you will need varies between FreeBSD releases (sometimes) and the architecture you will be installing on. The installation boot image information on the FTP site provides up-to-the-minute information about the specific files you will need.

  2. Prepare the floppy disks

    You must prepare one floppy disk per image file you had to download. It is imperitive that these disks are free from defects. The easiest way to test this is to format the disks for yourself. Do not trust pre-formatted floppies.

    Important: If you try to install FreeBSD and the installation program crashes, freezes, or otherwise misbehaves one of the first things to suspect is the floppies. Try writing the floppy image files to some other disks, and try again.

  3. Write the image files to the floppy disks.

    The image files, such as kern.flp, are not regular files you copy to the disk. Instead, they are images of the complete contents of the disk.

    This means that you can not use commands like DOS' copy to write the files. Instead, you must use specific tools to write the images directly to the disk.

    If you are creating the floppies on a computer running DOS then we provide a tool to do this called fdimage.

    If you are using the floppies from the CD-ROM, and your CD-ROM is the E: drive then you would run this:

        E:\> tools\fdimage floppies\kern.flp A:
    

    Repeat this command for each .flp file, replacing the floppy disk each time. Adjust the command line as necessary, depending on where you have placed the .flp files. If you do not have the CD-ROM then fdimage can be downloaded from the tools directory on the FreeBSD FTP site.

    If you are writing the floppies on a Unix system (such as another FreeBSD system) you can use the dd(1) command to write the image files directly to disk. On FreeBSD you would run:

        # dd if=kern.flp of=/dev/rfd0
    

    On FreeBSD /dev/rfd0 refers to the first floppy disk (the A: drive). /dev/rfd1 would be the B: drive, and so on. Other Unix variants might have different names for the floppy disk devices, and you will need to check the documentation for the system as necessary.

2.2.1.2. Before Installing from CDROM

If your CDROM is of an unsupported type, please skip ahead to the MS-DOS Preparation section.

There is not a whole lot of preparation needed if you are installing from one of BSDi's FreeBSD CDROMs (other CDROM distributions may work as well, though we cannot say for certain as we have no hand or say in how they created). You can either boot into the CD installation directly from DOS using the install.bat or you can make floppies with the makeflp.bat command.

If the CD has El Torito boot support and your system supports booting directly from the CDROM drive (many older systems do NOT), simply insert the first CD of the set into the drive and reboot your system. You will be put into the installation menu directly from the CD.

If you are installing from an MS-DOS partition and have the proper drivers to access your CD, run the install.bat script provided on the CDROM. This will attempt to boot the FreeBSD installation directly from DOS.

Note: You must do this from actual DOS (i.e., boot in DOS mode) and not from a DOS window under Windows.

For the easiest interface of all (from DOS), type view. This will bring up a DOS menu utility that leads you through all of the available options.

If you are creating the boot floppies from a UNIX machine, see the Creating the Boot Floppies section of this guide for examples.

Once you have booted from DOS or floppy, you should then be able to select CDROM as the media type during the install process and load the entire distribution from CDROM. No other types of installation media should be required.

After your system is fully installed and you have rebooted (from the hard disk), you can mount the CDROM at any time by typing:

    # mount /cdrom

Before removing the CD from the drive again, you must first unmount it. This is done with the following command:

    # umount /cdrom

Do not just remove it from the drive!

Note: Before invoking the installation, be sure that the CDROM is in the drive so that the install probe can find it. This is also true if you wish the CDROM to be added to the default system configuration automatically during the installation (whether or not you actually use it as the installation media).

Finally, if you would like people to be able to FTP install FreeBSD directly from the CDROM in your machine, you will find it quite easy. After the machine is fully installed, you simply need to add the following line to the password file (using the vipw command):

    ftp:*:99:99::0:0:FTP:/cdrom:/nonexistent

Anyone with network connectivity to your machine can now chose a media type of FTP and type in ftp://your machine after picking ``Other'' in the FTP sites menu during the install.

Note: If you choose to enable anonymous FTP during the installation of your system, the installation program will do the above for you.

2.2.1.3. Before installing from Floppies

If you must install from floppy disk (which we suggest you do NOT do), either due to unsupported hardware or simply because you insist on doing things the hard way, you must first prepare some floppies for the installation.

At a minimum, you will need as many 1.44MB or 1.2MB floppies as it takes to hold all the files in the bin (binary distribution) directory. If you are preparing the floppies from DOS, then they MUST be formatted using the MS-DOS FORMAT command. If you are using Windows, use Explorer to format the disks (right-click on the A: drive, and select "Format".

Do NOT trust factory pre-formatted floppies! Format them again yourself, just to be sure. Many problems reported by our users in the past have resulted from the use of improperly formatted media, which is why we are making a point of it now.

If you are creating the floppies on another FreeBSD machine, a format is still not a bad idea, though you do not need to put a DOS filesystem on each floppy. You can use the disklabel and newfs commands to put a UFS filesystem on them instead, as the following sequence of commands (for a 3.5" 1.44MB floppy) illustrates:

    # fdformat -f 1440 fd0.1440
    # disklabel -w -r fd0.1440 floppy3
    # newfs -t 2 -u 18 -l 1 -i 65536 /dev/rfd0

Note: Use fd0.1200 and floppy5 for 5.25" 1.2MB disks.

Then you can mount and write to them like any other filesystem.

After you have formatted the floppies, you will need to copy the files to them. The distribution files are split into chunks conveniently sized so that 5 of them will fit on a conventional 1.44MB floppy. Go through all your floppies, packing as many files as will fit on each one, until you have all of the distributions you want packed up in this fashion. Each distribution should go into a subdirectory on the floppy, e.g.: a:\bin\bin.aa, a:\bin\bin.ab, and so on.

Once you come to the Media screen during the install process, select ``Floppy'' and you will be prompted for the rest.

2.2.1.4. Before Installing from MS-DOS

To prepare for an installation from an MS-DOS partition, copy the files from the distribution into a directory named, for example, c:\FreeBSD. The directory structure of the CDROM or FTP site must be partially reproduced within this directory, so we suggest using the DOS xcopy command if you are copying it from a CD. For example, to prepare for a minimal installation of FreeBSD:

    C:\> md c:\FreeBSD
    C:\> xcopy e:\bin c:\FreeBSD\bin\ /s
    C:\> xcopy e:\manpages c:\FreeBSD\manpages\ /s

Assuming that C: is where you have free space and E: is where your CDROM is mounted.

If you do not have a CDROM drive, you can download the distribution from ftp.FreeBSD.org. Each distribution is in its own directory; for example, the bin distribution can be found in the 4.1.1/bin directory.

For as many distributions you wish to install from an MS-DOS partition (and you have the free space for), install each one under c:\FreeBSD -- the BIN distribution is the only one required for a minimum installation.

2.2.1.5. Before Installing from QIC/SCSI Tape

Installing from tape is probably the easiest method, short of an online FTP install or CDROM install. The installation program expects the files to be simply tarred onto the tape, so after getting all of the distribution files you are interested in, simply tar them onto the tape like so:

    # cd /freebsd/distdir
    # tar cvf /dev/rwt0 dist1 ... dist2

When you go to do the installation, you should also make sure that you leave enough room in some temporary directory (which you will be allowed to choose) to accommodate the full contents of the tape you have created. Due to the non-random access nature of tapes, this method of installation requires quite a bit of temporary storage. You should expect to require as much temporary storage as you have stuff written on tape.

Note: When starting the installation, the tape must be in the drive before booting from the boot floppy. The installation probe may otherwise fail to find it.

2.2.1.6. Before Installing over a Network

There are three types of network installations you can do. Serial port (SLIP or PPP), Parallel port (PLIP (laplink cable)), or Ethernet (a standard ethernet controller (includes some PCMCIA)).

The SLIP support is rather primitive, and limited primarily to hard-wired links, such as a serial cable running between a laptop computer and another computer. The link should be hard-wired as the SLIP installation does not currently offer a dialing capability; that facility is provided with the PPP utility, which should be used in preference to SLIP whenever possible.

If you are using a modem, then PPP is almost certainly your only choice. Make sure that you have your service provider's information handy as you will need to know it fairly early in the installation process.

If you use PAP or CHAP to connect your ISP (in other words, if you can connect to the ISP in Windows without using a script), then all you will need to do is type in dial at the ppp prompt. Otherwise, you will need to know how to dial your ISP using the ``AT commands'' specific to your modem, as the PPP dialer provides only a very simple terminal emulator. Please to the user-ppp handbook and FAQ entries for further information. If you have problems, logging can be directed to the screen using the command set log local ....

If a hard-wired connection to another FreeBSD (2.0-R or later) machine is available, you might also consider installing over a ``laplink'' parallel port cable. The data rate over the parallel port is much higher than what is typically possible over a serial line (up to 50kbytes/sec), thus resulting in a quicker installation.

Finally, for the fastest possible network installation, an ethernet adapter is always a good choice! FreeBSD supports most common PC ethernet cards; a table of supported cards (and their required settings) is provided in the Supported Hardware list. If you are using one of the supported PCMCIA ethernet cards, also be sure that it is plugged in before the laptop is powered on! FreeBSD does not, unfortunately, currently support hot insertion of PCMCIA cards during installation.

You will also need to know your IP address on the network, the netmask value for your address class, and the name of your machine. If you are installing over a PPP connection and do not have a static IP, fear not, the IP address can be dynamically assigned by your ISP. Your system administrator can tell you which values to use for your particular network setup. If you will be referring to other hosts by name rather than IP address, you will also need a name server and possibly the address of a gateway (if you are using PPP, it is your provider's IP address) to use in talking to it. If you want to install by FTP via a HTTP proxy (see below), you will also need the proxy's address. If you do not know the answers to all or most of these questions, then you should really probably talk to your system administrator or ISP before trying this type of installation.

2.2.1.6.1. Before Installing via NFS

The NFS installation is fairly straight-forward. Simply copy the FreeBSD distribution files you want onto a server somewhere and then point the NFS media selection at it.

If this server supports only ``privileged port'' (as is generally the default for Sun workstations), you will need to set this option in the Options menu before installation can proceed.

If you have a poor quality ethernet card which suffers from very slow transfer rates, you may also wish to toggle the appropriate Options flag.

In order for NFS installation to work, the server must support subdir mounts, e.g., if your FreeBSD 3.4 distribution directory lives on:ziggy:/usr/archive/stuff/FreeBSD, then ziggy will have to allow the direct mounting of /usr/archive/stuff/FreeBSD, not just /usr or /usr/archive/stuff.

In FreeBSD's /etc/exports file, this is controlled by the -alldirs. Other NFS servers may have different conventions. If you are getting ``permission denied'' messages from the server, then it is likely that you do not have this enabled properly.

2.2.1.6.2. Before Installing via FTP

FTP installation may be done from any FreeBSD mirror site containing a reasonably up-to-date version of FreeBSD. A full list of FTP mirrors located all over the world is provided during the install process.

If you are installing from an FTP site not listed in this menu, or are having trouble getting your name server configured properly, you can also specify a URL to use by selecting the choice labeled ``Other'' in that menu. You can also use the IP address of a machine you wish to install from, so the following would work in the absence of a name server:

    ftp://209.55.82.20/pub/FreeBSD/4.1.1-RELEASE

There are three FTP installation modes you can choose from: active or passive FTP or via a HTTP proxy.

FTP Active

This option will make all FTP transfers use ``Active'' mode. This will not work through firewalls, but will often work with older FTP servers that do not support passive mode. If your connection hangs with passive mode (the default), try active!

FTP Passive

This option instructs FreeBSD to use ``Passive'' mode for all FTP operations. This allows the user to pass through firewalls that do not allow incoming connections on random port addresses.

FTP via a HTTP proxy

This option instructs FreeBSD to use the HTTP protocol (like a web browser) to connect to a proxy for all FTP operations. The proxy will translate the requests and send them to the FTP server. This allows the user to pass through firewalls that do not allow FTP at all, but offer a HTTP proxy. In this case, you have to specify the proxy in addition to the FTP server.

Note: There is another type of FTP proxy other tha HTTP proxies. This type is very uncommon, though. If you are not absolutely certain, you can assume that you have a HTTP proxy as described above.

For a proxy FTP server, you should usually give the name of the server you really want as a part of the username, after an ``@'' sign. The proxy server then ``fakes'' the real server. For example, assuming you want to install from ftp.FreeBSD.org, using the proxy FTP server foo.bar.com, listening on port 1024.

In this case, you go to the options menu, set the FTP username to ftp@ftp.FreeBSD.org, and the password to your email address. As your installation media, you specify FTP (or passive FTP, if the proxy supports it), and the URL ftp://foo.bar.com:1234/pub/FreeBSD.

Since /pub/FreeBSD from ftp.FreeBSD.org is proxied under foo.bar.com, you are able to install from that machine (which will fetch the files from ftp.FreeBSD.org as your installation requests them.

2.2.1.7. Check your BIOS drive numbering

If you have used features in your BIOS to renumber your disk drives without recabling them then you should read Section 10.2 first to avoid confusion.

2.2.2. Installing FreeBSD

Once you have completed the pre-installation step relevant to your situation, you are ready to install FreeBSD!

Although you should not experience any difficulty, there is always the chance that you may, no matter how slight it is. If this is the case in your situation, then you may wish to go back and re-read the relevant preparation section or sections. Perhaps you will come across something you missed the first time. If you are having hardware problems, or FreeBSD refuses to boot at all, read the Hardware Guide for a list of possible solutions.

The FreeBSD boot floppies contain all of the online documentation you should need to be able to navigate through an installation. If it does not, please let us know what you found to be the most confusing or most lacking. Send your comments to the FreeBSD documentation project mailing list . It is the objective of the installation program (sysinstall) to be self-documenting enough that painful ``step-by-step'' guides are no longer necessary. It may take us a little while to reach that objective, but nonetheless, it is still our objective :-)

Meanwhile, you may also find the following ``typical installation sequence'' to be helpful:

  1. Boot the kern.flp floppy and when asked, remove it and insert the mfsroot.flp and hit return. After a boot sequence which can take anywhere from 30 seconds to 3 minutes, depending on your hardware, you should be presented with a menu of initial choices. If the kern.flp floppy does not boot at all or the boot hangs at some stage, read the Q&A section of the Hardware Guide for possible causes.

  2. Press F1. You should see some basic usage instructions on the menu screen and general navigation. If you have not used this menu system before then please read this thoroughly.

  3. Select the Options item and set any special preferences you may have.

  4. Select a Standard, Express, or Custom install, depending on whether or not you would like the installation to help you through a typical installation, give you a high degree of control over each step, or simply whiz through it (using reasonable defaults when possible) as fast as possible. If you have never used FreeBSD before, the Standard installation method is most recommended.

  5. The final configuration menu choice allows you to further configure your FreeBSD installation by giving you menu-driven access to various system defaults. Some items, like networking, may be especially important if you did a CDROM, tape, or floppy install and have not yet configured your network interfaces (assuming you have any). Properly configuring such interfaces here will allow FreeBSD to come up on the network when you first reboot from the hard disk.

For questions about FreeBSD, e-mail <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.