This is an archive of past FreeBSD releases; it's part of the FreeBSD Documentation Archive.

Installation Guide

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 install. The following describes what needs to be done prior to each type of installation.

The first thing you should do is 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 Boot Floppies

Please read the installation boot image information before proceeding. To make the installation boot disks from the image files, do the following:

The first thing you will need to do is download the image files. These can be retrieved from the floppies directory of the FreeBSD FTP site or your local mirror.

  • If you are installing from an MS-DOS partition, download the fdimage.exe program or get it from tools\fdimage.exe on the CDROM and then run it like so:

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

    The fdimage program will format the A: drive and then copy kern.flp to it (assuming that you are at the top level of a FreeBSD distribution and the floppy images live in a floppies subdirectory, which is typically the case).

  • If you are using a UNIX-based system to create the boot floppies, do the following:

        # dd if=kern.flp of=disk_device
    

    disk_device is the /dev entry for the floppy drive. On FreeBSD, this is /dev/rfd0 for the A: drive and /dev/rfd1 for the B: drive.

With the kern.flp disk in your floppy drive, reboot your computer. You will be prompted to insert the mfsroot.flp, after which the installation will proceed normally.

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 Walnut Creek CDROM'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 FreeBSD of the set into the drive and reboot your system. You will be put into the install 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 install (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.

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 install.

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 the Windows File Manager format command.

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) illustrate:

    # 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 /s e:\bin c:\FreeBSD\bin\
    C:\> xcopy /s e:\manpages c:\FreeBSD\manpages\

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

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 tar'ed 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. You will also 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. If you are using PAP or CHAP, you will need to type the necessary set authname and set authkey commands before typing term. Refer 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 do not know the answers to all or most of these questions, then you should really probably talk to your system administrator 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://165.113.121.81/pub/FreeBSD/3.4-RELEASE

There are two FTP installation modes you can choose from, active or passive FTP.

FTP Active

For 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

For all FTP transfers, use ``Passive'' mode. This allows the user to pass through firewalls that do not allow incoming connections on random port addresses.

Note: Active and passive modes are not the same as a ``proxy'' connection, where a proxy FTP server is listening and forwarding FTP requests!

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.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 difficulties, there is always the chance you might, 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 on the boot floppy 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 on the floppy 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 Novice, Custom, or Express 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 whizz through it (using reasonable defaults when possible) as fast as possible. If you have never used FreeBSD before, the Novice 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.