2025/02/16

Topic 711: BSD Installation and Software Management

This topic covers installing and upgrading the major BSD operating systems (FreeBSD, NetBSD, and OpenBSD), managing packages or ports, configuring system startup, handling hardware configuration, and setting kernel parameters/security levels.


711.1: BSD Operating System Installation

Key knowledge areas

FreeBSD installation

  1. Prepare installation media
    • Create a bootable ISO or USB stick.
  2. Boot from installation media
    • At the FreeBSD boot menu, proceed with the default selection.
  3. Start the installer
    bsdinstall

    The installer will guide you through partitioning (GPT recommended), selecting distributions (base, kernel, etc.), and configuring network/time zone/services.

  4. Set the root password
    • The installer prompts you to create a strong root password.
  5. Reboot
    • After installing, remove the installation media and reboot into your new FreeBSD system.
Tip: Common partitions on FreeBSD

Upgrading FreeBSD

Use the built-in freebsd-update utility to apply security patches or upgrade to a newer release:

freebsd-update fetch
freebsd-update install

If a new kernel is installed, you may need to reboot and re-run freebsd-update install to complete the process.

Checking the BSD version

uname -a

Outputs kernel name, hostname, version, and other info. Useful for verifying you’re on the correct FreeBSD, NetBSD, or OpenBSD release.

NetBSD installation

  1. Boot from installation media
    • NetBSD’s sysinst utility starts automatically.
  2. Partition the disk
    • Choose MBR or GPT.
  3. Select base sets
    • e.g., base, etc, comp, man, etc.
  4. Configure networking
    • Set hostname, enable DHCP (if needed), etc.
  5. Set root password and time zone
  6. Reboot
    • Remove installation media and boot into your new NetBSD system.

OpenBSD installation

  1. Boot from installation media
    • The OpenBSD installer starts automatically.
  2. Disklabel partitioning
    • OpenBSD uses disklabel for partitioning. The installer will prompt you to create partitions for /, swap, /home, etc.
  3. Configure root password, user accounts, and networking
  4. Finish and reboot
    • Remove installation media. OpenBSD will now boot into the newly installed system.

Note: The minimal installer bsd.rd is used for both installations and upgrades.

Upgrading OpenBSD

  1. Reboot into bsd.rd
  2. Choose (u)pgrade from the text menu
  3. Follow prompts for sets, disk, etc.
  4. Reboot once done

711.2: BSD Software and Package Management

Objective summary
The candidate should be able to install, query, remove, and upgrade software on BSD systems, using both binary package management and source-based ports/pkgsrc.

Key knowledge areas

FreeBSD packages and ports

Binary package management:

# Install a package
pkg install <package_name>

# List installed packages
pkg info

# Remove a package
pkg delete <package_name>

# Upgrade installed packages
pkg upgrade

Compiling from ports

  1. Ensure ports tree is updated (e.g., portsnap fetch update).
  2. Navigate to /usr/ports/category/<portname> and run:
    make install clean

NetBSD (pkgsrc)

Binary packages:

pkg_add <package_name>    # install
pkg_info                  # list installed
pkg_delete <package_name> # remove

# Check package integrity or vulnerabilities:
pkg_admin check
pkg_admin check-pkg-vulnerabilities /var/db/pkg/pkg-vulnerabilities

Compiling from pkgsrc:

cd /usr/pkgsrc/<category>/<portname>
make install clean

OpenBSD packages and ports

Binary packages:

pkg_add <package_name>
pkg_info
pkg_delete <package_name>

Compiling from ports:

cd /usr/ports/<category>/<portname>
make install
Tip: Checking for updates & security alerts

711.3: BSD System Startup Configuration

Objective summary
Understand how the BSD boot process works, manage services, and configure which daemons start at boot. Know how to reboot, shut down, or enter single-user mode.

Key knowledge areas

Boot process overview

Common startup configuration

Managing services on different BSDs

FreeBSD

service sshd start
service sshd stop
service sshd status
# Enable service at boot:
echo 'sshd_enable="YES"' >> /etc/rc.conf

NetBSD

service sshd start
service ntpd status
# Similarly use /etc/rc.conf for enabling services

OpenBSD

rcctl enable sshd
rcctl disable ntpd
rcctl start sshd
rcctl stop httpd

Note: rcctl modifies /etc/rc.conf.local behind the scenes.

Single-user mode

At the bootloader prompt, specify -s (or use boot -s) to enter single-user mode (useful for maintenance or emergency repairs).


711.4: Hardware Configuration

Objective summary
Investigate system hardware, manage kernel modules, and understand how BSD handles PCI, ATA, and SCSI devices.

Key knowledge areas

Common tools

FreeBSD examples

# List loaded kernel modules
kldstat

# Load a module
kldload if_bridge

# Unload a module
kldunload if_bridge

# Check PCI devices
pciconf -lv

# SCSI details
camcontrol devlist

NetBSD examples

# List loaded modules
modstat

# Load a module
modload /path/to/module

# Unload a module
modunload <module_name>

# PCI devices
pcictl pci0 list

# SCSI scanning
scsictl scsibus0 scan

OpenBSD examples


711.5: BSD Kernel Parameters and System Security Level

Objective summary
Understand and configure kernel parameters (via MIBs) and BSD security levels. Know how to view and set parameters at runtime or permanently.

Key knowledge areas

Kernel MIBs (management information base)

Security levels

OpenBSD note

On OpenBSD, you can also configure the securelevel in /etc/boot.conf or via boot-time options. Higher levels can prevent even root from altering certain files or kernel parameters at runtime.