Upgrading FreeBSD - Page 3

The above steps are for everyone using a generic kernel which I assume is most everyone reading this document. If you are using your own customer kernel already you have already went through these steps and probably know what it is you are doing. If you have inherited this system running a custom kernel reference page 491 of book FreeBSD Unleashed and it will have everything you need or you can reference the FreeBSD Handbook either I say is a must for your professional bookshelf.

If you have followed this document step by step all the above steps should have completed without any errors at all, what I like to say is everything went smooth as Stewie Griffiths bottom :) For those adults not familiar treat yourself to a good laugh with the Adult Cartoon Family Guy.

Lets get back to business, now you need to boot your system into single user mode. All of the steps above could have been done through some sort of virtual connection like ssh or vpn connectivity these next steps you will need access to the console itself.

Reboot your machine

# shutdown -r now

This will shutdown all processes gracefully and began the reboot process. When your system starts to boot back up and you are given the options make sure you choose option 4 so that you boot into single user mode. Now run

# fsck -p
# mount -u /
# mount -a -t ufs
# swapon -a

This checks the file systems, remounts / read/write, mounts all the other UFS file systems referenced in /etc/fstab and then turns swapping on.

Note: If your CMOS clock is set to local time and not to GMT (this is true if the output of the date(1) command does not show the correct time and zone), you may also need to run the following command:

I would do it just to be safe if you are not sure.

# adjkerntz -i
# cd /usr/src

This may seem a little scary for the first time but so far it has been a little easier than what it seems. This next piece we will run mergemaster though it is a great tool there seems to be little documentation for it. Of course there is the man page which I would recommend reading. This tool basically compares the files you are about to install in the next step to the files you already have on your system. When running mergemaster you will get options presented to you for each file that looks like such

Use 'd' to delete the temporary .name of file
Use 'i' to install the temporary .name of file
Use 'm' to merge the temporary and installed versions or parts of them.
Use 'v' to view the diff results again
Default is to leave the temporary file to deal with by hand
How should I deal with this? [Leave it for later]

My rules of thumb on this is:

Files I don't want changed which would be files that I have edited by hand like ntpd.conf for setting up time syncing I just hit enter so that I can go back later and compare and edit the files by hand which will not be all that many. Make note of the files you need to go back and compare.

The 'i' is for files that I haven't customized that won't affect things I want my FreeBSD box to do. Most of my files in mergemaster will get this option. Some examples for me are rc.diskless, pam.conf, and rc.syscons. I didn't need to customize these files and their changes won't affect your server install but will need to be there.

Before we proceed we need to take out an insurance policy. As I have stated mergemaster is a very safe tool to use but there is a lot of room for error considering the fuzzy logic that resides between the chair and the keyboard :) We create our insurance policy simply by doing

# cp -Rp /etc /etc.old

This copies what should be all of your current config files to a backup directory /etc.old.

We are now reading to compare the old and new files.

# mergemaster -cv -w 120

This will run mergemaster with verbosity along with a screen width of 120 instead of the standard 80. If run with the standard 80 sometimes it looks as if the split screen between the files are all one. Proceed through carefully and slowly examining each file keeping in mind my rule of thumb above.

Now that you are done with mergemaster the scariest part of this upgrade, you are ready to wrap things up.

Now run

# cd /usr/src
# script ~/installworld
# make installworld

After this is done with no errors you are complete except for checking your work and bringing the system back up. At this point reboot the system and watch it come up make sure all your startup scripts run and most time they will.

# reboot

After the system is up take a deep breathe for that sigh of relief, now make sure you booted on the new kernel by executing from sudo or root

# uname -a

You should now be on the new kernel compare this to the output you took before going through the upgrade. Now try using tools such as ps and top these should be functioning without error. Now go pat yourself on the back and get your favorite beverage, hold your head high with your chest stuck out and feel proud of what you have just accomplished.


As I stated when I first completed this task years ago there was a lot of documentation but it was very piece meal. I had a bunch of separate notes in one document all out of place that I used to reference from time to time. As of getting my website together I took those notes and created this documentation as an easy walk through guide. There does seem to be a tad bit more information that you can find with a simple Google search now. But it does seem to be a bit more complicated and scary for the first time upgrader, again the reason for this document.




Must have books for your bookshelf, I am not associated with any of these but it does help support the opensource movement, which gave us the capability for this great server we have created.




Hints and Tips

It is always recommended that you keep a good backup. I was blessed with a NAS as a gift from my wife that serves this purpose for me. It is connected to my network and I use the utility rsync to backup to this device. It really works out great because very little hours get put on this drive as it is only on when I am doing my weekly backup which is good enough for me for a home server. A usb drive could also serve this function. I would surely recommend that you come up to speed on rsync and start using it. You can get started by visiting


And though this gentleman wrote this for an older version of FreeBSD it will work with your install and it is great easy to follow documentation



Drop me a line

This document written and maintained by Elijah Savage at http://www.digitalrage.org with OpenOffice 2.0 and exported to PDF,Doc, and rtf formats for versatility and ease of use for the end user. OpenOffice what a great app.

Download this Document

PDF Format

Word 97/2000/XP Doc Format

OpenOffice Format

Rich Text Format

Share this page:

Suggested articles

0 Comment(s)

Add comment


By: bsdguy