Installing FreeBSD (Quick and Painless Method)
  Nov 25, 2009

The FreeBSD Handbook covers most FreeBSD installation topics in depth, but the following is exactly the way I install all of my systems. This process is quick and will get you into a system that you can customize to your liking.

Obtaining FreeBSD

As with most open-source operating systems, FreeBSD is freely downloadable from a number of mirror sites around the world. FreeBSD.org hosts an excellent table that will help you choose a mirror for what you want to download.

Unless you have some offbeat architecture (and if you don't know, don't worry about it), you will most likely use the FreeBSD i386 (32bit machines) or amd64 (64bit machines).

Anyways, I usually just download my ISO images from ftp://ftp2.freebsd.org/pub/FreeBSD. When you get to the contents of this FTP directory, you will see the ISO-IMAGES-ARCH-HERE directories. Go into the directory pertaining to your architecture, then to the biggest number, then download FreeBSD *.disc1.iso! Burn this to a CD somehow. Restart your computer, make sure you can boot the CD-ROM drive (go into BIOS and change the boot order if you can't), and follow along.

FreeBSD Install Bootscreen FreeBSD installation language selection

CUSTOM INSTALL

FreeBSD Install Custom FreeBSD Custom Menu

PARTITION

I wanted to use the whole disk, so I opted for hitting A. If you would like to select a partition, use the arrow keys to select what you want and hit C to create a custom sized slice. The default type is fine. Hit Q when you are done.

FreeBSD Partition Table FreeBSD Install

I decided to make this whole disk dedicated to FreeBSD so I chose the standard option. If you would like to boot FreeBSD off an existing boot manager (grub, etc), select the do nothing option to leave the MBR unchanged and you can edit your boot manager after the installation has completed.

FreeBSD Install Boot Manager

LABEL

Most users will be fine with the auto partitioning (A) option, but if you would like to customize the slices, go for it! I would at-least recommend selecting the auto partition option to see the suggestions and back out of any changes by typing U. Then proceed with your custom options.

FreeBSD Label Blank FreeBSD Label

DISTROBUTIONS

Do not worry about selecting anything else here. All you need is the base system, kernel, man pages, and sources. select lib32 compat if you are installing FreeBSD amd64.

Don't feel like you're missing out on anything. We'll load ports, etc after that install.

FreebSD Custom Install FreeBSD Dist Installs

MEDIA

FreeBSD installation CD as Media

COMMIT

You have reached the point where you can really mess up your harddrive if you do not know what you are doing! When you confirm the commit, the installer will do its edits as instructed. If you are sure everything is OK and you have backed up important data (just in case!), press enter.

FreeBSD Commit Confirmation FreeBSD Commit Installation Progress

You're done! Now exit out of everything and restart.

FreeBSD Complete Installation

Get Online

Wired (DHCP)

  1. # ifconfig
  2. <note interface name>
  3. # dhclient <.interface name>

Wired (static IP)

  1. # ifconfig
  2. <note interface name>
  3. # ifconfig <interface name> inet 192.168.5.1 netmask 255.255.255.0
  4. # route add default gw 192.168.5.1
  5. # echo 'nameserver 192.168.5.1' > /etc/resolv.conf

Wireless

With PRE 8.0 FreeBSD releases, you could use the wireless interface directly. Since FreeBSD 8.0, you have to alias the main interface and you configure the alias.

I used ath0 in the example; of course, change this to your wireless interface name! wlan0 is just what we alias it to. This should be the same no matter what.

  1. # ifconfig
  2. <note interface name>
  3. # echo 'wlans_ath0="wlan0"' >> /etc/rc.conf
  4. # echo 'ifconfig_wlan0="WPA DHCP"' >> /etc/rc.conf
  5. # vi /etc/wpa_supplicant.conf
  6. network={
  7.     ssid="wireless SSID here"
  8.     key_mgmt=WPA-PSK
  9.     psk="wpa password here"
  10.     priority=1
  11. }
  12. # /etc/rc.d/netif restart
  13. # ping google.com
  14. <responces hopefully>

I am assuming a DHCP WPA config for the wireless interface. There are tons of docs online to get you started if your sitation is different. Start by reading man wpa_supplicant.conf.

get ports tree

Now that you are online, fetch the latest ports tree and extract it to /usr/ports

  1. # portsnap fetch extract

Now that you have the latest tree, you can do portsnap fetch update from now on to only download the changes.




Post a New Comment

Name

Message

Security
Code

        (case insensitive & space between words)