# Upgrading kernel frem 6.3 to 7



## sniper007 (Nov 17, 2008)

Hi!

At first i would like to say that i'm realy glad because this forum was launched. 

Also have a question. 

I intend to upgrade my Freebsd box (6.3-STABLE) to newer version of kernel 7 (stable). I wish that won't have any kind of problems (like kernel panic, you know... :e ) because this box is main gateway... 

I use cvsup and this is my *src-supfile*



> *default host=cvsup.FreeBSD.org
> *default prefix=/usr
> *default base=/var/db
> *default release=cvs tag=RELENG_7
> ...



What can I expect ?


----------



## trasz@ (Nov 17, 2008)

Everything should be fine.  Two things, though: First, on operating systems other than Linux, you don't upgrade the kernel itself - you upgrade the whole operating system; in this case, both the kernel and the 'world', which is a FreeBSD name for parts of the system that are not kernel.  Please follow the instructions in http://www.freebsd.org/doc/en/books/handbook/makeworld.html.

Second thing is, there is a tool named 'csup' in the base system now; you no longer have to install cvsup from ports.


----------



## sniper007 (Nov 17, 2008)

Thanks for quick replay.

What do you mean is run of mergemaster -p needed before the buildworld step ?


----------



## marino (Nov 17, 2008)

sniper, I recommend that you use Colin Percival's Major Version Upgrade script

http://www.daemonology.net/blog/2007-11-11-freebsd-major-version-upgrade.html

It worked great for me.  Since you're running 6.3 the script should already be on your system.


----------



## Lowell (Nov 17, 2008)

I *strongly* recommend following the officially supported upgrade path:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html


----------



## WuzWuz (Nov 17, 2008)

sniper007 said:
			
		

> I intend to upgrade my Freebsd box (6.3-STABLE) to newer version of kernel 7 (stable). I wish that won't have any kind of problems (like kernel panic, you know... :e ) because this box is main gateway...



I would go for 7 stable:

*default release=cvs tag=RELENG_7_0

My 2 cts.

Peter


----------



## sniper007 (Nov 17, 2008)

thanks *marino* to inform me that this script exist but i'm not enthusiastic about scripts because it can work something what i don't want... like windows wizard :\


----------



## bsddaemon (Nov 17, 2008)

sniper007 said:
			
		

> Hi!
> 
> I wish that won't have any kind of problems (like kernel panic, you know... :e ) because this box is main gateway...



Just make a backup to another HDD, then nothing to worry about. Your dog now can eat your old data for breakfast!

Your build and install world and kernel processes should be done without any problem, but just be aware with port upgrading. New version are worst than old ones and broken dependencies are likely to happen.


----------



## brd@ (Nov 17, 2008)

RELENG_7 is the 7 branch, which is becoming 7.1. RELENG_7_0 is the 7.0 security branch like 7.0-RELEASE-p5.


----------



## marino (Nov 17, 2008)

Lowell said:
			
		

> I *strongly* recommend following the officially supported upgrade path:
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html



Are you saying that the upgrade script distributed with FreeBSD 6.3 and FreeBSD 7 is not official?


----------



## SirDice (Nov 17, 2008)

I'd backup all config files and other data and install 7 from scratch. The partition sizes (most notably for /) have increased a bit. 7 needs a bit more space. It's also a good way to get rid of all the 'old' stuff


----------



## bsddaemon (Nov 17, 2008)

SirDice said:
			
		

> The partition sizes (most notably for /) have increased a bit. 7 needs a bit more space.



You can do the traditional way: dump and restore. I do it all the time


----------



## SirDice (Nov 17, 2008)

True.. But it's kind of dangerous to run out of disk space halfway through installworld


----------



## Lowell (Nov 17, 2008)

marino said:
			
		

> Are you saying that the upgrade script distributed with FreeBSD 6.3 and FreeBSD 7 is not official?



It's official; it's just not officially supported for use with cvsup, which the original poster indicated was the case.


----------



## vivek (Nov 18, 2008)

Before doing anything read /usr/src/UPDATING and backup data including config and sql database. Once done sync source code:

```
csup /path/to/your/supfile
```
T to build base system:

```
cd /usr/src
make buildworld
```
Next, kernel

```
make buildkernel
make installkernel
```

You may need to specify connfig file using KERNCONF option:

```
make kernel KERNCONF={NAME}
```
Reboot system and boot into a single user mode :

```
cd /usr/src
mergemaster -p
```
Accept the changes as promoted as per your configuration. 

```
make installworld
```
Finally, merge your configuration files, enter:

```
mergemaster -i
```
Reboot one  more time. Finally, upgrade apps too

```
portsnap fetch extract
portversion
portupgrade -a
```

This is what I do everytime I upgrade my box. Hope this helps!


----------



## danger@ (Nov 18, 2008)

the requirement is only related to the kernel - if you do not build modules, you don't have to worry about this so much.


----------



## phoenix (Nov 19, 2008)

WuzWuz said:
			
		

> I would go for 7 stable:
> 
> *default release=cvs tag=RELENG_7_0



RELENG_7 == 7-STABLE
RELENG_7_0 == 7.0 security branch (aka 7.0-RELEASE + patches)
RELENG_7_0_0_RELEASE == 7.0-RELEASE (all the same bits you get on the install CD)


----------



## Itodaen (Nov 20, 2008)

Hi,

For the minor updates, when already running v7.x, any risk of running after csup entire update together with installworld in the same line and then rebooting only once ? :


```
cd /usr/src && make buildworld && make buildkernel && make installkernel \
&& make installworld && reboot
```


----------



## cajunman4life (Nov 21, 2008)

It's *strongly* recommended that the "make installworld" step takes place in single user mode. But no matter how you do it, it should be done after you've booted into the new kernel (especially after a major version upgrade). New world running on an old kernel making new kernel calls = bad mojo.


----------



## MG (Nov 24, 2008)

trasz@ said:
			
		

> Everything should be fine.  Two things, though: First, on operating systems other than Linux, you don't upgrade the kernel itself - you upgrade the whole operating system; in this case, both the kernel and the 'world', which is a FreeBSD name for parts of the system that are not kernel.  Please follow the instructions in http://www.freebsd.org/doc/en/books/handbook/makeworld.html.
> 
> Second thing is, there is a tool named 'csup' in the base system now; you no longer have to install cvsup from ports.



Why? Upgrading the kernel without the world is quite possible. You don't even need to use the make buildworld or make buildkernel commands. Just enter the source directory of the part you want to compile and type make && make install.

Ofcourse the 7.0 kernel might encounter problems running with a 6.3 or earlier userland because some new things aren't there yet, but just for testing I don't see any real problems here. And at last you can always manually load any kernel from the bootloader menu.


----------



## trasz@ (Nov 25, 2008)

MG said:
			
		

> Why? Upgrading the kernel without the world is quite possible. You don't even need to use the make buildworld or make buildkernel commands. Just enter the source directory of the part you want to compile and type make && make install.
> 
> Ofcourse the 7.0 kernel might encounter problems running with a 6.3 or earlier userland because some new things aren't there yet, but just for testing I don't see any real problems here. And at last you can always manually load any kernel from the bootloader menu.



It is possible, but it's not safe, unless you are really sure there were no changes that could break binary compatibility with parts of userland.  Given that buildworld takes just a few hours running with low priority in the background, it's just not worth the risk for the ordinary user or sysadmin.


----------



## trasz@ (Nov 25, 2008)

That reminds me - the mergemaster tool is really confusing.  So: when given the choice of either 'i'nstall or 'd'elete, keep in mind that it really means 'replace with new one' and 'keep the old one', respectively.  To get the new version from FreeBSD sources (/usr/src/etc/), use 'i'.  To keep the current version, use 'd'.

These should be renamed in the mergemaster source, imho.

Also, remember that instead of upgrading from sources, you can use freebsd-upgrade.  It's a binary upgrade that's much faster than source upgrade; it has one drawback, however - it works only with released versions (i.e. not with STABLE) and with stock kernels.


----------

