Install FreeBSD 14.1 (Short and Sweet Version)

Last edited on 2024-07-13 Tagged under  #freebsd   #bsd   #zfs 

FreeBSD beastie

The FreeBSD Handbook has an extensive chapter on installing FreeBSD that covers a wide range of scenarios with descriptions of each possible choice. Its an invaluable resource maintained by volunteer contributors.

After performing a few installs, these are my personal notes of steps taken and choices made. A distilled, short and sweet version of the above Handbook.

Target device in this HOWTO is a Thinkpad X230 with 8GB RAM, 512GB SATA SSD, with Intel integrated ethernet+wireless. Architecture is amd64.

There is always more than one way to do it. This is mine. 😃

1. Prepare install media

Prepare a USB flash drive as an installer using either Ventoy or dd.

Download FreeBSD-14.1-RELEASE-amd64-disc1.iso and CHECKSUM.SHA256-FreeBSD-14.1-RELEASE-amd64 from RELEASES.

Image FreeBSD-14.1-RELEASE-amd64-disc1.iso contains all of the files needed to install FreeBSD, its source, and the Ports Collection, and SHA256 is a checksum used to verify the downloaded iso is identical to the original.

Verify:

$ sha256sum -c --ignore-missing CHECKSUM.SHA256-FreeBSD-14.1-RELEASE-amd64
FreeBSD-14.1-RELEASE-amd64-disc1.iso: OK

Prepare a USB storage device as an installer. Write the install image to an unmounted USB storage device using the dd command as root.

BE VERY CAREFUL TO NOTE THE PROPER DEVICE. ALL DATA ON THE DEVICE WILL BE OVERWRITTEN.

Example: On a Linux system, if a USB stick appears as sdx1, then write the installer to sdx (no partition number):

# dd if=/path/to/FreeBSD-14.1-RELEASE-amd64-disc1.iso of=/dev/sdx bs=1M conv=sync

2. Install

Insert and boot install media on target device.

On the Thinkpads, pressing F12 at boot (usually) will enter a menu where you can select the USB install stick as the boot target.

Install FreeBSD using the text-based installation program bsdinstall.

FreeBSD boot loader menu

Steps:

  • [Enter] for Boot Multi user
  • Choose [Install]
  • Keymap Selection: Default is US keyboard map. I prefer the Colemak layout: (*) Colemak ergonomic alternative.
  • Set Hostname: <new_name_for_device>.localdomain
  • Optional system components to install:
    • [*] kernel-dbg
    • [*] lib32
    • [*] ports
    • [*] src
  • Partitioning: Auto (ZFS) Guided Root-on-ZFS
  • ZFS Configure Options: Keep default options, adding ...
    • Pool Type/Disks: stripe: 1 disk
      • [*] ada0 for SATA, [*] nda0 for NVME
    • Encrypt Disks? YES
    • Swap Size <Amount_of_RAM * 2>
    • Encrypt Swap? YES
    • Enter encryption passphrase. Retype to confirm.
  • New password for root. Retype to confirm.
  • Select network interface: em0 (ethernet - Intel)
    • Configure IPv4 for this interface? [ Yes ]
      • Use DHCP? [ Yes ]
    • Configure IPv6 for this interface? [ No ]
    • Resolver Configuration
      • Search lan
      • IPv4 DNS #1 <ip_address>
  • Clock set to UTC? [ Yes ]
  • Time Zone Selector: America - Canada - Eastern EDT
  • Set Date
  • Set Time [ Skip ] (let NTP set on reboot)
  • Services to be started at boot:
    • [*] local_unbound
    • [*] sshd
    • [*] ntpd
    • [*] powerd (for laptops)
    • [*] dumpdev
  • System security hardening options: select all
  • Add user? < Yes >
    • Username
    • Full name
    • Uid: <enter>
    • Login group: <enter>
    • Other groups?: wheel
    • Login class: <enter>
    • Shell: sh
    • Home directory: <enter>
    • Home directory permissions: <enter>
    • Enable ZFS encryption?: no
    • Use password-based authentication? yes
    • Use an empty password? no
    • Use a random password? no
    • Enter password. Retype to confirm.
    • Lock out account after creation? no
    • Add another user? no
  • Final Configuration: Exit
  • Manual Configuration: < No >
  • [ Reboot ]

3. First boot

NOTE: Keyboard at boot reverts back to default US keyboard.

System begins boot and prompts for encryption passphrase. Upon successful entry, boot continues to login:. Enter the username and account passphrase created during the install.

To read boot messages after login:

$ less /var/run/dmesg.boot

Show the version of FreeBSD installed:

$ freebsd-version ; uname -a

List system partitions:

$ gpart show

4. Shutdown

Switch to root, then power off the system:

$ su
Password:
# shutdown -p now

5. After the install

Now what? These are some extra steps I take after installing FreeBSD.

You can like, share, or comment on this post on Mastodon 💬

Thanks for reading! Read other posts?

» Next: Minimal Debian Bookworm

« Previous: Create a USB stick with multiple Linux install images using Ventoy