A Step-by-Step Guide to Installing FreeBSD 5.x

This guide is designed for users with moderate Linux experience and will walk you through installing and setting up a fully updated FreeBSD 5.x system. FreeBSD is a powerful, Unix-like operating system known for its stability, performance, and advanced features. Let’s get started!

A. FreeBSD 5.x vs 4.x

FreeBSD has two development branches:

  • 4.x (STABLE): Well-tested and solid, but lacks the latest technology.
  • 5.x (CURRENT): The “unstable” branch, but currently stable and feature-rich.

For most users, FreeBSD 5.x is the way to go. These instructions are tailored for the 5.x branch.

Note: DragonFlyBSD (www.dragonflybsd.org) is a continuation of the 4.x line with innovative features like lock-less SMP support. However, it’s still in the R&D phase and not recommended for production use.

B. Getting the Installation Media

Download the miniinst ISO from a FreeBSD mirror (available at www.freebsd.org). This ISO includes everything you need for a base system installation.

C. Starting the Installation

  1. Boot from the FreeBSD installation CD.
  2. You’ll enter the sysinstall tool. Choose Standard Installation for a straightforward setup.

D. Hard Disk Management in FreeBSD

FreeBSD uses a different naming convention for drives:

  • IDE drives: ad0, ad1, etc.
  • SCSI drives: da0, da1, etc.

FreeBSD also uses slices (similar to partitions) and partitions within slices. For example, the first partition in the first slice on the first IDE drive is ad0s1a.

E. Partitioning

  1. Create a Slice:
    • Use the slice editor to create a single slice on your drive. Multiple slices are possible but add unnecessary complexity.
  2. Install the MBR:
    • Choose the drive(s) to install the FreeBSD boot loader.
  3. Create Partitions:
    • At a minimum, create a root partition and a swap partition.
    • Enable soft-updates on non-swap partitions for better performance.

F. Distribution Sets

Select Minimal for the base system. We’ll build the rest manually for a fully updated system.

G. Continuing the Installation

  1. Network Configuration:
    • Choose the correct network interface (named after its driver, e.g., em0 for Intel Ethernet).
    • Follow the prompts to configure your network settings.
  2. System Console Configuration:
    • This section is optional. You can explore it later if desired.
  3. Time Zone:
    • Select your region. If you’re in the U.S., hit the End key to jump to the bottom of the list.
  4. Linux Compatibility:
    • Skip this for now. We’ll enable Linux binary support later.
  5. Mouse Configuration:
    • Enable the moused daemon for mouse support.
  6. Package Installation:
    • Skip installing binary packages. They’re outdated, and we’ll update the system manually.
  7. User and Root Setup:
    • Add a user and set the root password.
    • Add the user to the wheel group for sudo privileges.
    • Set the shell to /bin/tcsh if preferred.
  8. Reboot:
    • Exit the installer, remove the CD, and reboot.

H. Post-Installation Setup

After logging in, you’ll need to update and customize your system.

1. Install CVSUP

CVSUP is used to update the FreeBSD source tree. Install it with:

pkg_add -r cvsup-without-gui

2. Set Up Configuration Files

Copy and modify the necessary configuration files:

cd /etc
cp /usr/share/examples/etc/make.conf /etc/make.conf
cp /usr/share/examples/cvsup/standard-supfile /usr
cp /usr/share/examples/cvsup/ports-supfile /usr
chmod u+w /etc/make.conf /usr/standard-supfile /usr/ports-supfile

3. Configure CVSUP

Edit /usr/standard-supfile:

  • Replace CHANGE_THIS.FreeBSD.org with a CVSUP server (e.g., cvsup4.FreeBSD.org).

Run CVSUP to update the source tree:

cvsup /usr/standard-supfile

4. Configure make.conf

Edit /etc/make.conf:

  • Uncomment and set CPUTYPE to your CPU (e.g., CPUTYPE?=athlon-xp).
  • Set CFLAGS to -O2 for optimized builds.

5. Build and Install the System

  1. Build the base system:
    cd /usr/src
    make buildworld
  2. Build a custom kernel:
    • Copy the default kernel configuration:
      cd /usr/src/sys/i386/conf
      cp GENERIC MY_KERNEL
    • Edit MY_KERNEL to add sound support:
      device pcm
    • Build and install the kernel:
      make buildkernel KERNCONF=MY_KERNEL
      make installkernel KERNCONF=MY_KERNEL
  3. Update /etc and install the base system:
    mergemaster -p
    make installworld
    reboot

I. Setting Up the Ports System

The ports system allows you to install software from source.

  1. Update the ports tree:
    • Edit /usr/ports-supfile to specify a CVSUP server.
    • Run CVSUP:
      cvsup /usr/ports-supfile
  2. Install software:
    • Navigate to the desired port (e.g., /usr/ports/www/firefox).
    • Run:
      make install clean
  3. Enable Linux binary support:
    • Install the linux_base port:
      cd /usr/ports/emulators/linux_base
      make install clean
    • Enable Linux support in /etc/rc.conf:
      linux_enable="YES"
  4. Install a desktop environment (optional):
    • Install X.Org:
      cd /usr/ports/x11/xorg
      make install clean
    • Install GNOME or KDE:
      cd /usr/ports/x11/gnome2
      make install clean

      or

      cd /usr/ports/x11/kde3
      make install clean

Conclusion

Congratulations! You now have a fully updated FreeBSD 5.x system. With the ports system, you can install a wide range of software to customize your system further. Whether you’re building a server or a desktop, FreeBSD offers unparalleled flexibility and performance.

Tags: FreeBSD, Installation Guide, FreeBSD 5.x, Ports System, CVSUP, Kernel Configuration, Linux Binary Support.

Leave a Reply

Your email address will not be published. Required fields are marked *