Defcon-1-Logo

           [Home]    [FBSD Articles]    [Scripts Corner]    [Contribute]    [Search]    [FBSD Links]    [Files]

About Us

FreeBSD Articles
  *Hardware
  *Networking
  *Security
  *Software
  *X Windows


Files / Scripts
Newbies Corner
Tech. Talk
Tips and Tricks


FreeBSD Links

Articles in other
Languages :
  *French Articles
  *Spanish Articles

Want to Help ?
 
   Click Here

Email Users 5

Search:
 

 


FreeBSD Search:


 

 

Powered-By-Apache-Logo

         Defcon1 Logo


                  BINARY UPGRADE HOW TO

 

There are 2 binary upgrade examples here. The first one is an example of the steps through from 3.4-Release to 4.0 Release, it is in depth and should provide a rather "think free" instructions for upgrading from 3.4 -> 4.0 and future versions. Another upgrade example is below going from 4.0 to 4.0 stable binary style without floppies.

 

Why upgrade binary style and not via source?
Well there are many positive reasons. The most popular reasons that come to my mind is that you
can be more sure you will get the final result, it can be alot faster then building all from source
and requires alot less hard drive space.

Lets get to it!
The first thing you should do is read all the TXT files in your /4.0-RELEASE-i386 dir
Next backup your files! If your wondering what you should backup, the main files I back up are
my config files in /etc and /usr/local/etc. Basically all the files you would wish you still had
if your whole hard drive spontaneously combusted are the ones you should backup :).

Planning
I am going to show you the way to do a binary upgrade from an existing partition although you
should be able to do it all the other common ways, existing partition upgrade I think is easiest.
We are going to be doing a binary + Ports + X windows + kernel sources install.
So you will have to delete your /usr/src/sys and /usr/ports/ directory, you should save your
/usr/src/sys/i386/conf/ kernel options file just to look at but not use for your 4.0 kernel
compile.

If you are on dialup you may consider moving your /usr/ports/distfiles dir somewhere
else that contains all your downloads that ports has retrieved if you have installed software
from ports via the internet and move it back once the install is over.

Take note of the information from the "df" command as it will help you mount your partitions
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/wd0s1a 49583 39433 6184 86% /
/dev/wd0s1f 1106911 877351 141008 86% /usr
/dev/wd0s1e 19815 5385 12845 30% /var

All you really need is the Mounted on dir and the size

Make your boot floppies.
Although you will be installing from your hard drive you start things up from the boot floppies.
Info on floppie creation here.
http://www.freebsd.org/handbook/install-guide.html#INSTALL-FLOPPIES

Next step is to copy all the install files from /4.0-RELEASE-i386/ dir to your Freebsd hard drive
or any hard drive you can mount that has enough space to hold all of the installation files so
it looks like this

/usr/temp/4.0-RELEASE-i386/src/
/usr/temp/4.0-RELEASE-i386/Errata.txt

Ready to start
Boot from the boot floppies
Go through your kernel configuration
Then when you get to the Sysinstall Main Menu choose UPGRADE
Choose Yes to proceed
Choose the Binary + Ports + X windows + kernel sources install or what ever you prefer


When you get to the FreeBSD Disklabel Editor all you have to do with it is mount your old
partitions with the right directory name, I have to mount /usr, /var and / (root).
These vary depending on how you last configured your partitions so you will have to do
things a little differently.
Use the arrow keys select your first partition and choose M to mount
When it asks the mount point put / if its your root partition.
Leave the swap as it is.
Do this for all the drives from the information you collected from "df"
when done hit Q


It should go on and check the hard drives then ask you where you want to save the etc directory?
the default place is a good one /usr/tmp/etc

Next you will be presented with the Choose Installation Media menu and asked where your
FreeBSD installation files are, so choose 6 for File System - Install from an existing filesystem
and enter the dir where you put the files

/usr/temp/4.0-RELEASE-i386
If the directory did not exist check your case.

Your home
Once you have finished the install you will have to recompile your kernel and then look at every
file in /etc that has the new file date release and compare that with your old saved ones and
reconfigure them if you need

Then check the latest errata at http://www.freebsd.org/releases/ for any known bugs.

Pat your self on the back you now have a FreeBSD 4.0-RELEASE install :)

 

***********************************************************************************************

BINARY UPGRADE WITH OUT FLOPPIES / SYSINSTALL

This part two of binary upgrade it is just a nother way of upgrading. The main advantage of this way is that it doesn t require floppies.

 

Try and get your release/stable snap shot from a local mirror, stable snap shots aren t as commonly mirrored as the release snap shots so try the links below. Snap shots aren t mirrored as much probably because their not as sort after as much because if every one upgraded this way it would be using alot of net bandwidth.

 

http://www.itworks.com.au/~gavin/FBSDsites.php3

If that fails snap shots for stable 4 snaps are here

ftp://releng4.FreeBSD.org/pub/FreeBSD/

 

Planning

This method starts of the same way as the method above. Get your binary distribution and place it in a dir lets say

/usr/temp/4.0-stable-i386/bin/

/usr/temp/4.0-stable-i386/src/

/usr/temp/4.0-stable-i386/Errata.txt

Be sure to read all the txt files for important information.

 

Backup your files

You must backup your /etc dir because the bin package does overwrite you /etc dir!

cp -Rp /etc /etc.old

 

Do this as root so to be sure to get your passwd files and other user unreadable files.

 

Start the upgrade

You should boot into single user mode when upgradeing.

shutdown now

Is fast easy way

Or you can reboot the system and at the boot prompt type

Boot s

To boot into single user mode, this way you can be sure no demons are running.

Choose your shell (sh)

Then mount and check your file systems.

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

 

Things to delete

 

If you are going to upgrade your ports and kernel sources you will need delete the old ones or else you will have bits of old files sitting with the new ones. Although remember its worth while keeping your kernel options file to rebuild your kernel.

rm rf /usr/ports/*

rm rf /usr/src/sys/*

 

Extracting the binaries

Now go into your binary install dirs and start the extraction over the old ones

This is the procedure for the bin dir

cd /usr/temp/4.0-stable-i386/bin/

chmod 744 install.sh

./install.sh

When its done all your binary files will overwritten with the latest version. You can check that by looking at the new file date

ls al /bin/sh

Simply follow the same procedure for all the files you need to upgrade.

When extracting kernel sources you need to specify ssys so you do not extract the other sources.

./install.sh sys

 

WARNING

Extracting the bin files will extract and create directories for all of your core files. Including all of your root dirs.

/bin             /etc             /modules         /sbin            /usr            /boot            /proc            /sys             /var

/dev             /mnt             /root            /tmp

If you extract the bin package it will simply overwrite all the files in your etc dir that already exist including your master.passwd file, the configuration files don t change much and you should be able to get away with just copying back your

Old /etc/ dir back over the newly created one.

cp -Rp /etc.old /etc

 

You should keep the new /etc/defaults/rc.conf file, if you have been editing your /etc/defaults/rc.conf file instead of placing any changes to it in /etc/rc.conf which always overrides your /etc/defaults/rc.conf then fix it now.

 

To overwrite your old rc.conf from your /src/ dir do

cat bin.?? | tar --unlink -xpzf - -C / '*defaults/rc.conf*'

 

Finshed alreadyJ

 

Once you have finished the install you will have to recompile your kernel.

 

If you want to talk about the article you can catch me on irc as purple/purpsomething in #freebsdhelp or email me

 

 michael_vince@hotmail.com

Email Us

ghostrdr@defcon1.org

This site cannot be duplicated without permission

© 1998 - 2010 Defcon1, www.defcon1.org. Copyrights for all materials on this web site are held by the individual authors, artists, photographers or creators. Materials may not be reproduced or otherwise distributed without permission of www.defcon1.org and the content's original author.