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
- Boot from the FreeBSD installation CD.
- 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
- Create a Slice:
- Use the slice editor to create a single slice on your drive. Multiple slices are possible but add unnecessary complexity.
- Install the MBR:
- Choose the drive(s) to install the FreeBSD boot loader.
- 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
- Network Configuration:
- Choose the correct network interface (named after its driver, e.g.,
em0for Intel Ethernet). - Follow the prompts to configure your network settings.
- Choose the correct network interface (named after its driver, e.g.,
- System Console Configuration:
- This section is optional. You can explore it later if desired.
- Time Zone:
- Select your region. If you’re in the U.S., hit the End key to jump to the bottom of the list.
- Linux Compatibility:
- Skip this for now. We’ll enable Linux binary support later.
- Mouse Configuration:
- Enable the moused daemon for mouse support.
- Package Installation:
- Skip installing binary packages. They’re outdated, and we’ll update the system manually.
- 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/tcshif preferred.
- 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.orgwith 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
CPUTYPEto your CPU (e.g.,CPUTYPE?=athlon-xp). - Set
CFLAGSto-O2for optimized builds.
5. Build and Install the System
- Build the base system:
cd /usr/src make buildworld - Build a custom kernel:
- Copy the default kernel configuration:
cd /usr/src/sys/i386/conf cp GENERIC MY_KERNEL - Edit
MY_KERNELto add sound support:device pcm - Build and install the kernel:
make buildkernel KERNCONF=MY_KERNEL make installkernel KERNCONF=MY_KERNEL
- Copy the default kernel configuration:
- Update
/etcand 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.
- Update the ports tree:
- Edit
/usr/ports-supfileto specify a CVSUP server. - Run CVSUP:
cvsup /usr/ports-supfile
- Edit
- Install software:
- Navigate to the desired port (e.g.,
/usr/ports/www/firefox). - Run:
make install clean
- Navigate to the desired port (e.g.,
- Enable Linux binary support:
- Install the
linux_baseport:cd /usr/ports/emulators/linux_base make install clean - Enable Linux support in
/etc/rc.conf:linux_enable="YES"
- Install the
- 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 cleanor
cd /usr/ports/x11/kde3 make install clean
- Install X.Org:
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.