Installing FreeBSD

Before You Start:

Before you begin your first installation of FreeBSD you should attempt to make an inventory of the components in your computer. We recommend that you write down all information that you can find on your hardware before you begin the installation process. If you already have another Operating System installed such as Windows, we would also suggest that you use this to see how your hardware is already configured with regards to IRQ numbers, IO port address, ip address, dns server, etc.

You should also ensure that you have backed up all essential data that is on your existing hard drive. In this tutorial we will be making the assumption that you are only going to be running FreeBSD on this system and that you will not being using a dual boot with another Operating System.

Now that you have everything ready we can begin by installing the FreeBSD operating system using one of the two methods listed below.

The next two sections will walk you through how to install the OS using either FTP or CDROM.

Installing with FTP:

Here you will learn how to install FreeBSD using FTP. In order to do this you will need to have two blank, formatted floppy disks.

Step 1: Prepare the floppy disks

  1. Obtain floppy images from freebsd ftp site /pub/FreeBSD/REALEASE/floppies/. Typically you just need kern.flp and mfsroot.flp

    eg. Main Site:
    ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/4.5-RELEASE/floppies/kern.flp
    ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/4.5-RELEASE/floppies/mfsroot.flp
    Note: see readme file to make sure you have the files you need

  2. Download the fdimage tool from the same ftp site
    eg. Main Site:
    ftp://ftp.freebsd.org/pub/FreeBSD/tools/fdimage.exe

  3. Prepare the floppies. In this example you will need two HD floppies. Format (there can not be any errors). Use the fdimage tool to install the image files you downloaded using the following command:

    fdimage kern.flp A:
    fdimage mfsroot.flp A:

Step 2: Boot from Floppy

Make sure the BIOS is set to boot from floppy drive. You may also take this time to make any other appropriate changes since you will never need to reboot the system again after install :)
eg.

  • Boot from CD, A, HDD

  • Ignore Keyboard at Prompt
  • Auto Power On
  • etc

Insert kern.flp disk and start machine. When prompted insert mfsroot.flp disk.

You are now ready to contine with the rest of the install and configure your FreeBSD server.

Installing from CDROM:

Here you will learn how to install FreeBSD using your CDROM. In order to do this you will need to purchase (from Walnut Creek) or create a FreeBSD Installation CD and have a system that can boot from your CD.

Step 1: Create the CD

Obtain cd iso from freebsd ftp site /pub/FreeBSD/REALEASE/iso.
eg. Main Site: ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/4.5/4.5-mini.iso

Create the CD using your favorite cd burning software

Of course you can always just purchase the CD from walnut creek.

Step 2: Boot from CD

Make sure the BIOS is set to boot from floppy drive. You may also take this time to make any other appropriate changes since you will never need to reboot the system again after install :)
Example:

  • Boot from CD, A, HDD
  • Ignore Keyboard at Prompt
  • Auto Power On
  • etc

Insert CD and start machine.

Installation Configuration:

Now that you are ready to install the OS you must take this time to configure the install.

Step 1: Kernel Configuration Menu

  1. Start kernel configuration in full-screen visual mode
  2. Use interface to remove any non-existent hardware

Step 2: Sysinstall Main Menu

  1. Custom
    1. Options - DHCP YES
    2. Partition - Set the partition slice and set as bootable
    3. Label - Use Auto Defaults
    4. Distributions - Minimal - YES - Exit
    5. Media - FTP - select server near you - select appropriate nic - DHCP
    6. Set DHCP settings (other info if necessary ie static)
    7. Commit
    8. Make Configuration Changes - root password and user management (username, pass, group=wheel)

Post-Installation Setup:

These are some of the common tasks that we recommend you consider installing or running after you have installed your operating system. Some of the tasks listed are used quite frequently and can be quite benefitial to an administrator.

We suggest that you take the time to read through these suggestions in order to add greater functionality to your server.

Also, if you are unfamiliar with FreeBSD you should know about su command. If you are going to be logging into your server remotely (SSH/Telnet) and need to do administrative tasks you have to be logged in as root. Because of the design of FreeBSD you can not login directly as root. You must first login with the username you created earlier and then once you are connected you can use the su command, enter your password, and now you are logged in as root.

  1. Disable SSH Protocol 1 support
  2. Update all of you ports using CVSup
  3. Install the 'portupgrade' port and configure
  4. Update any installed ports that are out of date
  5. Disable default FTP daemon and install ProFTP.

Also, take a look at the other FreeBSD related tutorials for more information on setting up your server.

Kernel Customization:

The kernel is the brain behind FreeBSD and runs in RAM. By configuring the kernel you can increase the speed of your sever as well as modifing the security and services that it can perform.

Step 1: Find your kernel config files

  1. If you don't find the files in /sys/i386/conf do the following:
    	# /stand/sysinstall
    	Go to Configure
    	Go to Distributions
    	Go to Source
    	Go to Sys, put a tick box in it
    	Click OK
    	Select distribution method, install.
    	
  2. Copy the GENERIC file to a new name (that does NOT start with a number)
    	# cp /sys/i386/conf/GENERIC /sys/i386/conf/(filename)
    	

    Note: GENERIC is what you are using now and LINT has all available options

Step 2: Edit config file

  1. Open the config file you created above:
    	# vi /sys/i386/conf/(filename)
    	
  2. Remove unnecessary CPU lines.
  3. Under ident, change GENERIC to be the name of your new kernel (match file name)
  4. Maxusers - set to 64
  5. Add the following options if you wish to use this box as a router/dhcp server
    	(this enables firewalling and ipfilter)
    	options 	IPFILTER		#Enable ipnat
    	options 	IPFILTER_LOG		#log the ipnat stuff
    	options 	IPFIREWALL
    	options 	IPFIREWALL_DEFAULT_TO_ACCEPT
    	options 	IPFIREWALL_VERBOSE
    	options 	IPFIREWALL_FORWARD
    	options 	IPV6FIREWALL
    	options 	IPV6FIREWALL_VERBOSE
    	options 	IPV6FIREWALL_VERBOSE_LIMIT=100
    	options 	IPV6FIREWALL_DEFAULT_TO_ACCEPT
    	options 	IPFIREWALL_VERBOSE_LIMIT=100
    	
  6. Comment out lines you don't need:
    	Example:
    	#device 	eisa
    	#device 	fd1	at fdc0 drive 1
    	#device 	atapifd 		# ATAPI floppy drives
    	#device 	atapist 		# ATAPI tape drives
    	Anything SCSI if you don't have SCSI
    	Anything that doesn't match your NIC
    	#device xl     # this is the 3c90x line, do NOT comment out
    	
  7. Add lines for devices you DO need, (just for sound cards).
    Note: To find a matching line to add, check the LINT file (may have to add options PNPBIOS).

Step 3: Install the new Kernel

  1. Make the new config file:
    	# config (filename)
    	

    This creates a directory called ../../compile/(filename)
    This directory contains all of your new kernel source code.

  2. Install the new config file:
    	# cd ../../compile
    	# cd (filename)
    	# make depend
    	

    Note: if you get errors, you pulled out the wrong devices or didn't add in a necessary device

    	# make
    	# make install
    	
  3. Reboot the server
    Note: If it doesn't come back, at the boot prompt tell it load kernel.GENERIC and try try again. Check to make sure you didn't miss any devices