Install FreeBSD (Short and Sweet Version)

Part of the "Exploring FreeBSD on a Laptop" series.
Tested on FreeBSD 14.3
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 short and sweet version of the above Handbook HOWTO.
Start Here
Throughout this guide, if you see square brackets []
in code blocks, that means the word of code (square brackets included) should be replaced with something else. This is detailed in the instructions before or after the code block.
This guide makes a few assumptions:
- Target device is amd64 architecture with >= 8GB RAM
- System uses UEFI to boot and a GPT partition table
- FreeBSD install media prepared on a Linux-based system
- FreeBSD is the sole OS on a single disk
- FreeBSD uses
Root-on-ZFS
file system with encryption - Network access during install uses a supported wired interface
Download the RELEASE install image and the CHECKSUM
file for verification:
$ wget -c https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/14.3/FreeBSD-14.3-RELEASE-amd64-memstick.img
$ wget https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/14.3/CHECKSUM.SHA512-FreeBSD-14.3-RELEASE-amd64
Verify the image using sha512sum
:
$ sha512sum -c --ignore-missing CHECKSUM.SHA512-FreeBSD-14.3-RELEASE-amd64
FreeBSD-14.3-RELEASE-amd64-memstick.img: OK
Plug in a USB stick and identify its device label:
$ lsblk -f
If the USB stick is mounted, unmount the device:
# umount /dev/[device_label]
For example, if the USB stick is mounted as sde1
:
# umount /dev/sde1
NOTE
Be very careful to note the proper device. All contents on the device will be lost!
Write the install image to the USB stick using the dd(1) command:
# dd if=FreeBSD-14.3-RELEASE-amd64-memstick.img of=/dev/[device_label] bs=4M conv=fsync oflag=direct status=progress
Using the previous example of sde1
, this command would replace [device_label]
with sde
(omit the partition number):
# dd if=FreeBSD-14.3-RELEASE-amd64-memstick.img of=/dev/sde bs=4M conv=fsync oflag=direct status=progress
Wipe Disk
Boot target device from the install media. In the FreeBSD Boot Menu press s
to select the Boot Single user
mode.
Wipe all existing content from the target disk for our brand spanking new FreeBSD installation.
Use geom(8) to identify disks:
# geom disk list
IDE/SATA/SSD disk names start with ad
and NVMe disks with nd
. Example: My laptop's internal storage disk is a SATA SSD and is identified as Name: ada0
.
Use dd
to overwrite the entire disk with zeroes:
# dd if=/dev/zero of=/dev/[disk_label] bs=4M conv=fsync oflag=direct status=progress
Using the previous example of ada0
, this command would replace [disk_label]
with:
# dd if=/dev/zero of=/dev/ada0 bs=4M conv=fsync oflag=direct status=progress
This operation will take a bit of time. On my 233G SSD, for example, it took approximately 14 minutes to zero out the disk.
Installation
After the wipe operation is finished, enter the reboot
command to return to the Boot Menu. Press <Enter>
to launch the installer.
At the Welcome screen choose Install
.
Steps:
- Keymap Selection: Default is standard
US
keyboard map. Press<enter>
to continue or select an alternative from the list. - Set Hostname:
[new_name_for_device].home.arpa
# example:bsdbox.home.arpa
- Optional system components to install:
[*] kernel-dbg
[*] lib32
- Partitioning:
Auto (ZFS) Guided Root-on-ZFS
- ZFS Configuration:
- Pool Type/Disks:
stripe: 1 disk
# first disk is[*] ada0
for SATA and[*] nda0
for NVME - Pool Name
zroot
- Force 4K Sectors?
YES
- Encrypt Disks?
YES
- Partition Scheme?
GPT
- Swap Size
[2x RAM]
# example:16g
on system with 8GB RAM - Mirror Swap?
NO
- Encrypt Swap?
YES
- Select
>>> Install Proceed with Installation
- Select
YES
to destroy current contents of target disk - Enter encryption passphrase. Retype to confirm.
- Pool Type/Disks:
- New password for root. Retype to confirm.
- Network interface:
[auto-detected ethernet]
# example: Intel network deviceem0
- Configure IPv4 for this interface?
Yes
- Use DHCP?
Yes
- Use DHCP?
- Configure IPv6 for this interface?
No
- Resolver Configuration
- Search
home
- IPv4 DNS #1
<ip_address>
- IPv4 DNS #2
<ip_address>
- Search
- Configure IPv4 for this interface?
- Clock set to UTC?
Yes
# my computers are always set to UTC; if uncertain, chooseNo
- Time Zone Selector:
[region]
# example:America - Canada - Eastern - ON & QC (EDT)
- Time and Date
- Set Date
Skip
- Set Time
Skip
# NTP will set on reboot
- Set Date
- Services to be started at boot:
[*] sshd
[*] ntpd
[*] powerd
&emsp # for laptops[*] dumpdev
- System hardening:
[*] clear_tmp
[*] secure console
- Firmware installation: # install all packages
- Add user account?
Yes
- Username:
[username]
# example:foo
- Full name:
<enter>
- Uid:
<enter>
- Login group:
<enter>
- Other groups?:
wheel
- Login class:
<enter>
- Shell:
<enter>
- Home directory:
<enter>
- Home directory permissions:
<enter>
- Enable ZFS encryption?:
no
# encrypted Root-on-ZFS already enabled - Use password-based authentication?
<enter>
- Use an empty password?
<enter>
- Use a random password?
<enter>
- Enter password. Retype to confirm.
- Lock out account after creation?
<enter>
- OK?
<enter>
- Add another user?
<enter>
- Username:
- Final configuration:
Exit Apply configuration and exit installer
- Manual configuration:
No
- Complete:
Reboot
NOTE
During boot, when prompted for the encryption passphrase - regardless of the keymap set during install - enter the correct passphrase referencing the US
keymap:
GELI Passphrase for <disk>:
Upon success, boot resumes....
FreeBSD/amd64 (<hostname>.home.arpa) (ttyv0)
login: root
Password:
Welcome to FreeBSD!
To shutdown/poweroff the system:
# shutdown -p now
Next: After the First Boot
You can like, share, or comment on this post on Mastodon 💬
» Next: Upgrading FreeBSD
« Previous: Roll your own FreeBSD Desktop Using Openbox