Roland's homepage

My random knot in the Web

Updating multiple systems using a pre-built FreeBSD

date: 2013-03-08
reading time: 2 min.
category: freebsd
tags: laptop

Recently I updated my workstation to FreeBSD 9.1-RELEASE-p1. Since my laptop runs the same OS, I wanted to update it without rebuilding the world and kernel locally. I used the folowing steps to accomplish that.

  • Using netcat in combination with tar, the directories /usr/src and /usr/obj were transferred to the second machine.
  • Copy the /etc/src.conf file from the first to the second machine. This is important. If they are not identical on both machines, the install might fail because it might go and look for a piece of software that wasn’t built!
  • On the second machine, login as root, go to /usr/src and run make installkernel. Then reboot into single user mode. Mount the necessary partitions:
# mount -u -w /
# mount /usr
# mount /tmp
# mount /var
  • Run mergemaster to prepare for the installworld step:

    # mergemaster -p
    
  • Install the OS:

    # cd /usr/src
    # make installworld
    
  • Install new and updated configuration files. Anything that is in my private repository is skipped here and updated from there:

    # mergemaster
    
  • Next I install my own configuration files. This uses an install program that I built myself.

  • Clean up old files from the previous version. These command will ask you to confirm to delete files.

    # cd /usr/src
    # make delete-old
    # make delete-old-libs
    
  • Reboot into the upgraded OS, log in as root and start the rsync(1) daemon on the second machine.

  • Using rsync on the first machine, I then copy all the updated ports from the first machine to the second. You should replace TARGET with the hostname of the second machine, and /usr/local/etc/rsyncd.conf should be set up on the second machine to recognize the path /usr/local as the local module.

    # rsync -av --delete /usr/local/ TARGET::local
    
  • The previous step will have copied some configuration files in /usr/local/etc from the first machine (unless they’ve been excluded). Refresh them as necessary.


For comments, please send me an e-mail.


Related articles


←  Should system backups be compressed? Automated local backups  →