Official PacBSD Install Guide

From PacBSD Wiki
Jump to: navigation, search

This document is a guide for installing PacBSD from the live system booted with the installation media. Most help can be found on the wiki or through the various programs' man pages; see pacbsd(7) for an overview of the configuration. For interactive help, the IRC channels and the forums are also available.


Download and boot the installation medium as explained in Category:Getting and installing PacBSD, then proceed with the rest of this guide.

The installation process requires a working internet connection as each install uses the latest packages available in the remote repositories.

Set the keyboard layout

The default keyboard layout is US English Qwerty. This can be changed with the kbdmap command, which will present a list of available layouts.

Note: This change only affects the live system, when the system is rebooted this will be reset. To see how to make this change permanent see #Post-installation

Change virtual console resolution

If the default console resolution doesn't match the monitor's native resolution vidcontrol can be used to alter this.

To list all available modes use:

vidcontrol -i mode

To change the current resolution use the following command, replacing the XXX with a mode number from the previous command

vidcontrol MODE_XXX

Connect to the Internet

The live system is configured to use DHCP via dhclient on available network interfaces by default.

Verify a connection was established if none is available, proceed to configure the network to see how to manually configure it.

Update the system clock

TODO (maybe add directions to configure ntpd?)

Partition the disks

See Partitioning for details; if wanting to create any stacked block devices for disk encryption do it now.

Format the partitions

See File systems and optionally Swap for details.

Mount the partitions

Mount the root partition on /mnt, and activate your swap partition if you want them to be detected later by genfstab.


Select the mirrors

Install the base packages

Use the Pacstrap script to install the base group:

# pacstrap /mnt base

Other packages or groups can be installed by appending their names to the above command (space separated), possibly including the boot loader.

If planning on installing packages outside the official repositories, such as through the PUR or other means, then it is recommended to install the base-devel as well.

Configure the system

After the install process is complete, the install needs to be configured. To do so chroot into the system with: # arch-chroot /mnt

Enable ZFS kernel module

If using ZFS then the kernel module needs to be loading during system boot. to do this add the following to /boot/loader.conf



Making sure to use the correct name of the dataset that contains the root filesystem.

Update fstab

The fstab needs manually with an editor such as ee or vi. Any Swap or filesystems created earlier will need to be added.

Note: If using ZFS then only swap and non-ZFS partitions need added. The system will automount the dataset/subvolumes automatically when it imports the pool.

Example fstab entry

/dev/ada0p2      none        swap   sw 0 0
/dev/ada0p3      /           ufs    rw 1 1

Enable ZFS service

In order for the ZFS pool(s) to be imported and mounted during boot the ZFS service needs to be enabled on the system.

# sysrc zfs_enable="YES"
# rc-update add zfs default

Connect to the Internet

By default the network settings from the live installation environment in not carried over. To ensure that a connection will be available upon first boot, it will need to be configured while inside the jail. See configure the network for details on setting this up.

Set timezone

# ln -s /usr/share/zoneinfo/zone/subzone /etc/localtime

Replacing zone with Country/Content name (America/Europe/Japan/etc), and subzone with timezone information.

Enabling time synchronization

To enable time synchronization on the system see Time#Time_synchronization

Set Hostname

# sysrc hostname="hostname"
# echo 'hostname="MyHostname"' > /etc/conf.d/hostname

Set system locales

To change the system locale, example setting the system to UTF-8, first check if the desired locale is available for your language and country.

$ locale -a | grep '\.UTF-8$'

The above will return a list of all languages available under UTF-8

Once the locale availability has been confirmed, edit /etc/login.conf make the following changes:


--- /usr/src/etc/login.conf     2011-03-10 13:48:59.000000000 -0800
+++ /etc/login.conf     2011-05-08 16:44:01.000000000 -0700
@@ -26,7 +26,7 @@
-       :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES:\
        :path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\
@@ -44,7 +44,9 @@
-       :umask=022:
+       :umask=022:\
+       :charset=UTF-8:\
+       :lang=en_US.UTF-8:

Then rebuild the login class capabilities database:

# cap_mkdb /etc/login.conf

Set console keymap

To permanently set the console keymap to something other than US QWERTY:

Note: List of available keymaps can be found in /usr/share/syscons/keymaps/ or usr/share/vt/keymaps/
# sysrc keymay=<keymap>
# Set the keymap to "uk.iso".

Set root password

# passwd

Exit the chroot

# exit

Copy ZFS pool cache and set bootfs property

If using ZFS the pool cache information needs to be copied from the live environment to the system:

# cp /boot/zfs/zpool.cache /mnt/boot/zfs/zpool.cache

Install a bootloader

The bootloader tells the system where it should boot from. Setting this differs based on whether the root filesystem uses UFS2 or ZFS

Installing the bootcode for GPT partition layout
# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0
Installing the bootcode for MBR partition layout
# gpart bootcode -b /boot/boot0 ada0
# gpart bootcode -b /boot/boot ada0s1

If you want to use FreeBSDs bootloader as the primary bootloader

# gpart set -a active -i 1 ada0
Installing the bootcode for GPT partition layout
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i1 ada0
Installing the bootcode for MBR partition layout

If using MBR partition based layout the ZFS pool will need to first be unmounted

# zpool export tank

Then install the bootcode with

# gpart bootcode -b /boot/boot0 ada0
# dd if=/boot/zfsboot of=/dev/ada0s1 count=1
# dd if=/boot/zfsboot of=/dev/ada0s1a skip=1 seek=1024
Setting bootfs ZFS property

Set the bootfs property tank/ROOT/pacbsd:

# zpool set bootfs=tank/ROOT/pacbsd tank


Unmount all the partitions with umount -R /mnt then restart the machine with reboot. Remember to remove the installation media then login into the new system with the root account.


See Post Installation Recommendations for system management suggestions and post-installation tutorials.