Official PacBSD Install Guide
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.
Contents
- 1 Pre-installation
- 2 Installation
- 2.1 Select the mirrors
- 2.2 Install the base packages
- 2.3 Configure the system
- 2.3.1 Enable ZFS kernel module
- 2.3.2 Update fstab
- 2.3.3 Enable ZFS service
- 2.3.4 Connect to the Internet
- 2.3.5 Set timezone
- 2.3.6 Enabling time synchronization
- 2.3.7 Set Hostname
- 2.3.8 Set system locales
- 2.3.9 Set console keymap
- 2.3.10 Set root password
- 2.3.11 Exit the chroot
- 2.3.12 Copy ZFS pool cache and set bootfs property
- 2.4 Install a bootloader
- 2.5 Reboot
- 3 Post-installation
Pre-installation
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.
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.
Installation
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
/boot/loader.conf
... zfs_load="YES" vfs.root.mountfrom="zfs:tank/ROOT/pacbsd"
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.
Example fstab entry
/etc/fstab
/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.
FreeBSD-init
# sysrc zfs_enable="YES"
OpenRC
# 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
Freebsd-init
# sysrc hostname="hostname"
OpenRC
# 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:
/etc/login.conf
--- /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 @@ :passwd_format=md5:\ :copyright=/etc/COPYRIGHT:\ :welcome=/etc/motd:\ - :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES:\ + :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES,LC_COLLATE=C:\ :path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\ :nologin=/var/run/nologin:\ :cputime=unlimited:\ @@ -44,7 +44,9 @@ :pseudoterminals=unlimited:\ :priority=0:\ :ignoretime@:\ - :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:
FreeBSD-init
# sysrc keymay=<keymap>
OpenRC
/etc/conf.d/syscons
... # Set the keymap to "uk.iso". keymap="<keymap>"
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
UFS
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
ZFS
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
Reboot
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.
Post-installation
See Post Installation Recommendations for system management suggestions and post-installation tutorials.