Previous Home Next

3.3 Installing FreeBSD 4.7-RELEASE

This Chapter focuses on installing FreeBSD 4.7-RELEASE and multiple-booting the system so that it can coexist successfully with the already existing Windows operating system on the computer. Like the Windows installation, it too focuses on a CD-ROM based installation. Experts may proceed as usual without help, as for the newbies out there, make sure you check out the Frequently Asked Questions for FreeBSD 2.X, 3.X and 4.X at the "The FreeBSD Documentation Project" at For a step-by-step FreeBSD Installation procedure with screenshots, please refer to the Chapter2 : Installing FreeBSD of the FreeBSD Handbook at These and the other documentation available on the FreeBSD Project homepage provides exhaustive and extensive coverage of all aspects related to the FreeBSD software. Make sure you grab as much information as you can from this site before proceeding with this guide.

Readers must note that at the time of writing, 2 parallel branches of the FreeBSD operating system exist. The latest -STABLE release is the FreeBSD 4.7-RELEASE while the latest -CURRENT release is the FreeBSD 5.0-RELEASE. In this Chapter, we would discuss some theoretical aspects of installing FreeBSD 4.7-RELEASE, disk partitioning (better known as slicing in FreeBSD terminology) and then move on to the actual installation itself. Thus, the contents of this Chapter may be categorized in the following sections mentioned below:

  1. Slicing in FreeBSD

  2. Filesystems in FreeBSD

  3. Summary of Installation Steps

1. Slicing in FreeBSD

Before installing FreeBSD, it would be a good idea to take a brief tour of what FreeBSD calls "slicing". If you already know this stuff, feel free to skip this part and read the section entitled "Summary of Installation Steps".

The FreeBSD operating system partitions (a hard disk) and labels partitions according to a particular chosen scheme which is similar to other BSD-based Unix systems such as NetBSD, OpenBSD, Ultrix, Digital Unix and SunOS. Let us see how the FreeBSD software "slices" your hard disk and then "creates partitions in it" for use. Each partition-that-contains-a-filesystem is stored in what FreeBSD calls a "slice". Slice is FreeBSD's term for what were earlier called partitions. Slices are numbered, starting at 1, through to 4 (In Windows terminology, they would be called as "primary partitions", starting at 1, through to 4). Thus, the reader must note that "a primary partition" in Windows refers to a "slice" in FreeBSD terminology, and "an extended partition containing logical disk drives in it" is simply called as "partitions" in FreeBSD terms. A logical disk drive within an extended partition may also be called as "a logical slice inside a physical slice" in FreeBSD. It may appear a bit awkward at times, but the sooner the reader gets used to these terms, the better!

Now, the important part. There exists a few operating systems which can boot even if their corresponding boot files are stored within a logical disk drive of an extended partition. For FreeBSD, this mechanism does "not" work. FreeBSD necessarily needs one of the slices (that is the 4 entries in the partition table on your computer's hard drive, which in Windows terminology would be called as a "primary partition"). It then uses a program called "disklabel" for making upto eight partitions in this slice. The reader must note: You cannot install FreeBSD in an extended partition made by Linux (or DOS).

FreeBSD labels hard drives and partitions as follows:

where, /dev is the directory under the root ("/") directory in FreeBSD which contains all the device special files associated with devices. Readers must note that I assume readers are using a FreeBSD 4.X-RELEASE. IDE hard disk drives are named as wd before the FreeBSD 4.0-RELEASE.

What about SCSI drives? Well, FreeBSD labels that too!

where, /dev is the directory under the root ("/") directory in FreeBSD which contains all the device files associated with devices.

Now, let us talk about the partitioning scheme under FreeBSD. It is just like in Linux, only the way the partitions are named is different. In FreeBSD, we first consider a particular hard disk drive, whether an IDE or a SCSI hard disk drive. Then, we consider the partitions on it. For example, the partitions on an IDE drive are named in the following way (/dev/ad0 is used as an example):

These above mentioned drives may contain partitions as well. FreeBSD labels them too and each label has it's own corresponding mount point too. Let us consider an example. A computer has /dev/ad0 as its hard disk named, contains 2 slices; the first slice is a FAT32 partition and the second a BSD/i386 partition containing 4 logical slices [logical disk drives] in it. So, in this case, how would the partition table look like and mean? Let us see how FreeBSD labels this scheme. FreeBSD would represent this as:

where, ad0s2a refers to the "first partition (a) on the second slice (s2) on the first IDE disk (ad0)". In the above example, /dev/ad0s1 is the slice containing FAT32 filesystem and /dev/ad0s2 is the second slice on the hard disk drive under scrutiny. Readers must note that FreeBSD labels slices from /dev/ad0s1 onwards to /dev/ad0s4, with a maximum of 8 possible logical slices named as a, b, c, d, e, f, g and h. In this example, the "logical slices" a, b, e and f have their corresponding mount points in FreeBSD.

Here, the mount points are as follows:

For more exhaustive information, please refer to the "FreeBSD Handbook".

2. Filesystems in FreeBSD

In the earlier Chapters we have seen that Microsoft Windows operating systems use FAT16, FAT32, NTFS 4.0 and NTFS 5.0. Recently released NTFS 5.0 is implemented in all of the Windows 2000 operating systems. Linux uses the "Third Extended filesystem", denoted as ext3fs. As mentioned earlier, GNU/Linux supported the ext (now obsolete and no longer supported) and ext2 filesystems also. The "Second Extended filesystem" (ext2fs) is an advanced hierarchical filesystem developed for the Linux operating system, which included advanced features like a maximum file size of 2.0 GB, a maximum file name length of 255 characters and support for three time/date stamps. They are the date of creation, date of last modification and date of last access. The "Third Extended filesystem" has all these features, and additionally it implements the "journaled file system architecture" (JFS). The JFS architecture ensures the integrity of data stored on a hard disk in the event of an unplanned shutdown, such as one caused by a power outage. A journaled filesystem maintains a log of all read and write events; this log enables the disk to be restored to its last stable state and additionally allows incompletely written data to be restored to the maximum possible extent.

The FreeBSD operating system basically uses the Unix File System (UFS) architecture for its underlying filesystem. Berkeley made more advancements to it referred to as the "Berkeley Improvements" or "Berkeley Extensions". This filesystem, currently used by FreeBSD as its native filesystem is often called the "Fast Filesystem" or FFS, because access reads and writes to data stored in FFS is very fast. The architecture is a little more complex than Linux's ext2fs. It offers a better way to insure filesystem data integrity, mainly with the "softupdates" option. This option decreases synchronous I/O and increases asynchronous I/O because writes to a UFS filesystem are not synced on a sector basis but according to the filesystem structure. This ensures that the filesystem is always coherent between two updates.

The FreeBSD filesystem also supports file flags, which can stop a would-be intruder dead in his or her tracks. There are several flags that you can add to a file such as the immutable flag. The immutable (schg) flag would not allow any alteration to the file or directory unless you remove it. Other very handy flags are append only (sappnd), cannot delete (sunlnk), and archive (arch). When you combine these with the kernel security level option, you have a very impenetrable system.

3. Summary of Installation Steps

The partitioning scheme and filesystems covered in FreeBSD, its time for us to move on to the actual FreeBSD installation. For a complete step-by-step coverage of FreeBSD installation, please consult the installation guide available on the FreeBSD Project web site. As in the previous Chapter, here also, I would be mentioning only the significant steps for the installation. Use these steps to install FreeBSD on your computer and configure it for "multiple-booting":

  1. Right now, we have a computer running Microsoft Windows OS. On my PC, it is Windows 98 (SE). I put a bootable FreeBSD 4.7-RELEASE CD-ROM in the CD-ROM drive and reboot the system.
  2. The computer boots, reads the CD-ROM, displays the usual hardware probing messages on the screen, and presents you with the Kernel configuration menu. Exit it using a 'Q' and proceed to the FreeBSD System Installation and Configuration Utility. In FreeBSD it is called the /stand/sysinstall utility.
  3. Once the /stand/sysinstall screen appears, select a Novice, Custom or Express install. I choose the Custom installation because it provides the optimum flexibility. For novice users, I would suggest using the Recommended installation. Proceed as usual, till you reach the FreeBSD Fdisk editor.
  4. Here select the unused space and create 2 approximate equal partitions. Thus, 2 slices would be created (in addition to the one that already exists). One would be used for installing FreeBSD and the other for Red Hat Linux later. Readers with intermediate and/or expert FreeBSD knowledge should find this easy to do. After creating these 2 partitions, there should be no free space of your hard disk. Exit saving all the changes and proceed as usual to the FreeBSD Disk label editor. Readers must note: While creating the Linux slice, the filesystem ID should be 131. This creates a Linux native filesystem (ext2fs filesystem). Otherwise, the default FreeBSD UFS filesystem would be created.
  5. The next screen allows you to install a boot manager. Since Microsoft Windows 98 (SE) overwrites the MBR rendering any other OS unbootable (so mean man!), you should choose to install the FreeBSD boot manager in the Master Boot Record (MBR) of your hard disk. I have installed FreeBSD alongside another operating system on the same hard disk, and I want FreeBSD to boot the other operating system when I start the computer. That is the reason, I installed the FreeBSD boot manager into the MBR. Once done, we enter the Sysinstall Disklabel Editor.
  6. The Sysinstall Disklabel Editor represents the already existing Windows FAT32 partition. Readers must note that FreeBSD names this partition as a FreeBSD slice but without an appropriate "mount point". Here, I would create the logical partitions for the FreeBSD slice (which is /dev/ad0s2).
  7. On my PC, the Windows FAT32 partition is named /dev/ad0s1 (C: in DOS). In other words, it is the first slice on the IDE hard disk of my computer. Disklabel can automatically create partitions for you and assign them default sizes if you press the key A. Depending on the size of the disk you are using the defaults may or may not be appropriate. For me, it works most of the time! To quote from the FreeBSD Handbook, "...Beginning with FreeBSD 4.5, the default partitioning assigns the /tmp directory its own partition instead of being part of the / partition. This helps avoid filling the / partition with temporary files...". This is an important consideration if you have a lot of temporary files to deal with. I create a /, swap, /usr, /var and other usual partitions in my FreeBSD slice (named as /dev/ad0s2).
  8. Once the slices created and partitions within the FreeBSD slice set and done, we proceed to choose what to install on the system. Depending on the intended use and resources at your disposal (or available), you must make the correct choice of what to install and what NOT to install. You are the best judge of that. For example, Mr. A just wants to check out FreeBSD 4.7-RELEASE for fun! Well, a "Minimal Install" is the best choice for him. It saves him both time and hard disk space. His brother, Mr. B is a hot-shot Kernel Developer. He wants access to documentation, full system binaries and the Kernel source code. He would go in for a "Kern-Developer" canned distribution set. And if you have enough resources at your disposal or if it so happens you do not want to use the pkg_add tool to install packages later or from the ports collection manually, well, as it so happens, you can always go in for the "All" install option. This would install everything on the system. Thus, we see that the predefined options range from installing the smallest possible configuration (Minimal) to everything (All). Those who are new to Unix and/or FreeBSD should almost certainly select one of these canned options. Readers must note: If a graphical user interface is desired then a distribution set that is preceded by an X should be chosen. The configuration of XFree86 and selection of a default desktop is part of the post-installation steps.
  9. Next, choose the installation media from the list of available choices. I guess you are doing a Local CD/DVD-ROM installation just like me! Using the arrow keys highlight "Install from a FreeBSD CD/DVD", and press Enter to proceed with the installation. (Concerned, [OK] was highlighted). If it so happens that you want to undertake a different kind of installation, choose the appropriate option and follow the steps.
  10. Next appears the "Committing to the Installation" screen. You would be asked whether you are sure of installing FreeBSD on this system or NOT. Select [ Yes ] and press Enter to proceed. The installation can now proceed if desired. Readers must note: This is ABSOLUTELY the last chance for aborting the installation to prevent changes to the hard drive.
  11. The installation time will vary according to the distribution chosen, installation media used, and the speed of the computer. There will be a series of messages displayed indicating the status. The installation is complete when the following message is displayed: "Congratulations! You now have FreeBSD installed on your system....".
  12. Next comes the post-installation steps. It usually involves chores as "Network Device Configuration", "Configure Gateway", "Configure Internet Services", "Anonymous FTP", "NFS Server", "NFS Client", setting up a "Security Profile", "System Console Settings", "Setting The Time Zone", "Adding Users and Groups" and so on. For an exhaustive covering of each and every step along with helpful screenshots, please refer to the FreeBSD Handbook at
  13. Once you have completed the post-installation steps, exit the /stand/sysinstall system installer utility, take out the CD-ROM, and reboot the system. When your computer reboots, since you have installed the FreeBSD boot loader into the MBR (Master Boot Record) of your hard disk, you would normally get a following kind of prompt on your screen. It display something like: F1 DOS, F2 FreeBSD, F3 Linux; each one in a separate line. The Default: F1 is also shown. FreeBSD uses a 3-stage bootstrap by default, and this is actually the preceding bootblock, named /boot/boot0, which lives on the Master Boot Record, the special part of the disk that the system bootstrap looks for and runs, and it simply shows a list of possible slices to boot from.
  14. Press F1 to boot into Microsoft Windows OS. On my computer, I successfully booted into Windows 98 (SE). So far so good! I rebooted and pressed F2 this time, and I successfully booted into FreeBSD as well. Bingo! You already have a dual-boot system which uses the FreeBSD boot loader to boot 2 operating systems.
  15. Depending on the configuration of your computer, you will receive bootup messages on your screen when you boot into FreeBSD for the first time. Though the messages scroll off the screen rather fast for you to read anything productive, you can always read it later by using the "/sbin/dmesg | more" command. Finally, you will arrive at the login prompt. Login using the username/password you set during installation. Readers must note: The Linux slice is not ready yet, cause we have not defined the mount points of the root (/) directory and swap filesystem as well. So, for doing this and more, we proceed to the next chapter, Chapter 5: Installing Red Hat Linux 7.3 (Valhalla). Readers must note: If you have already installed FreeBSD, you can skip the next chapter, Chapter 4: Installing OpenBSD 3.2-RELEASE and proceed with the Linux installation directly.

Previous Home Next