Latest interface: 0.3.1
Latest system: 010

Navigation: back to Installation Guide - Forward to ZFS Guide


This guide covers setting up FreeBSD just after installation, and covers aspects of packages, shell and network.

The login screen
After having installed, you should have booted your real FreeBSD install. You should be able to login with the root user, with has no password set yet:

(image loading)


Setting the root password
When logged in with root, give it a password:
passwd


Network
The first thing i generally do is setup the network:

(image loading)
ping google.com
ifconfig
dhclient em0
ping -c 1 google.com
If that works, you have an internet connection.


Ports
Now we can setup our ports tree. This is a collection of software that is ported to FreeBSD and can be installed easily. Ports differ from packages in that you need to compile them, which takes longer than just extracting a package and copy the binary files over. To get the portstree on your harddrive you can use portsnap to download a snapshot of the ports-tree, which is changing everyday with new and updated ports.
portsnap fetch
portsnap extract


Installing the bash shell
As i prefer the Bash shell over anything else, it is some of the first ports i install on a new system:
cd /usr/ports/shells/bash
make install clean
Now to make use of the new shell:
rehash
bash
export EDITOR=ee
vipw
Now you're inside the ee editor in the system password file. Here you can change the default shell for root, so it starts bash instead of the default csh shell. To do this, look for the line beginning with root and look at the end of this line for the text "/bin/csh". Replace it to say "/usr/local/bin/bash". Now press escape-enter-enter to exit and save.


Setting up rc.conf
An important file is the /etc/rc.conf configuration file, which controls which programs and services are started at boot time and holds many important options, such as those related to network configuration. So go ahead and edit it:
ee /etc/rc.conf
The basic minimum is the network configuration:
# Network
hostname="bsd"
ifconfig_em0="DHCP"
You may also want various services to start at boot time:
# Local services
zfs_enable="YES"
powerd_enable="YES"

# Network services
sshd_enable="YES"
samba_enable="YES"
istgt_enable="YES"

# NFS
rpcbind_enable="YES"
nfs_server_enable="YES"
mountd_enable="YES"
mountd_flags="-r"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"

# Synchronise time
ntpdate_enable="YES"
ntpdate_hosts="ntp.myisp.com"

# disable Sendmail
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
Save the file with escape-enter-enter. Note that you still need to install Samba and the istgt daemon to actually make use of them.


Setting up /boot/loader.conf
Another important file is the loader.conf, which is used at early boot to include kernel level devices and tweaks. A number of useful ZFS tweaks go inside here. Also, the AHCI needs to be enabled in this special file. Go ahead and create it:
ee /boot/loader.conf
It shouldn't exist yet, add the following data:
# enable AHCI driver
ahci_load="YES"

# tweak useful for some virtualization engines
#kern.hz="100"

# kernel memory - not required on amd64 and FreeBSD8+
#vm.kmem_size="4000m"
#vm.kmem_size_max="4096m"

# ZFS tweaks
#vfs.zfs.arc_meta_limit="512m"
#vfs.zfs.arc_min="512m"
#vfs.zfs.arc_max="2048m"
#vfs.zfs.zfetch.array_rd_sz="16m"
#vfs.zfs.zfetch.block_cap="512"
#vfs.zfs.vdev.min_pending="4"
#vfs.zfs.vdev.max_pending="64"
All lines starting with a # character will be skipped; they are 'commented out' and inactive. This allows you to remember the settings and enable them when you need them.

IMPORTANT! Since you've enabled the AHCI driver, your device names may change, including that of your system disk used for booting. This may create problems if you reboot and the device has another name. If your system disk is connected to an AHCI-enabled Serial ATA port, you need to update the /etc/fstab file:
ee /etc/fstab
This will show the UFS filesystems in use for the base system. The important entries are for the root filesystem ('/') and the filesystems /usr /home /var /tmp. Where it may say 'ad0' or 'ad4', you may need to change that to 'ada0' instead. If your system-disk is not conencted to an AHCI-enabled Serial ATA port, then you need no change here.

Now reboot to activate all the changes. Then continue to the ZFS guide for FreeBSD.

Valid XHTML 1.1